visualize_workflow
Convert ComfyUI workflow JSON into Mermaid diagrams or compact DSL text, and convert back into executable JSON. Use it to inspect, document, and rebuild pipelines from API-format graphs.
Instructions
DRAW a diagram of, or convert, workflow JSON you PASS IN (a JSON string or object) — it does NOT read the user's live canvas, so for 'show me what's on the canvas' / the CURRENTLY-OPEN graph use panel_graph_outline instead. Driven by the action parameter:
action:"render" — Mermaid flowchart of the whole graph: nodes grouped by category, connections labeled by data type.
action:"render_hierarchical" — the same graph SECTIONED rather than flat, which is what you want past ~20 nodes.
viewpicks a compact overview, one section in detail, a text listing, or an AI-oriented structured summary.action:"mermaid" — the INVERSE of render: a Mermaid flowchart back into executable API-format workflow JSON, wired from /object_info schemas.
action:"to_dsl" — API-format JSON into the compact, human/LLM-readable authoring DSL:
key <- nodeId.outputIndexfor connections,key = <JSON>for literals. Round-trips losslessly. (Experimental.)action:"from_dsl" — that DSL back into executable JSON, plus advisory wiring warnings when ComfyUI is reachable (the conversion succeeds either way). (Experimental.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dsl | No | action:"from_dsl" (REQUIRED) — Workflow DSL text | |
| view | No | action:"render_hierarchical" — overview: compact diagram with sections as summary nodes; detail: full diagram for one section; list: text summary of all sections; summary: structured text optimized for AI ingestion with node IDs, key settings, virtual wires, and full connection graph | overview |
| action | Yes | Which rendering/conversion to perform. "render", "render_hierarchical" and "to_dsl" require `workflow`; "mermaid" requires `mermaid`; "from_dsl" requires `dsl`. | |
| mermaid | No | action:"mermaid" (REQUIRED) — Mermaid flowchart text (with or without ```mermaid code fence). Nodes should use ComfyUI class_type names as labels. Connections should be labeled with data types (e.g., -->|MODEL|). | |
| section | No | action:"render_hierarchical" — Section name to show in detail view (required when view=detail). Use view=list to see available section names. | |
| workflow | No | ComfyUI workflow JSON (as a JSON string or object; API or UI format is auto-detected). REQUIRED for action:"render", action:"render_hierarchical" and action:"to_dsl" — "to_dsl" expects API format (node ID -> {class_type, inputs}). | |
| direction | No | action:"render" / action:"render_hierarchical" — Flowchart direction: LR (left-to-right) or TB (top-to-bottom). Default LR for "render" and for the hierarchical detail view, TB for the hierarchical overview. | |
| show_values | No | action:"render" / action:"render_hierarchical" — Include widget values (seed, steps, cfg, etc.) in node labels (detail view only, for the hierarchical action). |