DiffusionGemma JSON Splitter
The polite bouncer that decides whether your AI-written prompt is fit to generate
- gemma_context
- target_profile_config
- ltx_prompt
- ideogram_prompt
- negative_prompt
- aspect_ratio
- metadata_json
- scene_segments_json
- local_prompts
- segment_lengths
- is_valid
- resolution_selector_preset
- resolution_width
- resolution_height
- ready_for_generation
- minimax_h3_prompt
- candidate_ltx_prompt
- candidate_negative_prompt
- candidate_minimax_h3_prompt
This is the end of the DiffusionGemma line, and it's the node with the best job description in the pack: it takes the CoT Generator's final_json and turns it into actual inputs your LTX (or Ideogram) workflow can chew on - and it refuses to pass garbage through. A language model wrote that JSON, which means sometimes it's messy, sometimes it's malformed, and occasionally it's confidently wrong about what your video actually showed. The JSON Splitter is where all of that gets repaired or stopped.
Its most underrated feature is the gate. ready_for_generation is a boolean that's computed upstream - it's false when the output had to fall back to a template, when JSON parsing failed, when a visual-grounding warning fired, or when an image_identity_video_control run was missing its identity image. And here's the polite part: when it's false, the splitter blanks out the prompt outputs rather than shipping a bad prompt downstream. You get empty strings instead of garbage, and a metadata_json explaining why.
How it works
The splitter re-parses the incoming final_json (stripping thinking blocks and markdown fences first). If it's already valid, great - it goes straight to the splitter. If not, it runs the same repair/salvage pipeline the generator uses: labeled-field extraction from plain text, then a deterministic template fallback. It marks json_parse_valid and salvage_warning in the metadata so you can see which path it took.
Then it does the actual splitting: the LTX prompt is broken into scene segments by sentence, the negative prompt is enforced per the Target Profile's policy, and the resolution is computed from the packet's aspect ratio using resolution_megapixels and resolution_multiple - deliberately matching the Resolution Selector's math so your width/height line up with what the sampler expects - both come out rounded to a multiple of 8 by default, and LTX 2.3 wants dimensions on a multiple-of-32 grid, so raise resolution_multiple to 32 if you're feeding a strict LTX preset.
The inputs that matter
- final_json (required) - straight from the CoT Generator.
forceInputis on, so wire it, don't type into it. - gemma_context and target_profile_config (optional) - feed these through so the splitter has the media metadata and negative-prompt policy to work with. If you skip them, it makes reasonable assumptions, but the negative policy and grounding checks work best with the real objects.
- fallback_prompt - what to use if there's no usable prompt anywhere. The splitter will even segment this for you.
- resolution_megapixels (default 2.0) and resolution_multiple (default 8) - only affect the
resolution_width/resolution_heightoutputs. Leave at defaults unless you're matching a specific Resolution Selector preset.
The output list is long (13 ports), but you'll actually reach for these:
- ltx_prompt → LTX positive prompt input
- negative_prompt → LTX negative prompt input
- ready_for_generation → wire to a gate (or just eyeball it before queueing)
- scene_segments_json / local_prompts / segment_lengths → for segmented or per-segment generation, where each segment gets its own prompt and duration
- resolution_selector_preset / resolution_width / resolution_height → resolution for the sampler
- metadata_json → the diagnosis port: parse flags,
blocked_reasons, timing
Install
Same as its four siblings - ComfyUI Manager (search DiffusionGemma Prompt Builder) or
cd ComfyUI/custom_nodes
git clone https://github.com/exportAnything/ComfyUI-DiffusionGemmaPromptBuilder
then restart. Technically this node can run standalone if you paste a valid packet into final_json, but the whole point is the wired chain: Context Hub → Target Profile → CoT Generator → this. It needs the pack's dependencies (transformers, comfy-kitchen, accelerate) installed even though the splitter itself does no inference, because it shares the pack's Python module.
Common issues
- Everything comes back empty. That's the gate working, not a bug. Open
metadata_jsonand readblocked_reasons- template fallback, failed JSON parse, missing identity image, or a grounding warning. Fix the listed cause upstream in the CoT Generator or Context Hub. - The real user error here is skipping the optional inputs. Without
target_profile_config, the negative-prompt policy falls back to defaults and yourcustomnegatives silently won't apply. Wire the context and profile through even if the splitter "works" without them. - Resolution looks wrong - you're seeing
resolution_megapixelsmath, not the video's native size. Bump megapixels if you're targeting higher-res output, and keepresolution_multipleon 8 to stay LTX-friendly.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| final_json | STRING | — | |
| gemma_contextopt | DG_CONTEXT | — | |
| target_profile_configopt | DG_TARGET_PROFILE_CONFIG | — | |
| fallback_promptopt | STRING | — | |
| resolution_megapixelsopt | FLOAT | 2.00.1–16 | Used only for the splitter's resolution_width/resolution_height outputs. Matches Resolution Selector megapixels. |
| resolution_multipleopt | INT | 88–128 | Used only for the splitter's resolution_width/resolution_height outputs. Matches Resolution Selector multiple. |
| resolution_aspect_ratioopt | COMBO | Auto (target/source) | Aspect ratio used by resolution_width/resolution_height. Auto matches an attached LTX first frame, uses the Ideogram target ratio, or defaults unconditioned LTX to 16:9. Select a ratio here to override it explicitly. |
| resolution_aspect_ratio_overrideopt | STRING | Optional canonical W:H ratio supplied by a project-level contract. When connected and non-empty, it overrides the local aspect widget without shifting legacy widget values. |
Outputs (17)
| Name | Type | Description |
|---|---|---|
| ltx_prompt | STRING | — |
| ideogram_prompt | STRING | — |
| negative_prompt | STRING | — |
| aspect_ratio | STRING | — |
| metadata_json | STRING | — |
| scene_segments_json | STRING | — |
| local_prompts | STRING | — |
| segment_lengths | STRING | — |
| is_valid | BOOLEAN | — |
| resolution_selector_preset | STRING | — |
| resolution_width | INT | — |
| resolution_height | INT | — |
| ready_for_generation | BOOLEAN | — |
| minimax_h3_prompt | STRING | — |
| candidate_ltx_prompt | STRING | — |
| candidate_negative_prompt | STRING | — |
| candidate_minimax_h3_prompt | STRING | — |