comfyui_analyze_workflow
Analyze a ComfyUI workflow to get structured data: node count, class types, flow, models, parameters, pipeline type, and prompt/negative nodes. Returns a JSON dict for direct access.
Instructions
Analyze a ComfyUI workflow and return its structured shape.
Unlike ``comfyui_summarize_workflow`` (which formats a human-readable
text or Mermaid summary), this tool returns the raw analysis as a dict
so callers can read individual fields directly without parsing prose.
Args:
workflow (required): JSON string of the workflow to analyze. The
workflow JSON is a dict keyed by node ID; each value has
``class_type`` and ``inputs``.
Returns:
Dict with keys:
- ``node_count`` (int): number of nodes in the workflow.
- ``class_types`` (list[str]): every ``class_type`` in topological
order.
- ``flow`` (list[dict]): per-node info — ``node_id``, ``class_type``,
``display_name``, ``inputs`` — in topological order.
- ``models`` (list[dict]): single-field loader values, e.g.
``[{"name": "v1-5-pruned.safetensors", "type": "checkpoints"}]``.
- ``parameters`` (dict): flat key/value of common sampler/latent
parameters extracted from the graph (``steps``, ``cfg``, ``width``,
``height``, etc.).
- ``pipeline`` (str): coarse type — one of ``txt2img``,
``img2img``, ``upscale``, ``img2img -> upscale``,
``txt2img -> upscale``, or ``unknown``.
- ``prompt_nodes`` (list[str]): ids of ``CLIPTextEncode`` nodes
that are NOT wired into any sampler's ``negative`` input
(the analyzer treats every non-negative CLIPTextEncode as
a positive prompt — it does not separately verify that it
is wired into a sampler's positive input).
- ``negative_nodes`` (list[str]): ids of ``CLIPTextEncode`` nodes
wired into a sampler's ``negative`` input.
Display-name enrichment is best-effort via ComfyUI's ``/object_info``
endpoint; if the server is unreachable, ``display_name`` falls back to
the bare ``class_type``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflow | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||