Skip to content
Automation
Command

/viz

Visualize a ComfyUI workflow as a mermaid diagram

From plugin
comfyui-mcp
52211 skills4 agents11 commands
Install
$ npx -y skills add artokun/comfyui-mcp --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/viz

Context preview

What this command does when you run it.

Visualize a ComfyUI workflow as a mermaid diagram

Command definition

viz.md
description: Visualize a ComfyUI workflow as a mermaid diagram
argument-hint: Path to workflow JSON file, or paste JSON inline

/comfy-viz — Visualize a Workflow

The user wants to visualize a ComfyUI workflow as a mermaid flowchart diagram.

Instructions

1. **Get the workflow JSON.** The argument may be: $ARGUMENTS

  • A file path to a workflow JSON file — read it with the Read tool
  • Inline JSON pasted directly as the argument
  • Nothing — ask the user to provide a workflow file path or paste the JSON

2. **Validate the input.** The workflow must be in ComfyUI's API format: an object where keys are node IDs and values have `class_type` and `inputs`. If it looks like the web UI format (has `nodes` and `links` arrays), tell the user it needs to be in API format and suggest they export it via "Save (API Format)" in ComfyUI.

3. **Visualize.** Use the `visualize_workflow` tool with:

  • `workflow`: the parsed workflow JSON
  • `show_values`: `true` (to include parameter values in node labels)
  • `direction`: `"LR"` (left-to-right, easiest to read)

4. **Present the diagram.** Show the mermaid output to the user. The mermaid code block will render as a flowchart showing nodes grouped by category with labeled connections.

Example

User: `/comfy-viz ~/workflows/my-workflow.json`

Steps:

  • Read the file at `~/workflows/my-workflow.json`
  • Pass contents to `visualize_workflow`
  • Display the mermaid diagram

Notes

  • If the workflow is very large (50+ nodes), suggest using `direction: "TB"` (top-to-bottom) for better readability
  • The diagram groups nodes into subgraphs by category: loading, conditioning, sampling, image, output
  • Connection edges are labeled with data types (MODEL, CLIP, CONDITIONING, LATENT, IMAGE, VAE, etc.)
Read more
Ships withcomfyui-mcp

The local-first, agent-native control plane for ComfyUI — an MCP server + live sidebar agent that generates images, video and audio, authors and runs workflows, manages models and custom nodes, and edits your live ComfyUI graph in natural language.

Get the whole plugin, auto-invoked
Stats
522
Stars
0
Views
84
Forks
Active
Maintenance
TypeScript
Language
MIT
License
2h ago
Last commit
5mo ago
Created

Repo: artokun/comfyui-mcp