Nodes/arkennemasis Nodes/arkennemasis Scene Split (one scene from a JSON plan)
ComfyUI Node

arkennemasis Scene Split (one scene from a JSON plan)

Pull scene N out of the plan without failing the whole run

By Hishamahmer·Created 2 months ago·Updated 8 days ago· 9
arkennemasis Scene Split (one scene from a JSON plan)
    • image_prompt
    • video_prompt
    • voice_text
    • scene_number
    • scene_count
    scenes_json[]
    scene_index1
    image_prompt_keyimage_prompt
    video_prompt_keyvideo_prompt
    voice_text_keyvoiceText
    scene_number_keyscene
    strictfalse

    The classic storyboard problem: your LLM planning step returns a JSON array - one object per scene, each carrying its own image prompt, video prompt and voice line - and you need each scene to drive its own branch of the graph. Without a loop, the no-code equivalent of "fan out and run once per scene" is N copies of the scene branch, each pulling out its own slot. ArkSceneSplit is the node that does the pulling: give it the whole array and a scene_index, and it returns that one scene's fields.

    What makes it worth a look over a hand-rolled JSON parse is the out-of-range behaviour. Ask for scene 7 when the plan only has 6, and the node returns an ExecutionBlocker on every output instead of raising. The branch goes dark, everything downstream is skipped quietly, and the rest of the run proceeds. That's exactly the behaviour you want when you follow the standard advice to test 1–2 scenes before committing to a long render - a 6-scene plan running on a canvas built for 12 just runs 6 and leaves the rest idle. Flip strict on if you'd rather get a loud IndexError than a silent skip, for example when you're validating that the plan really is complete.

    The inputs that matter

    Two required inputs carry the whole node:

    • scenes_json - the full JSON array, wired from the same source into every scene branch. It tolerates {"scenes": [...]} wrappers.
    • scene_index - which scene this branch owns, 1-based, unique per copy.

    The optional fields are for adapting the node to plans that don't use the pack's default schema: image_prompt_key, video_prompt_key, voice_text_key (default voiceText - note the camelCase, it's the pack's convention), and scene_number_key (default scene). If your agent renames or omits the scene number, the node falls back to array position, so a plan that renumbers scenes doesn't silently empty branches.

    Outputs and where they go

    Five outputs: image_prompt, video_prompt, voice_text, plus scene_number (the scene's declared number, or the array position) and scene_count (how many scenes the plan has - handy if a downstream node needs to know the total). Wire image_prompt into your image chain, video_prompt and voice_text into the video chain, and the number into your filename or run-log so each branch names its own output.

    Install and context

    This is one node in the 61-node comfyui-arkennemasis pack, so install once and it's in the arkennemasis/Utility menu:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Hishamahmer/comfyui-arkennemasis
    pip install -r comfyui-arkennemasis/requirements.txt   # then restart ComfyUI
    

    ComfyUI Manager → Install via Git URL with the repo URL works too. No models to download, no API key needed - this node is pure JSON plumbing.

    The one thing to keep in mind: this is the fan-out approach (N branches), the sibling of ArkSceneList's true loop. If you've got a single uniform scene chain, Scene List's list-output trick means you don't need N copies at all. Scene Split earns its keep when branches genuinely differ - different conditioning, different save nodes, per-scene gates - so each needs its own copy of the pipeline. Both are in the same pack, so you're not choosing between them; you're picking whichever matches the shape of your workflow.

    Categoryarkennemasis/Utility

    Inputs (7)

    NameTypeDefaultDescription
    scenes_jsonSTRING[]The whole JSON array. Wire the SAME source into every scene branch.
    scene_indexINT11–9999Which scene this branch owns, 1-based. Unique per copy.
    image_prompt_keyoptSTRINGimage_prompt
    video_prompt_keyoptSTRINGvideo_prompt
    voice_text_keyoptSTRINGvoiceText
    scene_number_keyoptSTRINGscene
    strictoptBOOLEANfalseOn = raise when this index is missing. Off (default) = skip the branch quietly, so a short plan does not fail a canvas built for more scenes.

    Outputs (5)

    NameTypeDescription
    image_promptSTRING
    video_promptSTRING
    voice_textSTRING
    scene_numberINT
    scene_countINT