<!-- skill: ComfyUI Nodes | version: 1.0.0 | description: Manage nodes, KSampler chains, LoRA and ControlNet workflows | category: AI & Automation -->
## Instructions
- Install ComfyUI via portable build or git clone, then install ComfyUI-Manager first for one-click custom nodes.
- Install node packs deliberately: ControlNet Aux, Impact Pack, WAS Suite, UltimateSDUpscale — restart after each batch.
- Build KSampler chains as Checkpoint > CLIP Text Encode (pos/neg) > KSampler > VAE Decode > Save Image, never skip VAE.
- Load LoRAs with LoraLoader stacked after checkpoint: test weight 0.7 first, then sweep 0.5/0.8/1.0 on fixed seed.
- Wire ControlNet with preprocessor + Apply node: depth for composition, openpose for pose, canny for line hold.
- Version every workflow JSON in git: workflows/v1.2_portrait.json with prompt, seed, model hash in commit message.
- Set VRAM flags to match GPU: --normalvram for 8GB, --lowvram for 6GB, --highvram + --preview-method auto for 12GB+.
- Use fp16/fp8 checkpoints on low VRAM: fp8 unet + fp16 VAE saves 2GB with negligible quality loss.
- Queue in API mode for batches: enable --enable-cors-header, POST prompt JSON, poll history endpoint for PNG.
- Batch with efficiency nodes: KSampler Efficient + XY Plot (seed x CFG) overnight before committing to finals.
- Snapshot Manager before upgrades: export custom-nodes list, backup models/, test one known workflow after update.
- Pairs with ai-video-gen skill: lock character seed there, build node graph here for repeatable renders.
## Examples
- Example 1: Portrait chain: SDXL base + Detail LoRA 0.7 + depth ControlNet 0.6, KSampler 30 steps dpmpp_2m, Hires 1.5x.
- Example 2: Product batch: 20 prompts queued via API, same seed family 1000-1020, UltimateSDUpscale 2x final.
- Example 3: Pose lock: openpose preprocessor on ref photo, pose strength 0.8, prompt delta only for 10 outfits.
- Example 4: VRAM rescue: 6GB card switches to --lowvram + fp8 + tiled VAE 512, 768px base then tiled upscale.
## Workflows
- Workflow A — New setup: 1. Install portable 2. Manager 3. Node packs 4. Models to checkpoints/loras/controlnet 5. Test workflow.
- Workflow B — KSampler final: 1. Draft 20 steps 2. XY sweep 3. Lock seed 4. 40 steps + refiner 5. Hires 6. Save JSON.
- Workflow C — LoRA/ControlNet: 1. Load LoRA 0.7 2. Preprocess control image 3. Set strength 4. Test 3 weights 5. Batch.
- Workflow D — Versioning: 1. Save API JSON 2. Git commit with seed/model 3. Tag release 4. Export PNG with metadata.
## Templates
- VRAM launch flags:
```
# 8GB RTX 3060 Ti daily driver
python main.py --normalvram --preview-method auto --use-pytorch-cross-attention
# 6GB laptop fallback
python main.py --lowvram --fp8-vae --use-split-cross-attention --disable-smart-memory
# 24GB workstation batch
python main.py --highvram --force-fp16 --enable-cors-header --port 8188
```
- KSampler API prompt JSON:
```json
{
  "3": {"class_type": "KSampler", "inputs": {"seed": 4242, "steps": 30, "cfg": 6.5, "sampler_name": "dpmpp_2m", "scheduler": "karras", "denoise": 1.0}},
  "4": {"class_type": "LoraLoader", "inputs": {"lora_name": "detail_v2.safetensors", "strength_model": 0.7, "strength_clip": 0.7}},
  "5": {"class_type": "ControlNetApply", "inputs": {"strength": 0.6, "control_net_name": "depth_sd15.safetensors"}}
}
```
- Workflow version header: name portrait-sdxl-v1.3 | model juggernautXL_v9 + fp16 | seed 4242 | git tag wf-1.3.
- Manager snapshot: ComfyUI-Manager > Snapshot > Save, commit custom-nodes.txt + workflows/weekly.
## Tools
- ComfyUI-Manager — install/update/disable custom nodes and snapshot environments before upgrades.
- ControlNet Aux Preprocessors — depth, openpose, canny, lineart in-graph without external preprocessing.
- Impact Pack + WAS Suite — face detailer, wildcard prompts, image filters that cut manual editing time.
- UltimateSDUpscale — tiled 2x-4x upscale that fits 6GB VRAM where Hires-Fix OOMs.
- Civitai + HuggingFace — vetted checkpoints, LoRAs, ControlNet weights with license tags.
- ComfyUI API + websocket — queue prompts headlessly for overnight batches and front-end integrations.
## Advanced
- Split hires pipeline: base 768px denoise 1.0, then img2img 0.45 denoise at 1.5x to sharpen without recomposing.
- Chain two ControlNets: depth 0.6 + openpose 0.8 with preprocessor resolution 512 for stable multi-figure scenes.
- Use fp8 unet for Flux: flux1-dev-fp8.safetensors + T5 fp8 clip cuts 24GB requirement down to 12GB workable.
- Cache VAE decode with tiled VAE node at 512px tiles with 64 overlap to kill OOM on 4K targets.
- Diff workflow JSONs with jq: jq '.nodes | keys' v1.json v2.json to audit changes before sharing publicly.
- Route queue across two GPUs: CUDA_VISIBLE_DEVICES=0 port 8188, =1 port 8189, round-robin API POSTs.
- Log VRAM per node: enable --verbose, note peak MB per KSampler/Hires combo in workflow README.
- Freeze production graphs: duplicate editable graph to _dev, export locked _prod JSON nobody edits by hand.
## Documentation
- ComfyUI Wiki — install, CLI flags, Manager usage and custom node troubleshooting index.
- ComfyUI-Manager README — snapshot, restore, missing-node install and update-channel policy.
- ControlNet Aux docs — preprocessor list, resolution settings, strength tuning per model type.
- Civitai model cards — trigger words, recommended CFG/steps, commercial license per checkpoint/LoRA.
- KSampler sampler guide — dpmpp_2m vs euler vs heun trade-offs for speed, skin texture, hands.
