agentleFS
ConstantineB6ConstantineB6/comfy-pilot/CLAUDE.md

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.

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
  1. Distinctive:

    When creating or modifying ComfyUI workflows, follow these best practices:

    line 5
  2. Distinctive:

    Always assign descriptive custom titles to nodes: when creating them. This makes workflows much easier to understand when reading them back …

    line 9
  3. Distinctive:

    Instead of generic type names like:

    line 11
  4. Distinctive:

    Keep related nodes vertically aligned

    line 30
  5. Distinctive:

    Minimum padding: Always leave at least 20px of padding between nodes (2 grid units, default grid = 10px)

    line 31
  6. Very specific:

    Node sizing: When placing a node directly below another node, match the width of the node above it for visual consistency.

    line 33
  7. Very specific:

    When creating nodes that are not connected to existing workflow (new starting points, separate node groups, or standalone utilities), use …

    line 40
  8. Very specific:

    Running: Use run(action="queue") to execute, run(action="interrupt") to stop.

    line 91
  9. Very specific:

    Status: Use get_status(include=["queue", "system", "history"]) for all status info.

    line 93
  10. Very specific:

    Always search minimal first: - don't request inputs/outputs on broad searches:

    line 97
  11. Very specific:

    Use get_node_info to check available input/output slots

    line 116
  12. Distinctive:

    Verify connections match types (e.g., MODEL to MODEL, CLIP to CLIP)

    line 118
  13. Distinctive:

    When the user wants to "see", "check", "test", or "debug" something:

    line 122
  14. Distinctive:

    Auto-run when safe: If the workflow only involves lightweight operations, run it automatically so the user can see results immediately:

    line 129
  15. Distinctive:

    Ask first or inform user: KSampler, image generation, model loading, anything GPU-intensive

    line 131
  16. Distinctive:

    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 …

    line 133
  17. Distinctive:

    Search efficiently: - use minimal fields first:

    line 139
  18. Distinctive:

    Look for nodes with "preview", "show", "display", or "print" in the name

    line 147
  19. Very specific:

    Request more details when needed: - use fields parameter:

    line 151
  20. Very specific:

    Prefer uv for package and environment management.

    line 157
  21. Very specific:

    If uv is available, use it:

    line 163
  22. Very specific:

    If uv is NOT available, ask the user before proceeding:

    line 168
  23. Distinctive:

    Only fall back to pip/other tools if the user explicitly prefers them.

    line 171

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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:

  1. First search without extra fields:
    get_node_types(search=["camera", "sampler", "preview"])
  2. Review results - identify promising nodes from display_name and category
  3. 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_info to 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:

  1. 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)
  2. 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
  3. 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:

  1. Search efficiently - use minimal fields first:
    get_node_types(search=["preview", "show", "display"])
  2. 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
  3. If unsure, search first then pick from results. Don't assume a node exists - verify with get_node_types.
  4. Request more details when needed - use fields parameter:
    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 uv

If uv is available, use it:

  • uv pip install <package>
  • uv venv
  • uv sync

If uv is NOT available, ask the user before proceeding:

"I'd prefer to use uv for 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.