Shot Script Combiner JK๐
Turn an LLM's JSON shot list into prompts your sampler can actually eat
- script_list
An LLM writing a shot-by-shot breakdown is great at writing prose and terrible at matching your workflow's expected format. You ask for three shots and get a JSON blob with shot01, shot02, shot03, each one a nested dict of subject, background, lighting and friends. Your sampler doesn't want JSON - it wants a list of prompt strings, one per shot. Shot Script Combiner JK is the adapter in the middle.
You feed it the raw text the LLM produced, and it hands back a script_list (a STRING list), one prompt per shot, in order. That output is the thing you run a batch loop over, or wire into a "generate these N prompts" node. It's the natural downstream of System Prompter JK in JakeUpgrade's auto-prompt workflows: System Prompter builds the instruction, the VLM writes the script, this node normalizes it.
Inputs
- shot_scripts - the raw text. It's tolerant about format: a JSON object (dict), a JSON array, or a plain multiline string all work. The node detects which one it is and handles it.
- max_shots (default 10) - how many shots to look for. If your LLM returns 6, it takes 6; this just caps the scan. It's generous by default.
- merge_json_details (default off) - this is the interesting one. With it on, each shot's nested JSON fields get flattened into a coherent paragraph, language-appropriate punctuation and all, instead of being passed through as raw JSON. Turn it on if the model downstream reads natural language better than JSON.
The format details worth knowing
For dict input it recognizes the common key shapes - shot01/shot1, frame01/frame1, even plain numeric keys - and scans them in order. If the whole thing is a single description rather than a shot list, it treats it as one shot, which is the right fallback. When merge_json_details is off, dict values are preserved in their original structure rather than mangled.
Install
In the JakeUpgrade pack:
cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
cd ComfyUI-JakeUpgrade
pip install -r requirements.txt # Windows standalone: install.bat
Or ComfyUI Manager โ "JakeUpgrade". No models.
Where people get burned
The classic mistake is max_shots set lower than what the LLM actually returned - you get a silently truncated list and wonder why shot 12 vanished. Set it above your expected count and let the LLM's output drive. The second one is forgetting the LLM. This node normalizes whatever you give it; it doesn't repair a prompt that's just one run-on paragraph. If the VLM's format drifts between runs, that's a system-prompt problem upstream, and the fix is back in System Prompter, not here.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| shot_scripts | STRING | JSON string containing shot prompts or single description | |
| max_shots | INT | 101โ50 | Maximum number of shots to extract |
| merge_json_details | BOOLEAN | false | Merge JSON detail fields into coherent paragraphs |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| script_list | STRING | โ |