Nodes/arkennemasis Nodes/arkennemasis Scene At (one scene of the plan, by index)
ComfyUI Node

arkennemasis Scene At (one scene of the plan, by index)

One scene of the plan, by index, as plain values — the piece the loop needs

By Hishamahmer·Created 2 months ago·Updated 8 days ago· 9
arkennemasis Scene At (one scene of the plan, by index)
    • video_prompt
    • voice_text
    • image_prompt
    • scene_number
    • total
    scenes_json[]
    index0

    ComfyUI has no loop construct, but it does have an executor that already iterates: a node that declares list outputs makes every downstream node run once per item. That's ArkSceneList's trick for fanning a shot plan out. ArkSceneAt is the opposite move - it picks one scene out of the plan by index and returns it as plain values, so you can build a per-scene chain that renders, saves and frees memory before the next scene begins.

    Why would you want the single-scene version when the list version exists? The description answers it: "use it inside a for-loop so each shot renders, saves and frees before the next begins - which is what lets a folder of any size finish." If a video pipeline tries to hold every scene in flight at once, a folder of any real size runs out of VRAM long before it runs out of scenes. One scene at a time, resources returned between iterations, and the size stops being a problem.

    How it works

    Give it scenes_json (the array from the story agent) and an index (0-based - wire the loop's index in), and it returns that scene's fields: video_prompt, voice_text and image_prompt, plus scene_number and total. The field parsing is deliberately tolerant - it accepts camelCase or snake_case for the same field, so a plan written one way doesn't produce a silent empty string three nodes later. Out-of-range indexes clamp to the nearest valid scene with a console note. IS_CHANGED returns NaN so it never serves a stale cached scene across iterations.

    Inputs and outputs

    • scenes_json - the JSON array from the story agent.
    • index - 0-based; wire the loop's index here.
    • video_prompt, voice_text, image_prompt - the three text outputs for the generation chain.
    • scene_number, total - position and count, handy for filenames, logs, or "scene 3 of 12" overlays.

    In the arkennemasis video pipeline these feed the per-shot chain: condition → sample → decode video and audio → mux → save → free. ArkQwenTTS can supply the voice for voice_text, and ArkRunLog can record each scene as it completes.

    Install and gotchas

    Part of the arkennemasis pack:

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

    Restart, or install via ComfyUI Manager by repo URL.

    An empty or unparseable plan returns empty strings and a console warning rather than crashing - which is friendly, but it means an empty scenes_json won't fail loudly. Check the console if a loop "completes" with nothing produced. And remember the pairing: ArkSceneAt is the per-index picker for the loop style, ArkSceneList is the fan-out for the list style. Pick the one that matches how your canvas is wired; mixing both against the same plan is the only way to confuse yourself.

    Categoryarkennemasis/Video

    Inputs (2)

    NameTypeDefaultDescription
    scenes_jsonSTRING[]The JSON array from the story agent.
    indexINT00–1000000-based. Wire the loop's `index` here.

    Outputs (5)

    NameTypeDescription
    video_promptSTRING
    voice_textSTRING
    image_promptSTRING
    scene_numberINT
    totalINT