Skip to content

ComfyUI-UML: Diagram rendering inside a node graph

ComfyUI-UML adds diagram-oriented nodes to ComfyUI. Text enters a workflow, a rendering backend turns it into an image, and the workflow can retain the source and viewer links alongside that output.

Integration
  • Updated
  • 3
  • Python · 50.91%
Repository languagesPython 50.91%3

Shares calculated from GitHub Linguist bytes.

Language%Bytes
Python50.91%130,995
JavaScript45.75%117,710
HTML3.34%8,584

GitHub · README · Language statistics

Overview

Why it exists

Custom node implementation for ComfyUI node graphs integrating automated UML synthesis into image pipelines.

Best fit

Visual AI workflows combining diagram generation with image refinement.

Getting started

These commands come from the repository documentation. They were not run during this review.

README.md · Installation
comfy node install comfyui-uml
Tasks declared in manifests

Repository references

Excerpts from the repository’s guides, in their original language. Links open the inspected source revision.

Prerequisites and first run

Installation

README.md

From Comfy Registry (recommended): Manual:

  1. Clone or copy this folder into ComfyUI/custom_nodes/.
  2. Install dependencies: pip install -r requirements.txt or uv sync.
  3. Optional — Local Mermaid (backend = local): install Node.js (LTS), then from this folder run cd web/js && npm ci (or npm install) so beautiful-mermaid is available for web/js/render_mermaid.mjs. PNG preview for SVG in the node: pip install cairosvg. Dynamic widget visibility: pip install comfy-dynamic-widgets (or extras from pyproject.toml).
Read the full instructions ↗

Getting started

CONTRIBUTORS.md

  1. Clone the repository and open it in your editor.
  2. Install dev dependencies (pick one):
  • uv sync –extra dev (recommended if you use uv)
  • pip install -e “.[dev]”
  1. Run tests: uv run pytest or pytest (from the repo root).
  2. Lint/format: uv run ruff check . and uv run ruff format ., or install pre-commit and run pre-commit install. See docs/Testing.md for CI (pytest, comfy-test) and mock LLM behavior.
Read the full instructions ↗
Configuration and usage

Usage

README.md

Add the UML Render (Mermaid/PlantUML/etc) node (category: UML). Choose backend (web/local), diagram_type, enter code, and set output_format (png, svg, jpeg, pdf, txt, base64 — validated per type). Optional diagram_options JSON for Kroki. Full usage, outputs, viewer, and LLM workflow: docs/Usage.md. Diagram type × format table: docs/KrokiFormats.md.
Read the full instructions ↗
Operations and troubleshooting

Updating

README.md

After updating (Manager, git pull, or manual), restart ComfyUI so nodes and web assets load. Other nodes failing to update are independent; retry that node and restart.
Read the full instructions ↗

Dependency updates

CONTRIBUTORS.md

  • Dependabot opens PRs for Python (pyproject.toml / lockfile where applicable), npm under web/js, and GitHub Actions.
  • Renovate is enabled with a dependency dashboard and focuses on updates that do not overlap Dependabot (for example, grouped Action bumps). If two bots open the same update, close one and keep the preferred PR.
Read the full instructions ↗
Development and contributions

Testing

README.md

CI runs pytest, Ruff, and npm ci in web/js (.github/workflows/pytest.yml), plus comfy-test on push/PR to main / master. Locally: uv sync –extra dev, then uv run pytest, uv run ruff check ., and optionally cd web/js && npm ci. See docs/Testing.md for details, comfy-test.toml, and AGENTS.md for agent/contributor workflow (including headless pytest notes).
Read the full instructions ↗

Development

README.md

To run linting and formatting on commit (JSON and Python):

  1. Install dev dependencies: pip install -e “.[dev]” or uv sync –extra dev.
  2. Install pre-commit hooks: pre-commit install. Pre-commit will format JSON (key order preserved) and run Ruff (lint + format) on Python. To run on all files: pre-commit run –all-files.
Read the full instructions ↗

Contributing

README.md

See CONTRIBUTORS.md for dev setup, tests, and dependency automation (Dependabot / Renovate). For AI assistants and deeper change workflow (ordered checklist, Context7 for libraries), see AGENTS.md.
Read the full instructions ↗

Contributing to ComfyUI-UML

CONTRIBUTORS.md

Thanks for helping improve ComfyUI-UML.
Read the full instructions ↗
Source documentation

3 documents read from 3 candidates.

Features and components 2

Plugin registration
The root __init__.py loads the nodes package under the unique name comfyui_uml_nodes. This avoids colliding with ComfyUI’s own nodes module. It exports the class mappings and the web directory used by the extension.
Rendering and viewer
The nodes directory separates diagram generation, Kroki communication and viewer URLs. Browser assets are exposed through WEB_DIRECTORY, while route registration adds the viewer’s save-to-output integration. Local rendering options and Kroki are distinct backends.

Architecture

The components and their connections remain available as text. The diagram adds an interactive view.

System context Context
  1. Diagram text
  2. Registered ComfyUI node
  3. Local renderer
  4. Kroki service
  5. Image and viewer links

Links verified in the repository.

Mermaid Interactive diagram (loads on open)

System overview of the components and connections verified in the repository.

Static architecture view for ComfyUI-UML
Static preview. The interactive diagram replaces it after Mermaid loads.
flowchart LR

subgraph group_workflow["ComfyUI Workflow"]
  node_workflow_nodes["ComfyUI Nodes<br/>[__init__.py]"]
  node_render_node["UML Render<br/>[uml_diagram.py]"]
  node_viewer_url_node["Diagram Viewer URL<br/>[uml_viewer_url.py]"]
  node_diagram_result["Diagram Result"]
end

subgraph group_rendering["Diagram Rendering"]
  node_diagram_defaults["Diagram Defaults<br/>[default_code.py]"]
  node_render_client["Render Backends<br/>[kroki_client.py]"]
  node_local_mermaid["Local Mermaid<br/>[render_mermaid.mjs]"]
end

subgraph group_generation["LLM Generation"]
  node_prompt_engine["Prompt Engine"]
  node_llm_call["LLM Call<br/>[uml_llm_call.py]"]
  node_code_assistant["LLM Code Assistant<br/>[uml_llm.py]"]
  node_llm_shared["LLM Providers<br/>[uml_llm_shared.py]"]
  node_prompt_templates["Prompt Templates"]
end

subgraph group_viewer["Viewer Experience"]
  node_frontend_extension["ComfyUI Extension<br/>[ComfyUI-UML.js]"]
  node_viewer_shell["Viewer Shell<br/>[viewer_shell.mjs]"]
  node_url_utils["Viewer URL Utilities<br/>[viewerUrlUtils.mjs]"]
  node_view_registry["View Registry<br/>[view_manifest.js]"]
  node_format_views["Format Views"]
end

node_user(("ComfyUI User"))
node_kroki["Kroki API"]

node_user -->|"configures"| node_workflow_nodes
node_workflow_nodes -->|"runs"| node_render_node
node_prompt_engine -->|"supplies prompt"| node_llm_call
node_llm_call -->|"calls provider"| node_llm_shared
node_code_assistant -->|"calls provider"| node_llm_shared
node_prompt_engine -->|"loads templates"| node_llm_shared
node_prompt_engine -.->|"loads presets"| node_prompt_templates
node_code_assistant -.->|"loads presets"| node_prompt_templates
node_code_assistant -->|"provides diagram code"| node_render_node
node_render_node -->|"uses defaults"| node_diagram_defaults
node_render_node -->|"requests rendering"| node_render_client
node_render_client -->|"posts diagram"| node_kroki
node_render_client -->|"runs local renderer"| node_local_mermaid
node_render_node -.->|"returns output"| node_diagram_result
node_render_node -->|"provides Kroki URL"| node_viewer_url_node
node_viewer_url_node -->|"opens preview"| node_frontend_extension
node_render_node -->|"opens viewer"| node_frontend_extension
node_frontend_extension -->|"builds viewer query"| node_url_utils
node_frontend_extension -.->|"opens viewer"| node_viewer_shell
node_viewer_shell -->|"infers format"| node_url_utils
node_viewer_shell -->|"selects view"| node_view_registry
node_view_registry -->|"loads format view"| node_format_views
node_viewer_shell -.->|"fetches diagram"| node_diagram_result


class node_workflow_nodes,node_render_node,node_viewer_url_node,node_diagram_result,node_user toneBlue
class node_diagram_defaults,node_render_client,node_local_mermaid toneAmber
class node_prompt_engine,node_llm_call,node_code_assistant,node_llm_shared,node_prompt_templates,node_kroki toneMint
class node_frontend_extension,node_viewer_shell,node_url_utils,node_view_registry,node_format_views toneRose

ComfyUI nodes that create diagram source, render through Kroki or local backends, and expose images, files and viewer links. Optional language-model nodes can generate the source before the rendering path.

Components
19
Connections
23
Links supported by code or README
18/23
Text version of the diagram
  • Diagram text → Registered ComfyUI node
  • Registered ComfyUI node → Local renderer
  • Registered ComfyUI node → Kroki service
  • Local renderer → Image and viewer links
  • Kroki service → Image and viewer links
Follow one path through the code

Start at NODE_CLASS_MAPPINGS, then follow a diagram node into its renderer. The loader uses an explicit module specification because ComfyUI may import the plugin directly from a file path.

Types and file structure

11 declared types, with 11 in the base-relationship overview.

Type diagram
classDiagram
direction TB
class tb654476aede8["KrokiError"] {
}
class t50d2adfa6e30["UMLDiagram"] {
  INPUT_TYPES()
  VALIDATE_INPUTS()
  run()
}
class tf5d8a3add21d["UMLLLMCodeGenerator"] {
  INPUT_TYPES()
  VALIDATE_INPUTS()
  run()
}
class t54e8aa4c2ef3["LLMCall"] {
  INPUT_TYPES()
  VALIDATE_INPUTS()
  run()
}
class tad1d573d8063["LLMPromptEngine"] {
  INPUT_TYPES()
  VALIDATE_INPUTS()
  run()
}
class tf971647cbde8["UMLViewerURL"] {
  INPUT_TYPES()
  run()
}
class t12ed9326b7d8["Args"] {
}
class t00114166eb81["Args"] {
}
class tc2da0bee5d97["Obj"] {
}
class t0087e40115b2["Obj"] {
}
class ta16414e60e88["Obj"] {
  __str__()
}
class b60d1d89f176e["Exception"] {
  <<unresolved_base>>
}
b60d1d89f176e <|-- tb654476aede8

Unresolved bases remain labelled; full signatures are not reconstructed.

Type index

Reference

39 / 39 eligible files read (330 in the tree); 0 oversized, 0 failed reads and 0 syntax diagnostics.

What the scan covers

Known dependency/build folders, credential files and binaries are excluded. The scan covers READMEs, recognized manifests and parser-supported source files.

Linguist statistics cover the whole repository and may include other languages.

File map
flowchart TD
  root["ComfyUI-UML"]
  f0["__init__.py"]
  root --> f0
  f1["nodes/kroki_client.py"]
  root --> f1
  f2["nodes/uml_diagram.py"]
  root --> f2
  f3["README.md"]
  root --> f3
  f4["conftest.py"]
  root --> f4
  f5["install.py"]
  root --> f5
  f6["prestartup_script.py"]
  root --> f6
  f7["pyproject.toml"]
  root --> f7
  f8["requirements.txt"]
  root --> f8
  f9["nodes/__init__.py"]
  root --> f9
  f10["nodes/default_code.py"]
  root --> f10
  f11["nodes/uml_llm.py"]
  root --> f11
  f12["nodes/uml_llm_call.py"]
  root --> f12
  f13["nodes/uml_llm_prompt_engine.py"]
  root --> f13
  f14["nodes/uml_llm_shared.py"]
  root --> f14
  f15["nodes/uml_routes.py"]
  root --> f15

Files to read 3

References