ComfyUI Extension: ComfyUI-UML
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.
Render Mermaid, PlantUML, Graphviz, D2 and 28 Kroki diagram types as PNG/SVG/PDF in ComfyUI. Uses the Kroki API (no local setup) or optional local Mermaid/Graphviz. Includes a built-in zoomable viewer (Save to ComfyUI, shareable URLs), optional cairosvg for in-node SVG/PNG preview, and LLM Prompt Engine + LLM Call nodes to generate diagram code from templates.
Looking for a different extension?
Custom Nodes (5)
README
ComfyUI-UML
<p align="center"> <img src="icon.png" alt="ComfyUI-UML" width="128" height="128"> </p>ComfyUI custom nodes for rendering diagrams (Mermaid, PlantUML, Graphviz, etc.) via Kroki or local renderers.
<img width="2164" height="987" alt="image" src="https://github.com/user-attachments/assets/c9fc5efa-ebd5-47ea-b5ab-86ac03dd92b5" />Table of contents
- Features
- Installation
- Updating
- Usage
- Testing
- Security
- Contributing
- Development
- Workflows
- Troubleshooting
- License
- Author
- Publishing
Documentation: docs/ — usage, Kroki formats, workflows, testing, publishing, node reference.
Features
- Kroki (web): Many diagram types via the Kroki API. No local setup.
- 28 Kroki diagram types and output formats (png, svg, jpeg, pdf, txt, base64) per type; validated against Kroki's support matrix.
- Diagram options: Optional JSON for quality/theme (e.g. GraphViz scale, Mermaid/PlantUML/D2 theme). See Kroki diagram options.
- Shareable Kroki URL and built-in viewer (zoom, Save to ComfyUI, copy link).
- ComfyUI_Viewer: For iframe embedding of a Kroki URL, use the viewer in embed mode:
viewer.html?embed=1&url=...or the Diagram Viewer URL node’s viewer_url_iframe output (connect kroki_url from UML Render to Diagram Viewer URL). The Diagram Viewer URL node also shows a live diagram preview inside the node when kroki_url is set. - Local Mermaid: Backend
local+ beautiful-mermaid inweb/js(runnpm cithere once) for offline SVG/PNG; optional theme on the node or in diagram_options. - Local Graphviz: Optional when the
graphvizPython package is installed.
See docs/Usage.md and docs/KrokiFormats.md for details.
Installation
From Comfy Registry (recommended):
comfy node install comfyui-uml
Manual:
- Clone or copy this folder into
ComfyUI/custom_nodes/. - Install dependencies:
pip install -r requirements.txtoruv sync. - Optional — Local Mermaid (
backend= local): install Node.js (LTS), then from this folder runcd web/js && npm ci(ornpm install) sobeautiful-mermaidis 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 frompyproject.toml).
Updating
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.
Usage
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.
Testing
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).
Development
To run linting and formatting on commit (JSON and Python):
- Install dev dependencies:
pip install -e ".[dev]"oruv 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.
Workflows
- uml_single_diagram_only.json — UMLDiagram → PreviewImage (CI-friendly; see docs/Testing.md).
- uml_single_node.json — Single UMLDiagram + Diagram Viewer URL (kroki_url). Use this if you see "missing nodes" or queue errors with a pasted workflow.
- uml_mermaid.json — Mermaid example: one UMLDiagram + Diagram Viewer URL (kroki_url).
- uml_plantuml.json — PlantUML example: one UMLDiagram + Diagram Viewer URL (kroki_url).
- uml_llm_ollama.json — LLM (Ollama) → Kroki: LLMPromptEngine → LLMCall → UMLDiagram → UMLViewerURL (example; not in comfy-test
cpuby default).
To regenerate the workflow files and check that format lists stay in sync, run python scripts/generate_all_diagrams_workflow.py (no arguments).
Full list, loading tips, and format: docs/Workflows.md. Workflow format and normalizer: docs/WorkflowFormat.md.
License
MIT. See repository license.
Security
Report vulnerabilities per SECURITY.md (private advisories preferred).
Contributing
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.
Author
antoinebou12 — GitHub · Comfy Registry publisher
Publishing to the Comfy Registry
Publishing runs when pyproject.toml changes on main/master. See docs/Publishing.md for token setup and troubleshooting.
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.