Nodes/DiffusionGemma Prompt Builder/DiffusionGemma JSON Splitter
ComfyUI Node

DiffusionGemma JSON Splitter

The polite bouncer that decides whether your AI-written prompt is fit to generate

By exportAnything·Created 2 months ago·Updated 4 days ago· 44
DiffusionGemma JSON Splitter
  • 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
final_json
fallback_prompt
resolution_megapixels2.0
resolution_multiple8
resolution_aspect_ratioAuto (target/source)
resolution_aspect_ratio_override

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. forceInput is 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_height outputs. 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_json and read blocked_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 your custom negatives silently won't apply. Wire the context and profile through even if the splitter "works" without them.
  • Resolution looks wrong - you're seeing resolution_megapixels math, not the video's native size. Bump megapixels if you're targeting higher-res output, and keep resolution_multiple on 8 to stay LTX-friendly.
Categoryprompt/diffusiongemma

Inputs (8)

NameTypeDefaultDescription
final_jsonSTRING
gemma_contextoptDG_CONTEXT
target_profile_configoptDG_TARGET_PROFILE_CONFIG
fallback_promptoptSTRING
resolution_megapixelsoptFLOAT2.00.1–16Used only for the splitter's resolution_width/resolution_height outputs. Matches Resolution Selector megapixels.
resolution_multipleoptINT88–128Used only for the splitter's resolution_width/resolution_height outputs. Matches Resolution Selector multiple.
resolution_aspect_ratiooptCOMBOAuto (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_overrideoptSTRINGOptional 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)

NameTypeDescription
ltx_promptSTRING
ideogram_promptSTRING
negative_promptSTRING
aspect_ratioSTRING
metadata_jsonSTRING
scene_segments_jsonSTRING
local_promptsSTRING
segment_lengthsSTRING
is_validBOOLEAN
resolution_selector_presetSTRING
resolution_widthINT
resolution_heightINT
ready_for_generationBOOLEAN
minimax_h3_promptSTRING
candidate_ltx_promptSTRING
candidate_negative_promptSTRING
candidate_minimax_h3_promptSTRING