Prompt JSON
Prompt JSON writes the form your LLM node has to fill in
- system_prompt
- user_prompt
- negative_passthru
- schema
Reality check before you install: Prompt JSON does not generate anything. It calls no API, needs no key, and won't turn "a serene lake at sunset" into an image by itself. What it does is take your natural-language prompt and rebuild it into a structured system prompt, user prompt, and schema that you feed to whatever LLM node you already have in ComfyUI - Qwen, Ollama, an OpenRouter call, your choice. It's the node that hands the LLM a form and tells it to fill in the blanks.
Why bother? Raw prose into an LLM gets you whatever the model feels like that day. Pin the answer to a schema and you get consistent, structured descriptions you can actually trust. This is the same trick the 2026 LLM-encoded models reward: JSON is just one way to give an LLM clean separation between fields, and it shines when you have several characters with several attributes each and plain prose keeps bleeding them together. This node automates the writing of that prompt.
How it works
Six required inputs go in: prompt, negative_prompt, complexity, llm_prompt_type, schema_type, and enhance_prompt (plus the optional custom_schema). The node stitches together a system prompt from built-in templates, embeds the chosen schema into a user prompt, and returns four strings: system_prompt, user_prompt, negative_passthru, and schema.
Wire the first two into your external LLM node, negative_passthru into your negative encoder (it's just your negative prompt, untouched), and schema into a Show Text if you want to see what structure was actually used.
The inputs that actually matter
schema_type- pick one of seven: JSON, HTML, Key, Attribute-Based, Visual Layer Breakdown, Compositional Grid, or Artistic Reference. JSON is the safe default; Visual Layer (background/midground/foreground) is great for scenes with depth.llm_prompt_type- One Shot embeds a single medium-complexity example; Few Shot embeds low/medium/high examples so the LLM sees how detail scales.enhance_prompt- the subtle one. Off (default) means the LLM is told to strictly use only your words. On means it's encouraged to invent consistent detail, andcomplexity(0.1–1.0) only starts to matter here - leave it off and the complexity value is ignored entirely.custom_schema- your own structure, optional. This is where you get real control.
Install
ComfyUI Manager, search "PromptJSON Node for ComfyUI" (or "Prompt JSON"), or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/NeuralSamurAI/ComfyUI-PromptJSON
Then restart ComfyUI. Here's the good part: there's no requirements.txt and no model download. It's pure Python stdlib string-building - nothing to pip, no weights to fetch. Refreshing after the author's other node (Superprompt, which drags down a T5 model) is a welcome change.
Where people get burned
- Nothing happens until you connect an LLM node. If you feed the outputs straight to a text encoder, you'll see literal template text. This is a front-end for an LLM, not the LLM.
- Malformed
custom_schemafails silently. If it's not a valid JSON object (for JSON and the three breakdown types), the node catches the error, logs it, and quietly falls back to the built-in default schema. Your custom structure vanishes with no visible error - always check theschemaoutput. - HTML and Key custom schemas aren't parsed - they're passed through as raw text, so don't expect validation there. Attribute-Based expects one attribute per line.
- The module sets global logging to DEBUG on import, which can flood your console with other libraries' debug lines. Harmless, just noisy.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| negative_prompt | STRING | — | |
| complexity | FLOAT | 0.50.1–1 | — |
| llm_prompt_type | COMBO | 2 options: One Shot, Few Shot | |
| schema_type | COMBO | 7 options: JSON, HTML, Key, Attribute-Based, Visual Layer Breakdown, Compositional Grid, +1 | |
| enhance_prompt | BOOLEAN | false | — |
| custom_schemaopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| system_prompt | STRING | — |
| user_prompt | STRING | — |
| negative_passthru | STRING | — |
| schema | STRING | — |