LLM Prompt Engine
The prompt mail-merge node — it never calls an LLM, and that's the point
- prompt
- positive
- negative
LLM Prompt Engine looks like an LLM node and isn't one. It makes no API call, needs no key, and doesn't even need Ollama running. What it does is build the prompt string that another node will send - a template with a few slots, filled in for you. Call it a mail-merge for prompts and you've got the whole job description.
So why does it exist? Because the entire trick of getting an LLM to draw a good diagram is prompt hygiene, and the default template shows the game: "Generate a Mermaid diagram that illustrates: {{description}}". You change one variable - the description - and everything else stays on rails. When you're iterating on a workflow, that separation is the difference between "works" and "model wrapped the output in a code fence and explained itself for three paragraphs."
How it works
You feed it a template with placeholders and it substitutes three tokens:
{{description}}- your actual ask{{diagram_type}}- e.g.mermaid,plantuml,graphviz(28 choices, mirroring the UML Render node){{format}}- the output format (png, svg, jpeg, pdf, txt, base64)
It outputs three strings: prompt, positive, and negative. In the stock workflow, prompt goes into LLM Call's prompt input, and negative is a natural fit for its negative_prompt - that's the leash that stops the model adding fences or prose around the diagram code.
The part that's worth more than the whole node is template_file. That dropdown lists preset prompt files that ship in the pack's prompts/ folder - general_mermaid.txt, kroki.txt, mermaid_flowchart.txt, plantuml_sequence.txt, and the interesting one, uml_plan_then_code.txt. Each file contains three blocks (template, positive, negative) separated by ---; pick a preset and it overrides whatever you typed in the widgets. The plan-then-code preset is the closest thing to a real workflow here: it tells the model to plan first, then emit only diagram DSL, no backticks, no YAML front matter. If you're new to this pack, start with that preset instead of hand-writing prompts.
Where it fits
Honest assessment: this node is thin - it's a few dozen lines of string replacement - and you could absolutely build the same prompt by hand. Its value is structural. It keeps the template out of your head and in a dropdown, it keeps diagram_type/format in sync with the render node, and it gives you the positive/negative split that the one-node shortcut (UML Code Assistant) merges into a single call. If you like composing your own chains, LLMPromptEngine → LLMCall → UML Render is the legible version. If you want fewer nodes, use UML Code Assistant instead and skip this one entirely.
Installing and running
It's part of the ComfyUI-UML pack (all five nodes install together, category UML):
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 ComfyUI, add the node, type a description, and the prompt output is ready to wire into an LLM node. No config, no models, no moving parts - it genuinely can't break the way the render side can, because it never leaves your machine.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| templateopt | STRING | Generate a Mermaid diagram that illustrates: {{description}} | — |
| descriptionopt | STRING | Kroki – Creates diagrams from textual descriptions! | — |
| positiveopt | STRING | Output only valid diagram code for the requested diagram_type. Match Kroki expectations (e.g. Mermaid: start with diagram keyword). No prose outside the DSL. | — |
| negativeopt | STRING | No markdown code fences (no ```). No preamble or postamble. No YAML front matter. No alternative diagrams. | — |
| template_fileopt | COMBO | 6 options: , general_mermaid.txt, kroki.txt, mermaid_flowchart.txt, plantuml_sequence.txt, uml_plan_then_code.txt | |
| diagram_typeopt | COMBO | mermaid | 28 options: actdiag, blockdiag, bpmn, bytefield, c4plantuml, d2, +22 |
| output_formatopt | COMBO | svg | 6 options: png, svg, jpeg, pdf, txt, base64 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| positive | STRING | — |
| negative | STRING | — |