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.
Repository languagesPython 50.91%3
Shares calculated from GitHub Linguist bytes.
| Language | % | Bytes |
|---|---|---|
| Python | 130,995 | |
| JavaScript | 117,710 | |
| HTML | 8,584 |
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.
comfy node install comfyui-umlTasks 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:
- Clone or copy this folder into ComfyUI/custom_nodes/.
- Install dependencies: pip install -r requirements.txt or uv sync.
- 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).
Getting started
CONTRIBUTORS.md
- Clone the repository and open it in your editor.
- Install dev dependencies (pick one):
- uv sync –extra dev (recommended if you use uv)
- pip install -e “.[dev]”
- Run tests: uv run pytest or pytest (from the repo root).
- 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.
Configuration and usage
Usage
README.md
Operations and troubleshooting
Updating
README.md
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.
Development and contributions
Testing
README.md
Development
README.md
To run linting and formatting on commit (JSON and Python):
- Install dev dependencies: pip install -e “.[dev]” or uv sync –extra dev.
- 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.
Contributing
README.md
Contributing to ComfyUI-UML
CONTRIBUTORS.md
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.
- Diagram text
- Registered ComfyUI node
- Local renderer
- Kroki service
- 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.

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 toneRoseComfyUI 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
KrokiError(class) ·nodes/kroki_client.py:91Declared bases:
Exception.UMLDiagram(class) ·nodes/uml_diagram.py:275Methods in the overview:
INPUT_TYPES, VALIDATE_INPUTS, run.UMLLLMCodeGenerator(class) ·nodes/uml_llm.py:27Methods in the overview:
INPUT_TYPES, VALIDATE_INPUTS, run.LLMCall(class) ·nodes/uml_llm_call.py:22Methods in the overview:
INPUT_TYPES, VALIDATE_INPUTS, run.LLMPromptEngine(class) ·nodes/uml_llm_prompt_engine.py:14Methods in the overview:
INPUT_TYPES, VALIDATE_INPUTS, run.UMLViewerURL(class) ·nodes/uml_viewer_url.py:63Methods in the overview:
INPUT_TYPES, run.Args(class) ·scripts/generate_all_diagrams_workflow.py:1475Args(class) ·scripts/generate_all_diagrams_workflow.py:1498Obj(class) ·tests/test_uml_routes.py:131Obj(class) ·tests/test_uml_routes.py:138Obj(class) ·tests/test_uml_routes.py:145Methods in the overview:
__str__.
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
- GitHubSource repository
- READMERepository documentation
- ComfyUI-UML: diagrams as nodes, images and shareable sourceBlog article