Nodes/StudioDeep/JSON Shot Splitter
ComfyUI Node

JSON Shot Splitter

Slice a shot manifest into per-shot prompts without touching code

By studiodeep-ai·Created 6 months ago·Updated 5 months ago· 0
JSON Shot Splitter
    • shot_1
    • shot_2
    • shot_3
    • shot_4
    • shot_5
    • shot_6
    • shot_7
    • shot_8
    • shot_9
    • shot_10
    • shot_11
    • shot_12
    • shot_13
    • shot_14
    • shot_15
    • shot_16
    • shot_17
    • shot_18
    • shot_19
    • shot_20
    json_string
    shot_count2

    Here's a workflow that comes up a lot once you have an LLM planning your videos: the model returns one big JSON blob describing every shot in a sequence, and you need to turn that into individual prompts, one per sampler node. That's exactly what JSON Shot Splitter does - and it's the unsung workhorse of the pack's N8N story.

    It takes a JSON string and a shot_count, reads a shot_manifest object out of it (a dict with shot_1, shot_2, ... keys), and splits each entry into its own output socket: shot_1 through shot_20. If an entry is already a string it passes through untouched; if it's an object or array it's serialized to pretty-printed JSON so you can still read it.

    The inputs that matter

    • json_string - the manifest JSON. It's a forced input (forceInput), meaning you'll typically wire it from an LLM node or an N8N response rather than typing it, which is the right call - pasting a big manifest by hand is miserable.
    • shot_count - 1 to 20, default 2. This controls how many manifest entries get split out. A neat detail: the pack's JS extension syncs the visible output sockets to this value, so at shot_count: 3 you see three sockets, not twenty. The extra outputs still exist in the schema and just come back empty.

    Outputs: shot_1shot_20 (all STRING).

    Installing

    The usual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/studiodeep-ai/comfyui-studiodeep StudioDeep
    pip install -r StudioDeep/requirements.txt
    

    or search "StudioDeep" in ComfyUI Manager, then restart. No keys, no models.

    Troubleshooting

    • "Invalid JSON string" - the input isn't valid JSON. If it's coming from an LLM, watch for markdown fences or trailing prose; those break json.loads.
    • Empty outputs with valid JSON - your JSON has no shot_manifest key (the node looks specifically for shot_manifest.shot_N), or the keys are named differently. Rename the keys in whatever produces the JSON and the node will find them.
    • A shot comes back as JSON instead of text - that's by design for object entries. If you wanted the raw string, the upstream JSON needs the shot as a string in the first place.

    The honest take: it's a small, opinionated node with a specific contract (shot_manifest), and it's clearly built to sit downstream of an n8n workflow that produces that shape. If you control the workflow, this makes the LLM-to-multiple-samplers hop a one-wire affair; if your JSON has a different structure, you'll be reformatting it first.

    CategoryStudioDeep/JSON

    Inputs (2)

    NameTypeDefaultDescription
    json_stringSTRING
    shot_countINT21–20

    Outputs (20)

    NameTypeDescription
    shot_1STRING
    shot_2STRING
    shot_3STRING
    shot_4STRING
    shot_5STRING
    shot_6STRING
    shot_7STRING
    shot_8STRING
    shot_9STRING
    shot_10STRING
    shot_11STRING
    shot_12STRING
    shot_13STRING
    shot_14STRING
    shot_15STRING
    shot_16STRING
    shot_17STRING
    shot_18STRING
    shot_19STRING
    shot_20STRING