Custom ComfyUI nodes for iterative video storytelling workflows.
This package is built around a simple progression loop:
- generate a first scene
- keep the current video state in
Infinite_Video*.mp4 - generate further scenes from the last frame of that video
- optionally force a custom last frame
- choose or auto-pick candidate images
- rebuild the full frame batch for the next video write
Included nodes:
Story Scene SwitchWhole VideoLast Frame SaveVP Image ChooserPrompt TravelingVace Resolution Wizard
Copy or clone this repository into your ComfyUI custom_nodes folder:
ComfyUI/custom_nodes/Comfyui-Video-Progression
Then:
- Restart ComfyUI.
- Hard refresh the browser (
Ctrl+F5) so theVP Image Chooserfrontend loads.
These nodes expect a standard ComfyUI environment with:
torchnumpyPillowimageio
Video-aware nodes also rely on an imageio backend that can read MP4 files in your environment.
Main routing node for first-scene vs further-scene generation.
Inputs:
scene_mode:First Scene GenerationorFurther Generationsuser_prompt:YesorNoauto_generate:YesorNoforce_last_frame:YesorNoimage_input: optionalIMAGElast_frame_input: optionalIMAGEprompt: optional inputSTRINGtrigger: optionalFLOATused to force re-execution when needed
Outputs:
ImagePromptSceneModeLastFrameForceFlagAutoFlag
Behavior:
auto_generate = Yes- forces the node to behave as
Further Generations First Scene Generationcannot be auto-generated- the
SceneModeoutput reflects the effective mode used by the node
- forces the node to behave as
First Scene Generation- removes temporary last-frame files from the ComfyUI output folder
- uses
image_inputas the main image when available - if
force_last_frameisYes,last_frame_inputis exposed throughLastFrame
Further Generations- reads the last frame from the latest
Infinite_Video*.mp4in the output folder - if
force_last_frameisYesandlast_frame_inputis connected, that image is used instead - falls back to
image_inputonly if the video frame cannot be read
- reads the last frame from the latest
Prompt logic:
- when
scene_modeisFirst Scene Generation, oruser_promptisYes, the node uses the providedprompt - otherwise it loads
prompt_further.txtfrom the output folder - the prompt body is not rewritten
- the node only adds instruction prefix/suffix text
Extra outputs:
ForceFlagis aBOOLEANmirror offorce_last_frameAutoFlagis aBOOLEANmirror ofauto_generateLastFrameis only populated whenforce_last_frameisYes
Typical uses:
- connect
ForceFlagtoLazySwitchKJ - connect
AutoFlagtoVP Image Chooser.auto_pick - connect
SceneModetoWhole Video.scene_mode
Builds the full frame batch that should be sent to VHS_VideoCombine.
Inputs:
scene_mode: string fromStory Scene Switchwait_for:IMAGEbatch, typically from the VAE decode output you want to turn into video
Outputs:
Imagescount
Behavior:
First Scene Generation- if a previous
Infinite_Video*.mp4exists, it is archived asDefinitive_Infinite_Video_XXX.mp4 - only the new
wait_forframes are returned
- if a previous
Further Generations- loads frames from the latest
Infinite_Video*.mp4 - deletes that source file
- appends the new
wait_forframes - returns the combined batch
- loads frames from the latest
Important:
- this node does not write the final video file itself
- it prepares frames for
VHS_VideoCombine VHS_VideoCombineshould then write the newInfinite_Video*.mp4
Utility node that writes an input image to:
output/temp_last_frame.png
Inputs:
image
Outputs:
Image
Behavior:
- removes the previous
temp_last_frame.pngif it exists - saves the new one
- passes the image through unchanged
Standalone image chooser extracted into this repository, with its own frontend.
Inputs:
mode:Always PauseorKeep Last Selectionpreview_rescaleimages: optionalIMAGEbatchauto_pick: optionalBOOLEAN
Outputs:
image
Behavior:
- when
auto_pickisTrue, the node randomly selects one image and returns it immediately - when
auto_pickisFalse, the node opens a modal dialog so the user can choose manually Keep Last Selectionreuses the previous selection when possible
Notes:
- this chooser does not depend on Easy Use
- if you update the chooser frontend, restart ComfyUI and hard refresh the browser
Cycles through up to 20 prompts, one prompt per line.
Inputs:
prompts: multilineSTRING, one prompt per lineprompt_index: visible slider from1to20
Outputs:
Prompt
Behavior:
- blank lines are ignored
- only the first 20 non-empty lines are used
- on each run, the node outputs the prompt matching the current slider value
- after the run, the visible slider is automatically incremented by
1 - when the next value exceeds the number of available prompt lines, it wraps back to
1
Notes:
- the node is forced to execute on every queue so the counter can advance even if the text does not change
- after editing the frontend files, restart ComfyUI and hard refresh the browser
Resizes an image to a fixed target format for video generation.
Inputs:
imageAUTOformat:Square,16/9, orVerticalcrop_instead_of_padDraft
Outputs:
WidthHeightResized_Image
Target sizes:
Square:720 x 72016/9:960 x 544Vertical:544 x 720
If Draft is enabled, width and height are halved.
Behavior:
- if
AUTOis enabled, the format is inferred from the input aspect ratio - if
crop_instead_of_padis enabled, the image fills the target and is center-cropped - otherwise the image is fitted inside the target and padded
Typical progression wiring:
Story Scene Switch- your generation / edit branch
VP Image ChooserWhole VideoVHS_VideoCombine
Useful control links:
Story Scene Switch.AutoFlag->VP Image Chooser.auto_pickStory Scene Switch.ForceFlag->LazySwitchKJ.switchStory Scene Switch.SceneMode->Whole Video.scene_mode- decoded frames ->
Whole Video.wait_for
These nodes read and write in the ComfyUI output directory resolved from:
folder_paths.get_output_directory()/output./output
Files used by the workflow:
Infinite_Video*.mp4Definitive_Infinite_Video_XXX.mp4prompt_further.txttemp_last_frame.png
- If
VP Image Chooserdoes not open correctly, restart ComfyUI and hard refresh the browser. - If further generations use the wrong frame, verify that the latest
Infinite_Video*.mp4exists in the output folder. - If prompt progression is wrong, verify that
prompt_further.txtexists and is updated before the next run.