Agent skill

Workflow Layout

by artokun in artokun/comfyui-mcp

Lay out and organize a ComfyUI workflow cleanly on the live panel canvas.

MITAuto-check passedAI & LLM Engineering

Install Workflow Layout

skills CLI
$ npx skills add artokun/comfyui-mcp --skill workflow-layout -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install artokun/comfyui-mcp workflow-layout --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/artokun/comfyui-mcp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugin/skills/workflow-layout .claude/skills/workflow-layout && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
workflow-layout
GitHub stars
795
Token cost
~2.2k tokens
SKILL.md length
1,159 words
Files
1
Skills in repo
42
Repo updated
First seen
Licence
MIT

At a glance

Lay out and organize a ComfyUI workflow cleanly on the live panel canvas.

  • Works in 5 steps: Read the graph. Build a DAG from each… → Layer every node by longest path from a… → X by layer: x = X0 + layer * COL_PITCH,… → …
  • Asked to tidy / clean up / organize / arrange a workflow
  • SKILL.md covers Primitives (panel tools), The layout algorithm…, Subgraph interiors — move the… and Groups vs subgraphs — choose…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Workflow Layout is an agent skill from artokun/comfyui-mcp. Lay out and organize a ComfyUI workflow cleanly on the live panel canvas. Dependency-layered node placement with no overlaps, subgraphs, colored group boxes, and subgraph rail alignment. Use when asked to tidy / clean up / organize / arrange a workflow, add groups or subgraphs, fix overlapping nodes, or build a workflow that should look good from the start.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Diffusion and image models. It works with ComfyUI. The repository describes itself as: Local-first, agent-native control plane for ComfyUI — MCP server + sidebar agent that generates images, video & audio, authors and runs workflows, and edits your live graph in… The licence is MIT.

When your agent uses it

  • Asked to tidy / clean up / organize / arrange a workflow
  • Fix overlapping nodes
  • Build a workflow that should look good from the start

Example prompts

  • “/workflow-layout”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Read the graph. Build a DAG from each input's connected_from (ignore unconnected
  2. Layer every node by longest path from a source
  3. X by layer: x = X0 + layer * COL_PITCH, where `COL_PITCH ≈ widest node.size[0] in
  4. Y by FULL height (this is what stops overlaps): stack a column top→down with
  5. Order within a column to cut wire crossings: place each node near the average Y of its

What it can do on your machine

Read from SKILL.md and the folder at commit 6ad6fc0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Workflow Layout loads about 2.2k tokens when it runs. Until then it costs about 94 tokens; SKILL.md has 1,159 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from artokun/comfyui-mcp at commit 6ad6fc0, republished under its MIT licence (© artokun). 1,159 words, ~2,248 tokens.

Download SKILL.mdSave it as .claude/skills/workflow-layout/SKILL.md (or your agent's skills folder).
name
workflow-layout
description
Lay out and organize a ComfyUI workflow cleanly on the live panel canvas. Dependency-layered node placement with no overlaps, subgraphs, colored group boxes, and subgraph rail alignment. Use when asked to tidy / clean up / organize / arrange a workflow, add groups or subgraphs, fix overlapping nodes, or build a workflow that should look good from the start.

ComfyUI Workflow Layout & Organization

Turn a tangled graph into a clean left-to-right dataflow a human reads at a glance, using the panel_* canvas tools. The golden rule: never lay out blind. Read the real node sizes and rail positions first, then compute positions from them.

Primitives (panel tools)

  • panel_query_graph {fields:'detail', limit:200, max_chars:60000}. READ FIRST, every time. Returns, for the graph you're viewing:
    • each node's pos [x,y], size [w,h] (body only), and full_height (the TRUE rendered footprint = title bar + body; use this for vertical stacking),
    • all groups (id, title, color, bounding [x,y,w,h]),
    • and, only when inside a subgraph, the rails: the input / output boundary node positions. Everything below is computed from these numbers.
  • panel_edit_node({node_id, pos?, size?, title?, collapsed?, preset?|color?|bgcolor?}) atomically moves, resizes, retitles, collapses, or color-codes a node. Widget values remain on their dedicated tool; execution mode is available as mode when needed.
  • Groups (colored boxes; nodes stay put): panel_create_group (pass node_ids to auto-wrap, or bounds [x,y,w,h]; color hex), panel_move_group, panel_edit_group, panel_remove_group.
  • Subgraphs (nest nodes into one collapsible node): panel_create_subgraph(node_ids), panel_enter_subgraph / panel_exit_subgraph, panel_get_subgraph, panel_promote_widget, panel_move_rail(rail, [x,y]) (rail = "input"|"output", must be inside the subgraph), panel_expose_subgraph_output(from_node_id, from_output) / panel_expose_subgraph_input(to_node_id, to_input) (expose an interior slot on the boundary rail; must be inside the subgraph), and panel_unpack_subgraph(node_id) (expand/dissolve a subgraph back into the parent, the inverse of panel_create_subgraph).
  • panel_canvas({action:"fit"}) to frame the result; panel_save_workflow to persist.

The layout algorithm (dependency-layered, overlap-free)

  1. Read the graph. Build a DAG from each input's connected_from (ignore unconnected widget inputs; only node→node edges matter).
  2. Layer every node by longest path from a source: layer(n) = 0 if it has no incoming node edges, else 1 + max(layer(of its sources)). Layers become columns, left → right.
  3. X by layer: x = X0 + layer * COL_PITCH, where COL_PITCH ≈ widest node.size[0] in that column + ~80.
  4. Y by FULL height (this is what stops overlaps): stack a column top→down with y[i+1] = y[i] + node[i].full_height + ROW_GAP. Use full_height (from panel_query_graph detail rows), NOT size[1]. size[1] is the BODY only (slots + widgets); the title bar renders ~30px ABOVE pos and is NOT in size[1], so stacking by size[1] overlaps every node by a header (the classic "headers eating the node above" bug). full_height already includes that header (and is only the title height for a collapsed node), so y += full_height + ROW_GAP lands an exact ROW_GAP gap between the previous node's bottom and the next node's title. Never use a fixed row pitch. Tall nodes (KSampler, WanVideo Sampler, LoRA-select) are 480 to 600px and WILL overlap a 320 pitch. (If full_height is ever absent, fall back to size[1] + ~30 for the header.)
  5. Order within a column to cut wire crossings: place each node near the average Y of its connected nodes (a median/barycenter pass is plenty).

Reads-well constants: COL_PITCH 360 to 480, ROW_GAP 40. Because full_height already accounts for the title bar, you don't add extra top headroom per node. ROW_GAP is the clean gap you'll actually see.

Subgraph interiors — move the rails!

A subgraph has two boundary rails (input left, output right). They do not follow the inner nodes. Move the nodes without moving the rails and you get a huge gap (a common mistake). For each subgraph: panel_enter_subgraph → lay out the inner nodes (algorithm above) → then pin the rails to the node band:

  • input rail → panel_move_rail("input", [minNodeX - 180, bandTopY])
  • output rail → panel_move_rail("output", [maxNodeX + 60, bandTopY])

Keep rails at the same Y as the first row. Read current rail positions from panel_query_graph (rails) before deciding. panel_exit_subgraph when done.

Wiring interior nodes to the boundary (don't connect to a guessed rail id). To expose an interior node's output/input on the boundary so the PARENT graph can wire it, do NOT panel_connect to a rail node id you guessed. Use panel_expose_subgraph_output(from_node_id, from_output) (interior output → output rail) and panel_expose_subgraph_input(to_node_id, to_input) (interior input → input rail), both while inside the subgraph. panel_query_graph's rails shows which boundary slots already exist and which still need exposing. To expand or dissolve a subgraph back into the parent (inline its inner nodes and rewire external links, removing the wrapper, the inverse of panel_create_subgraph), use panel_unpack_subgraph(node_id). All undoable with Ctrl+Z.

Show full SKILL.md (487 more words)Show less

Groups vs subgraphs — choose deliberately

  • Group (colored box): lightweight visual band; nodes stay in place and editable. Reach for this first, to label regions of a flat graph or band stage-columns at the root.
  • Subgraph: collapses a stage into one node. Useful for large graphs, but it nests and hides nodes and adds boundary ports. Don't subgraph everything. A 2 or 3 node stage rarely earns it, and over-subgraphing hurts readability and complicates packaging and handoff.
  • Clean recipe: lay the flat graph out well → wrap only the complex stages in subgraphs → drop colored group bands around the columns at the root.

Stage decomposition that fits most pipelines

Loaders → Inputs → Preprocess (pose/controlnet/conditioning) → Embeds → Sample → Decode/Output, one concern per column/stage, strictly left-to-right.

Always leave inputs & outputs exposed

The nodes a user touches first, the input (Load Image / Load Video) and the output (save / video-combine / preview), must stay expanded and visible so they can jump straight in: drop in their media, hit run, watch the result. Collapse the internal machinery (loaders, encoders, samplers) into chips to cut noise, but never collapse the inputs or outputs. When they live inside subgraphs, keep those subgraph nodes expanded, and consider panel_promote_widget to lift the one key widget (prompt, seed) onto the subgraph node so it's editable without drilling in.

Heads-up: input/output preview nodes (LoadImage, VHS_LoadVideo, video-combine) report their full size[1] but render short until media loads. Size their group band to the .size (so it fits once filled), not to the empty-preview render.

End-to-end workflow

  1. panel_query_graph {fields:'detail', limit:200, max_chars:60000} to capture pos/size/groups (and rails inside each subgraph).
  2. Compute layers and overlap-free positions from the real sizes.
  3. panel_edit_node for each node (or bulk only when the same presentation change is intended).
  4. Per subgraph: enter → lay out inner nodes → panel_move_rail both rails → exit.
  5. Optional: panel_create_group bands around the root columns (and panel_remove_group any stranded empty groups left behind by earlier edits).
  6. panel_save_workflow, then panel_canvas({action:"fit"}).

Gotchas

  • Save before relying on it. Node positions, titles, and groups persist only once saved; a browser refresh reloads from the saved workflow (and re-binds nodes after installing packs).
  • Converting nodes to a subgraph preserves inner node ids; the subgraph node gets a new id.
  • Moving nodes inside a subgraph leaves the rails behind. Always re-pin them (see above).
  • Canvas edits never affect an in-flight render; but a ComfyUI restart clears the queue.
  • Image/video nodes under-report height. LoadImage, VHS_LoadVideo, preview nodes return a tiny size[1] because the image/video preview height isn't in .size. Leave extra vertical room (≈250 to 300px) below them so the preview doesn't overlap the next node.
  • Color-code by stage (e.g. all loaders blue, sampler green) and collapsed rarely-touched loaders to cut visual noise. Cheap wins once the positions are right.
  • Don't over-tidy a graph that's mid-build for the user. Confirm if a big reorg is wanted.

Sources

  • Official: comfyui-mcp panel layout tools (this repo).
  • Empirical: spacing/grouping recipes from observed unreadable canvases.

© artokun, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugin/skills/workflow-layout of artokun/comfyui-mcp.

Open the folder on GitHubat commit 6ad6fc0

Compare with similar skills

Workflow Layout next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Workflow Layout compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Workflow Layout this skillartokun/comfyui-mcp795—~2.2kAutomated safety check: PassMIT
Comfyui AnimatoolShiroEirin/comfyui-good-anima478—~4.6kAutomated safety check: PassGPL-3.0
Comfyui Agent Skill MieMieMieeeee/comfyui-agent-skill116—~3.9kAutomated safety check: PassApache-2.0
Importing SubgraphsComfy-Org/workflow_templates1.3k—~1.5kAutomated safety check: PassMIT
Comfyui Node Addernixified-ai/flake841—~806Automated safety check: PassAGPL-3.0
Managing BundlesComfy-Org/workflow_templates1.3k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Comfyui Animatool

    ShiroEirin/comfyui-good-anima

    Route ALL Anima image generation: validate Danbooru hard anchors, form visual brief, assemble English prompts and args, then load comfyui-manager for workflow execution.

    478 GitHub stars~4.6k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Comfyui Agent Skill Mie

    MieMieeeee/comfyui-agent-skill

    Agent skill for running registered ComfyUI workflows through a stable CLI, and for importing a user's own ComfyUI workflow into their private registry after review.

    116 GitHub stars~3.9k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Importing Subgraphs

    Comfy-Org/workflow_templates

    Imports and registers subgraph blueprints into the ComfyUI workflowtemplates repository.

    1.3k GitHub stars~1.5k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Comfyui Node Adder

    nixified-ai/flake

    Adds new custom nodes to the ComfyUI Nix project, including npins fetching, dependency resolution in package.nix, disabling impure pip installs, and verifying the Nix build.

    841 GitHub stars~806 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Managing Bundles

    Comfy-Org/workflow_templates

    Manages template bundles, categories, and ordering in the ComfyUI template repository.

    1.3k GitHub stars~1.2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Headroom

    momori777/Artemis

    SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens.

    377 GitHub stars~562 tokensUpdated 8 days ago
    AI & LLM EngineeringAuto-check passed

More from artokun/comfyui-mcp

All 42 skills in this repo
  • AI Toolkit Trainer

    artokun/comfyui-mcp

    Train custom LoRAs with ostris AI-Toolkit. An agent skill from artokun/comfyui-mcp.

    795 GitHub stars~2.7k tokensUpdated 3 days ago
    Auto-check passed
  • Anima Base

    artokun/comfyui-mcp

    Anime/illustration text-to-image (ANIMA 1.0, ~2B Cosmos DiT).

    795 GitHub stars~4k tokensUpdated 3 days ago
    Auto-check passed
  • Civitai

    artokun/comfyui-mcp

    Discover Civitai models with the BUILT-IN downloadmodel action:"searchcivitai" and install/generate them locally.

    795 GitHub stars~1.1k tokensUpdated 3 days ago
    Auto-check passed
  • Color Correction

    artokun/comfyui-mcp

    Diagnose and fix video/image color OBJECTIVELY with the getimage (action:"analyzecolor") tool (scopes/stats such as black/white points, contrast, saturation, clipping, cast) instead of eyeballing a…

    795 GitHub stars~2.4k tokensUpdated 3 days ago
    Auto-check passed
  • Comfyui Frontend Extensions

    artokun/comfyui-mcp

    Authoring ComfyUI v2 frontend extensions with @comfyorg/extension-api, covering defineNode/defineExtension/defineWidget, shell UI (sidebar tabs, commands, hotkeys), typed events, and handles.

    795 GitHub stars~5.4k tokensUpdated 3 days ago
    Auto-check passed
  • Comfyui Launch Flags

    artokun/comfyui-mcp

    Pick the right ComfyUI startup flags for VRAM, attention, caching, and speed.

    795 GitHub stars~3.1k tokensUpdated 3 days ago
    Auto-check passed

Works with

Questions about Workflow Layout

What does Workflow Layout do?

Lay out and organize a ComfyUI workflow cleanly on the live panel canvas. Workflow Layout is an agent skill from artokun/comfyui-mcp. Lay out and organize a ComfyUI workflow cleanly on the live panel canvas.

When should I use Workflow Layout?

Workflow Layout fits situations like: asked to tidy / clean up / organize / arrange a workflow; fix overlapping nodes; build a workflow that should look good from the start.

How do I install Workflow Layout in Claude Code?

Run `npx skills add artokun/comfyui-mcp --skill workflow-layout -a claude-code`. Or copy the skill folder (plugin/skills/workflow-layout in artokun/comfyui-mcp) into .claude/skills/workflow-layout in your project. Claude Code loads it when a task matches its description.

How do I install Workflow Layout in Codex?

Run `npx skills add artokun/comfyui-mcp --skill workflow-layout -a codex`. Or copy the skill folder (plugin/skills/workflow-layout in artokun/comfyui-mcp) into .agents/skills/workflow-layout in your project. Codex loads it when a task matches its description.

Can I use Workflow Layout in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add artokun/comfyui-mcp --skill workflow-layout -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/workflow-layout, .gemini/skills/workflow-layout, .github/skills/workflow-layout and .opencode/skills/workflow-layout in your project.

What does Workflow Layout need to run?

SKILL.md names no scripts, command-line tools or credentials: Workflow Layout is instructions for the agent only.

Does Workflow Layout access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Workflow Layout safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Workflow Layout use?

Workflow Layout is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Workflow Layout use?

About 2.2k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Workflow Layout?

Skills that share tags, products or a category with Workflow Layout: Comfyui Animatool (ShiroEirin/comfyui-good-anima, 478 stars), Comfyui Agent Skill Mie (MieMieeeee/comfyui-agent-skill, 116 stars), Importing Subgraphs (Comfy-Org/workflow_templates, 1.3k stars) and Comfyui Node Adder (nixified-ai/flake, 841 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Workflow Layout?

artokun (a GitHub user) maintains it in artokun/comfyui-mcp, which has 795 GitHub stars. The repository holds 42 skills in this directory. The repository was last updated on October 5, 2026.

Source: artokun/comfyui-mcp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.