ComfyUI Workflow Guardian
Use this skill to work on ComfyUI like an infrastructure and workflow engineer, not like an improvising prompt tweaker.
Core Rules
- Back up the target workflow before editing it.
- Change only the workflow the user explicitly names. Do not sync other workflows unless asked.
- Inspect runtime failures before editing the workflow. A dead backend is not a workflow bug.
- Prefer one precise change over many speculative changes.
- Keep optional modules behind switches so they do not add cost when disabled.
- Preserve working post-processing sections unless the user explicitly wants them changed.
- Prefer validated architecture rules over folklore or one-off community claims.
Workflow
1. Classify the task
Classify the request before touching files:
- Runtime failure: startup crash, queue crash,
Failed to fetch, access violation, provider error
- Structure failure: broken links, missing files, overlapping nodes/groups, unreadable layout
- Quality failure: identity drift, anatomy defects, artifacts, color shifts, over-smoothing
- Performance failure: generation too slow, unnecessary modules active, too many second-pass steps
- Architecture change: adding or comparing LoRAs, identity modules, refiners, control branches
2. Read the right reference file
- Ask the user for the active ComfyUI root and workflow path; never assume workstation-specific locations.
- Read references/runtime-performance.md for crashes, access violations, performance regressions, or backend instability.
- Read references/identity-modules.md for BFS, PuLID, LanPaint-style face transfer, or identity-preservation tasks.
- Read references/workflow-editing-checklist.md before editing workflow JSON.
3. Validate before editing
Run the bundled checker on the target workflow:
python scripts/check_comfyui_workflow.py "C:\path\to\workflow.json" --comfy-root "C:\path\to\ComfyUI"
Use it before and after edits. Treat these as hard failures until explained:
- missing node references
- missing model or LoRA files
- overlapping nodes
- overlapping groups
4. Apply architecture rules
Follow these stable ordering rules unless source documentation for a specific module contradicts them:
- Put the base model loader first.
- Put general LoRAs that shape the base image before the main sampler.
- Put identity model layers after the general LoRA chain when they modify the final model directly.
- Put second-pass face-transfer or inpainting systems after the base image is generated.
- Put detail or sharpening passes after identity transfer, not before.
- Keep manual size overrides, CFG, and quality toggles in a compact quick-access area, but leave original nodes in place if the workflow already depends on them.
5. Change conservatively
- Tighten one branch at a time.
- If a post-pass copies unwanted props, hands, or expressions, reduce what that pass is allowed to transfer instead of raising its strength blindly.
- If identity is weak, test the identity modules separately before combining them.
- If performance is poor, reduce second-pass cost before degrading the main generation stage.
- Do not switch models, precision modes, or providers without evidence that the current setting is the cause.
6. Validate after editing
After edits:
- run the workflow checker again
- confirm the target files exist on disk
- confirm the launcher and runtime still start
- confirm the active workflow still loads cleanly
- summarize only the actual changes, default values, and residual risks
Operating Defaults
Use these defaults when the user does not specify otherwise:
- Keep the user's main workflow as the only edit target.
- Keep the runtime conservative and stable on Windows.
- Treat second-pass identity transfer as optional and isolated.
- Favor clean, non-overlapping layout and short notes over decorative complexity.
- Favor explicit validation over guesswork.
Output Requirements
When finishing a task with this skill:
- name the exact files changed
- name the critical node or runtime settings changed
- state what was validated
- state what remains uncertain
1---2name: comfyui-workflow-guardian-23description: Professional ComfyUI workflow auditing, refactoring, runtime stabilization, model-chain analysis, and performance tuning for Flux and other pipelines on.4---56# ComfyUI Workflow Guardian78Use this skill to work on ComfyUI like an infrastructure and workflow engineer, not like an improvising prompt tweaker.910## Core Rules1112- Back up the target workflow before editing it.13- Change only the workflow the user explicitly names. Do not sync other workflows unless asked.14- Inspect runtime failures before editing the workflow. A dead backend is not a workflow bug.15- Prefer one precise change over many speculative changes.16- Keep optional modules behind switches so they do not add cost when disabled.17- Preserve working post-processing sections unless the user explicitly wants them changed.18- Prefer validated architecture rules over folklore or one-off community claims.1920## Workflow2122### 1. Classify the task2324Classify the request before touching files:2526- **Runtime failure**: startup crash, queue crash, `Failed to fetch`, access violation, provider error27- **Structure failure**: broken links, missing files, overlapping nodes/groups, unreadable layout28- **Quality failure**: identity drift, anatomy defects, artifacts, color shifts, over-smoothing29- **Performance failure**: generation too slow, unnecessary modules active, too many second-pass steps30- **Architecture change**: adding or comparing LoRAs, identity modules, refiners, control branches3132### 2. Read the right reference file3334- Ask the user for the active ComfyUI root and workflow path; never assume workstation-specific locations.35- Read [references/runtime-performance.md](references/runtime-performance.md) for crashes, access violations, performance regressions, or backend instability.36- Read [references/identity-modules.md](references/identity-modules.md) for BFS, PuLID, LanPaint-style face transfer, or identity-preservation tasks.37- Read [references/workflow-editing-checklist.md](references/workflow-editing-checklist.md) before editing workflow JSON.3839### 3. Validate before editing4041Run the bundled checker on the target workflow:4243```powershell44python scripts/check_comfyui_workflow.py "C:\path\to\workflow.json" --comfy-root "C:\path\to\ComfyUI"45```4647Use it before and after edits. Treat these as hard failures until explained:4849- missing node references50- missing model or LoRA files51- overlapping nodes52- overlapping groups5354### 4. Apply architecture rules5556Follow these stable ordering rules unless source documentation for a specific module contradicts them:5758- Put the **base model loader** first.59- Put **general LoRAs that shape the base image** before the main sampler.60- Put **identity model layers** after the general LoRA chain when they modify the final model directly.61- Put **second-pass face-transfer or inpainting systems** after the base image is generated.62- Put **detail or sharpening passes** after identity transfer, not before.63- Keep **manual size overrides, CFG, and quality toggles** in a compact quick-access area, but leave original nodes in place if the workflow already depends on them.6465### 5. Change conservatively6667- Tighten one branch at a time.68- If a post-pass copies unwanted props, hands, or expressions, reduce what that pass is allowed to transfer instead of raising its strength blindly.69- If identity is weak, test the identity modules separately before combining them.70- If performance is poor, reduce second-pass cost before degrading the main generation stage.71- Do not switch models, precision modes, or providers without evidence that the current setting is the cause.7273### 6. Validate after editing7475After edits:7677- run the workflow checker again78- confirm the target files exist on disk79- confirm the launcher and runtime still start80- confirm the active workflow still loads cleanly81- summarize only the actual changes, default values, and residual risks8283## Operating Defaults8485Use these defaults when the user does not specify otherwise:8687- Keep the user's main workflow as the only edit target.88- Keep the runtime conservative and stable on Windows.89- Treat second-pass identity transfer as optional and isolated.90- Favor clean, non-overlapping layout and short notes over decorative complexity.91- Favor explicit validation over guesswork.9293## Output Requirements9495When finishing a task with this skill:9697- name the exact files changed98- name the critical node or runtime settings changed99- state what was validated100- state what remains uncertain