UML Render
The flagship render node — diagram text in, an image out, 28 diagram types deep
- code_input
- IMAGE
- path
- kroki_url
- content_for_viewer
- viewer_url
UML Render (class name UMLDiagram) is the reason this pack exists. It takes diagram source code - Mermaid, PlantUML, Graphviz, D2, or any of 28 Kroki-supported dialects - and turns it into an actual image you can preview, save, and wire into the rest of your ComfyUI graph. If you've ever fought with a Mermaid renderer's browser quirks just to see a flowchart, this node is the answer to a question you didn't know you had: why not render diagrams inside ComfyUI like anything else?
The big idea is that it leans on Kroki, a free hosted service that renders dozens of diagram languages server-side. You paste in code, it does the rendering, you get bytes back. No local Chromium, no headless-browser dependency, no massive model download. The default backend is web, and the default kroki_url is https://kroki.io - it genuinely works with zero setup.
How it works
Mechanically it's simple: the node POSTs your code to {kroki_url}/{diagram_type}/{output_format}, gets the rendered bytes, and saves them to output/uml/ in your ComfyUI output folder. But there are two details worth knowing.
First, the LLM-fence cleanup. If code_input is connected (e.g. from an LLM node), it takes priority over the code widget, and the node aggressively strips markdown fences - ```mermaid ... ``` blocks get unwrapped, prose around the code gets dropped. Models love to wrap their output in fences, so this is the difference between "it rendered" and "Kroki choked on a backtick." This is exactly why the LLM nodes in this pack exist: they generate the code, and this node makes sure it survives contact with a language model.
Second, the outputs are unusually rich. It returns five things:
IMAGE- a proper ComfyUI image tensor for PNG/JPEG output (and SVG if you installcairosvg; otherwise a placeholder).path- where the file landed underoutput/uml/.kroki_url- a shareable GET URL (Kroki's deflate+base64 format, the same one the web UI uses). Paste it in a browser and anyone can see the diagram.content_for_viewer- the raw SVG string when you render SVG, for feeding a viewer node.viewer_url- a link into the pack's built-in zoomable viewer.
Right-click the node and "Open in viewer" is the fastest way to actually look at what you generated.
The inputs that matter
backend-web(Kroki, default) orlocal. Local only really pays off for Mermaid (needs Node.js +cd web/js && npm ci) or Graphviz (needs thegraphvizPython package); otherwise it falls back to web anyway.diagram_type- the big one. 28 choices, and yourcodehas to match:mermaidcode in theplantumlslot renders garbage.code- the diagram source itself. Multiline, defaulting to a sample sequence diagram so you always have something that runs.output_format- png, svg, jpeg, pdf, txt, base64. Not every format works for every diagram type; the node validates this and errors out clearly.diagram_options- optional JSON passed to Kroki, e.g.{"theme": "dark"}for Mermaid/D2/PlantUML or{"scale": 1.5}for Graphviz. Invalid JSON fails the run with a message that tells you it's a JSON problem.theme- a shortcut that merges intodiagram_options(also used by local Mermaid).
Installing
One of five nodes in the antoinebou12/ComfyUI-UML pack:
comfy node install comfyui-uml
# or manually:
cd ComfyUI/custom_nodes && git clone https://github.com/antoinebou12/ComfyUI-UML
pip install -r requirements.txt
Restart after install. Base dependencies are just httpx and kroki; cairosvg is worth adding for real SVG previews, and comfy-dynamic-widgets hides the widgets you're not using.
Troubleshooting
- "Kroki error: ..." - the service is unreachable or rejected the request. Check your internet, and remember Kroki is a free public service, not a guarantee. If you're offline or behind a proxy, that's when
backend: localearns its keep. - Format not supported for this type - the node says so clearly; e.g.
bpmnonly outputs SVG. Match the type, or switch to a format it allows. - Placeholder image - normal for PDF/txt/base64 output, which are saved to disk but have no raster preview. Not a bug.
- Pasted a workflow with missing nodes - the README's stock answer: load
workflows/uml_single_node.jsonfrom the repo, which is the minimal UML Render + viewer combo, and build up from there.
Small-pack caveat: this is a young, MIT-licensed project from a solo author with CI tests but a small user base. For diagrams it's fine - for anything you'd stake a production system on, treat it as the handy side-tool it is.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| backend | COMBO | web | 2 options: web, local |
| kroki_url | STRING | https://kroki.io | — |
| diagram_type | COMBO | mermaid | 28 options: actdiag, blockdiag, bpmn, bytefield, c4plantuml, d2, +22 |
| code | STRING | sequenceDiagram participant Alice participant Bob Alice->John: Hello John, how are you? loop Healthcheck John->John: Fight against hypochondria end Note right of John: Rational thoughts prevail... John-->Alice: Great! John->Bob: How about you? Bob-->John: Jolly good! | — |
| code_inputopt | * | — | |
| output_formatopt | COMBO | png | 6 options: png, svg, jpeg, pdf, txt, base64 |
| diagram_optionsopt | STRING | — | |
| themeopt | STRING | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| path | STRING | — |
| kroki_url | STRING | — |
| content_for_viewer | STRING | — |
| viewer_url | STRING | — |