comfy-pilot
CLAUDE.md231 starsChanged 10 months agoMITView on GitHub
When creating or modifying ComfyUI workflows, follow these best practices: Always assign descriptive custom titles to nodes when creating them. This makes workflows much easier to understand when reading them back later. Instead of generic type names like: - CLIPTextEncode → Use "Positive Prompt" or "Style Description" - KSampler → Use "Initial Generation" or "Refine Pass" - LoadImage → Use "Reference Photo" or "Input Image" - VAEDecode → Use "Final Decode" or "Preview Decode" - ImageScale → Use "Upscale 2x"…
- Pipes a download into a shell
- Installs packages
In this repositoryOne other file it gives its agents.
- comfy-nodesSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
23 rules. About 0 are common, 13 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
When creating or modifying ComfyUI workflows, follow these best practices:
- Distinctive: line 9
Always assign descriptive custom titles to nodes: when creating them. This makes workflows much easier to understand when reading them back …
- Distinctive: line 11
Instead of generic type names like:
- Distinctive: line 30
Keep related nodes vertically aligned
- Distinctive: line 31
Minimum padding: Always leave at least 20px of padding between nodes (2 grid units, default grid = 10px)
- Very specific: line 33
Node sizing: When placing a node directly below another node, match the width of the node above it for visual consistency.
- Very specific: line 40
When creating nodes that are not connected to existing workflow (new starting points, separate node groups, or standalone utilities), use …
- Very specific: line 91
Running: Use run(action="queue") to execute, run(action="interrupt") to stop.
- Very specific: line 93
Status: Use get_status(include=["queue", "system", "history"]) for all status info.
- Very specific: line 97
Always search minimal first: - don't request inputs/outputs on broad searches:
- Very specific: line 116
Use get_node_info to check available input/output slots
- Distinctive: line 118
Verify connections match types (e.g., MODEL to MODEL, CLIP to CLIP)
- Distinctive: line 122
When the user wants to "see", "check", "test", or "debug" something:
- Distinctive: line 129
Auto-run when safe: If the workflow only involves lightweight operations, run it automatically so the user can see results immediately:
- Distinctive: line 131
Ask first or inform user: KSampler, image generation, model loading, anything GPU-intensive
- Distinctive: line 133
Example: If user asks "let me see what the camera info looks like", don't just add nodes - add a preview node, connect it, and run the …
- Distinctive: line 139
Search efficiently: - use minimal fields first:
- Distinctive: line 147
Look for nodes with "preview", "show", "display", or "print" in the name
- Very specific: line 151
Request more details when needed: - use fields parameter:
- Very specific: line 157
Prefer uv for package and environment management.
- Very specific: line 163
If uv is available, use it:
- Very specific: line 168
If uv is NOT available, ask the user before proceeding:
- Distinctive: line 171
Only fall back to pip/other tools if the user explicitly prefers them.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ComfyUI Claude Code Plugin - Guidelines
Working with ComfyUI Workflows
When creating or modifying ComfyUI workflows, follow these best practices:
Node Titles
Always assign descriptive custom titles to nodes when creating them. This makes workflows much easier to understand when reading them back later.
Instead of generic type names like:
CLIPTextEncode→ Use"Positive Prompt"or"Style Description"KSampler→ Use"Initial Generation"or"Refine Pass"LoadImage→ Use"Reference Photo"or"Input Image"VAEDecode→ Use"Final Decode"or"Preview Decode"ImageScale→ Use"Upscale 2x"or"Resize for ControlNet"
Example:
comfyui_create_node(node_type="CLIPTextEncode", title="Positive Prompt", pos_x=200, pos_y=100)
comfyui_create_node(node_type="CLIPTextEncode", title="Negative Prompt", pos_x=200, pos_y=300)Node Layout
Position nodes logically from left to right following the data flow:
- Loaders on the left (pos_x ~100-300)
- Processing in the middle (pos_x ~400-700)
- Output/preview on the right (pos_x ~800+)
- Keep related nodes vertically aligned
- Minimum padding: Always leave at least 20px of padding between nodes (2 grid units, default grid = 10px)
Node sizing: When placing a node directly below another node, match the width of the node above it for visual consistency. Use edit_graph with resize action after creation if needed.
Special case: Load 3D & Animation nodes These nodes expand after creation to show a 3D preview. The preview adds ~180px in height. When placing nodes below a Load 3D & Animation node, add at least 200px of extra vertical spacing to avoid overlap.
Placing New Node Groups in View
When creating nodes that are not connected to existing workflow (new starting points, separate node groups, or standalone utilities), use place_in_view: true:
edit_graph(operations=[
{action: "create", node_type: "CheckpointLoaderSimple", title: "Load Model", place_in_view: true, ref: "loader"},
{action: "create", node_type: "KSampler", title: "Sampler", place_in_view: true, ref: "sampler"},
{action: "connect", from_node: "loader", from_slot: 0, to_node: "sampler", to_slot: 0}
])This places nodes at the center of the user's current viewport, so they appear where the user is looking. Multiple nodes with place_in_view in the same batch are automatically offset horizontally to avoid overlap.
When to use place_in_view:
- Creating a new workflow from scratch
- Adding a separate/parallel branch not connected to existing nodes
- Creating utility nodes the user wants to see immediately
When NOT to use place_in_view:
- Adding nodes that connect to existing workflow (use relative positioning or explicit coordinates based on existing node positions)
- Moving or modifying existing nodes
Batch Operations with edit_graph
Use edit_graph for all graph modifications - it batches multiple operations in a single tool call:
edit_graph(operations=[
// Create nodes (use 'ref' to reference in later operations)
{action: "create", node_type: "KSampler", title: "Main Sampler", pos_x: 400, pos_y: 100, ref: "sampler"},
{action: "create", node_type: "CLIPTextEncode", title: "Positive Prompt", pos_x: 200, pos_y: 100, ref: "pos"},
{action: "create", node_type: "CLIPTextEncode", title: "Negative Prompt", pos_x: 200, pos_y: 300, ref: "neg"},
// Set properties (can use 'ref' from create or actual node_id)
{action: "set", node_id: "sampler", property: "steps", value: 30},
{action: "set", node_id: "sampler", properties: {cfg: 7.5, seed: 12345}},
// Connect nodes
{action: "connect", from_node: "pos", from_slot: 0, to_node: "sampler", to_slot: 1},
{action: "connect", from_node: "neg", from_slot: 0, to_node: "sampler", to_slot: 2},
// Move/resize
{action: "move", node_id: "5", x: 400, y: 100},
{action: "move", node_id: "6", relative_to: "5", direction: "below", gap: 30},
{action: "resize", node_id: "7", width: 300, height: 200},
// Delete
{action: "delete", node_id: "3"},
{action: "delete", node_ids: ["4", "5"]}
])Running: Use run(action="queue") to execute, run(action="interrupt") to stop.
Status: Use get_status(include=["queue", "system", "history"]) for all status info.
Searching for Nodes
Always search minimal first - don't request inputs/outputs on broad searches:
- First search without extra fields:
get_node_types(search=["camera", "sampler", "preview"]) - Review results - identify promising nodes from display_name and category
- Get details only for specific nodes you'll use:
get_node_types(search="Stg_CameraInfo", fields=["inputs", "outputs"])
Requesting inputs/outputs on broad searches wastes tokens when you get many matches. Narrow down first, then get details for the 1-3 nodes you actually need.
Connections
When connecting nodes:
- Use
get_node_infoto check available input/output slots - Slot indices are 0-based
- Verify connections match types (e.g., MODEL to MODEL, CLIP to CLIP)
Previewing Results
When the user wants to "see", "check", "test", or "debug" something:
- Add preview nodes: Connect unconnected outputs to appropriate preview nodes:
- Image outputs → Preview Image
- Text/debug data → Search for available text preview nodes (see below)
- 3D data → Preview 3D (if available)
- Auto-run when safe: If the workflow only involves lightweight operations, run it automatically so the user can see results immediately:
- Safe to auto-run: Debug nodes, camera calculations, text previews, metadata extraction, math operations
- Ask first or inform user: KSampler, image generation, model loading, anything GPU-intensive
- Example: If user asks "let me see what the camera info looks like", don't just add nodes - add a preview node, connect it, and run the workflow so they can actually see the output.
Finding Preview/Display Nodes
Text preview nodes vary by ComfyUI installation. To find available ones:
- Search efficiently - use minimal fields first:
get_node_types(search=["preview", "show", "display"]) - Common text preview nodes (availability varies):
PreviewAny- Shows any data type as text (Comfy Core, newer versions)ShowText|pysssss- From pythongosssss custom nodes- Look for nodes with "preview", "show", "display", or "print" in the name
- If unsure, search first then pick from results. Don't assume a node exists - verify with
get_node_types. - Request more details when needed - use
fieldsparameter:get_node_types(search="preview", fields=["input_types", "output_types"])
Package Management
Prefer uv for package and environment management. Check if uv is available first:
which uvIf uv is available, use it:
uv pip install <package>uv venvuv sync
If uv is NOT available, ask the user before proceeding:
"I'd prefer to use
uvfor package management as it's faster and more reliable. Can I install it? (curl -LsSf https://astral.sh/uv/install.sh | sh). If you'd rather use pip or another tool, let me know."
Only fall back to pip/other tools if the user explicitly prefers them.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

