ComfyUI Extension: ComfyUI-UML

Authored by antoinebou12

Created

Updated

3 stars

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

License: MIT Comfy Registry Pytest Workflow Tests Publish to Comfy registry

GitHub stars GitHub forks GitHub watchers

<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

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 in web/js (run npm ci there once) for offline SVG/PNG; optional theme on the node or in diagram_options.
  • Local Graphviz: Optional when the graphviz Python package is installed.

See docs/Usage.md and docs/KrokiFormats.md for details.

Installation

From Comfy Registry (recommended):

comfy node install comfyui-uml

Manual:

  1. Clone or copy this folder into ComfyUI/custom_nodes/.
  2. Install dependencies: pip install -r requirements.txt or uv sync.
  3. OptionalLocal 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).

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):

  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.

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 cpu by 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

antoinebou12GitHub · 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.

Learn more