Nodes/Comfyui-Video-Progression/Story Scene Switch
ComfyUI Node

Story Scene Switch

The traffic cop that decides first scene vs. keep going

By pmarmotte2·Created 4 months ago·Updated 4 months ago· 3
Story Scene Switch
  • image_input
  • last_frame_input
  • Image
  • Prompt
  • SceneMode
  • LastFrame
  • ForceFlag
  • AutoFlag
scene_mode
user_prompt
auto_generateNo
force_last_frameNo
prompt
trigger0.00

Every iterative video workflow hits the same fork in the road: am I generating the first scene, or the next one? The first has no past to build on. Every scene after needs to know what came before it. Story Scene Switch exists to make that fork a node instead of a ritual of re-cabling your graph between runs.

It's the routing hub of ComfyUI Video Progression. You tell it which scene you're on, and it decides two things for you: which image feeds the sampler and which prompt feeds the text encoder. Everything downstream - the sampler, the image picker, Whole Video - just reads its outputs.

How it routes

First Scene Generation cleans out the pack's temporary last-frame files, then uses your image_input as the main image. If force_last_frame is set to Yes, it exposes last_frame_input on the LastFrame output so you can pair a start frame with an explicit end frame.

Further Generations is where the "progression" actually happens. It finds the latest Infinite_Video*.mp4 in your output folder and pulls the last frame out of it - via imageio talking to ffmpeg, not by decoding the whole video - and that frame becomes the start of the next scene. If it can't read the video it falls back to image_input. Flip force_last_frame to Yes and wire last_frame_input, and you override that extracted frame with a hand-picked one; that's where Last Frame Save's temp_last_frame.png gets consumed.

Prompt logic is the other half. In first-scene mode - or whenever user_prompt is Yes - the node uses the prompt you provided. Otherwise it loads prompt_further.txt from the output folder and uses that. Either way it never rewrites the prompt body; it only wraps it in a storytelling prefix and a "no subtitles, no on-screen text" suffix. So prompt_further.txt is effectively your "what happens next" file, editable between scenes.

Then there's auto_generate. Set it to Yes and the node hard-forces Further Generations behavior no matter what scene_mode says - the switch from README's own words: first scene can't be auto-generated, and the SceneMode output reflects the effective mode. That's how you run an unattended continuation loop.

The inputs and outputs that matter

  • scene_mode - First Scene Generation / Further Generations
  • user_prompt - No / Yes, force the provided prompt
  • auto_generate - No / Yes, lock everything to Further
  • force_last_frame - No / Yes, enable the forced last-frame branch
  • image_input, last_frame_input, prompt (optional), and trigger (a FLOAT you nudge to force a re-run when the graph thinks nothing changed)

Outputs, the six-pack that makes the wiring work:

  • Image - the image to feed your generation branch
  • Prompt - the finished, wrapped prompt
  • SceneMode - the effective mode, meant for Whole Video
  • LastFrame - the forced last frame; only populated when force_last_frame is Yes
  • ForceFlag - BOOLEAN mirror of force_last_frame
  • AutoFlag - BOOLEAN mirror of auto_generate

The README's progression chain is: Story Scene Switch → your generation/edit branch → VP Image Chooser → Whole Video → VHS Video Combine. Plus three control links worth copying:

  • AutoFlag → VP Image Chooser's auto_pick (unattended candidate picking)
  • ForceFlagLazySwitchKJ
  • SceneMode → Whole Video's scene_mode

Troubleshooting, the three that actually bite

  • Wrong frame on a further generation. The switch reads the latest Infinite_Video*.mp4 (highest numeric suffix, then newest mtime). A stale video lingering in the output folder is your bug - delete or archive it.
  • The prompt came out... weird. Check prompt_further.txt exists and is current. A missing file means an empty prompt wrapped in prefixes.
  • It won't re-run. That's what trigger is for - bump it and the node fires again even though its inputs look identical.

Install

The whole pack installs at once - Manager → Install Custom Nodes → search "Comfyui-Video-Progression" → install → restart. Or the terminal version:

cd ComfyUI/custom_nodes
git clone https://github.com/pmarmotte2/Comfyui-Video-Progression

then restart ComfyUI. No model downloads. The one real dependency is that imageio can read MP4 files in your environment - imageio-ffmpeg handles that in a normal install. The author, the same pmarmotte2 who ships the Fill-ChatterBox podcast node and the PoseStudio pack, clearly built this to run a long-form video project; this switch is where all of that intent is encoded. Learn it and the rest of the pack clicks into place.

Categorystory/utility

Inputs (8)

NameTypeDefaultDescription
scene_modeCOMBO2 options: First Scene Generation, Further Generations
user_promptCOMBO2 options: No, Yes
auto_generateoptCOMBONo2 options: No, Yes
force_last_frameoptCOMBONo2 options: No, Yes
image_inputoptIMAGE
last_frame_inputoptIMAGE
promptoptSTRING
triggeroptFLOAT0.00

Outputs (6)

NameTypeDescription
ImageIMAGE
PromptSTRING
SceneModeSTRING
LastFrameIMAGE
ForceFlagBOOLEAN
AutoFlagBOOLEAN