Ideogram4-KoboldCPP
Rewrite Ideogram 4's JSON prompt, one region at a time
- json_output
Ideogram 4 doesn't take a plain prompt - it takes a structured JSON object with a high-level description, a background description, and a list of bounding-boxed elements. Editing that by hand is miserable, and rewriting the whole thing in one LLM call bleeds details between regions. Ideogram4-KoboldCPP fixes both: it splits the JSON into fragments, rewrites each one in a separate local KoboldCpp request, and reassembles the structure with its boxes and types untouched.
This is a niche node for a specific model. If you don't run Ideogram 4 weights (the 9.3B DiT whose whole claim to fame was best-in-class text rendering and JSON-only prompting - see the KB's ideogram-4 panel), you can stop reading here. If you do, this is the node that turns "make the background moodier" into a targeted, structure-preserving edit instead of a hand-edited JSON blob.
How it works
The node walks your JSON and rewrites these fields (each gated by a process_* switch, all on by default):
high_level_descriptioncompositional_deconstruction.backgroundcompositional_deconstruction.elements[*].desc- except elements whosetypeis"text", which are preserved literally because you don't want an LLM "fixing" your in-image text.
Everything else - bounding boxes, element types, literal text elements, unknown keys, unselected fields - is passed through byte-for-byte. Crucially, the model only ever sees one prompt fragment at a time. It never sees the JSON structure, the field name, other regions, or the bounding boxes, which is how detail stays put instead of leaking across the image.
The switches that matter:
process_high_level_description,process_background,process_elements- turn off any region you don't want touched.seed_mode-Offset per fieldgives each rewritten fragment its own seeded dice roll;Same seedmakes every field use the same seed.on_error-Stopaborts the workflow if a fragment rewrite fails;Keep Originalkeeps the source fragment and continues.pretty_json- formatted vs. compact output. Keep it on for readability.
On top of that you get the full amplification control set: model_profile, style_preset, framing_preset, embellishment_level, thinking_mode, additional_instructions, and the usual KoboldCpp request knobs (URL, token allowance, temperature, penalties). Each fragment is rewritten using those same settings, so one style decision propagates consistently across the whole JSON.
The single output is json_output (STRING) - feed it back into whatever reads Ideogram 4's structured prompt.
Installing it
Same pack, same install:
cd ComfyUI/custom_nodes
git clone https://github.com/tiko13/ComfyUI_PromptStudio
Restart ComfyUI, or install "ComfyUI_PromptStudio" via ComfyUI Manager. No pip dependencies - you need a local KoboldCpp server (default http://localhost:5001; Ollama and llama.cpp work too), and for KoboldCpp specifically, enable Use Jinja and restart so the chat-template rewrite works.
Where people get burned
- Malformed input JSON. The node expects the Ideogram 4 structured-prompt schema. If you paste something else in, garbage out - it won't invent the schema for you.
- Expecting region coordination. Each fragment is rewritten blind. The node preserves structure on purpose; if you need the background to mention what's in the foreground, put that in
additional_instructions. - Text elements changing. They won't - by design. If you want your in-image text reworded, this node is the wrong tool.
- VRAM contention. Same as every KoboldCpp node here: on a single GPU the LLM and diffusion model share VRAM, and the shared-GPU handoff needs KoboldCpp Admin Mode + an Admin Directory. Multiple fragment rewrites mean multiple LLM calls per run, so give the handoff time to work.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| json_input | STRING | — | |
| additional_instructions | STRING | Optional extra guidance for each extracted prompt fragment. | |
| model_profile | COMBO | 3 options: General Natural Language, Tag-Based Anime Model, Tag-Based Photorealistic Model | |
| style_preset | COMBO | 118 options: None, Neutral, Casual Snapshot, Amateur Photography, Candid Photography, Tag Dense, +112 | |
| style_modifier | STRING | Optional aesthetic/style guidance added to the selected style preset. Select None for modifier-only behavior. | |
| framing_preset | COMBO | 32 options: None, Selfie, Mirror Selfie, Candid Unaware, Close-Up Portrait, Medium Shot, +26 | |
| framing_modifier | STRING | Optional framing/composition guidance added to the selected framing preset. Select None for modifier-only behavior. | |
| thinking_mode | COMBO | Disabled | Private-reasoning limits: Minimal 200 tokens, Low 500, Medium 1000, and High uses the available context window. |
| embellishment_level | COMBO | Clean | Controls how much each extracted prompt fragment is expanded or polished. |
| process_high_level_description | BOOLEAN | true | — |
| process_background | BOOLEAN | true | — |
| process_elements | BOOLEAN | true | — |
| seed_mode | COMBO | 2 options: Offset per field, Same seed | |
| on_error | COMBO | 2 options: Stop, Keep Original | |
| pretty_json | BOOLEAN | true | — |
| kobold_url | STRING | http://localhost:5001 | Base URL for the local KoboldCpp server. |
| max_response_tokens | INT | 00–8192 | Final-answer token allowance. Use 0 to use the profile default. Native reasoning receives an additional budget within the server context window. |
| temperature | FLOAT | 0.250–5 | — |
| top_p | FLOAT | 0.800–1 | — |
| top_k | INT | 400–200 | — |
| min_p | FLOAT | 0.000–1 | — |
| rep_pen | FLOAT | 1.050.5–3 | — |
| rep_pen_range | INT | 3600–4096 | — |
| sampler_seed | INT | -1-1–999999 | -1 lets KoboldCpp choose a random seed. |
| stop_sequence | STRING | Optional stop sequences, one per line. | |
| request_timeout | INT | 1205–600 | HTTP timeout in seconds. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| json_output | STRING | — |