Nodes/ComfyUI-AusBoss/Video Pieces πŸ†Ž
ComfyUI Node

Video Pieces πŸ†Ž

Plans a long clip as pieces for a video model that makes a few seconds at a time, for a loop that makes one piece each time round. Each piece repeats the last frames of the piece before, so the two join without a jump, and a new piece starts at every cut between shots, so no piece mixes two shots. Wire pieces into Start Loop's max iteration (For, step 1) and the loop's iteration index into piece.

By ausbossΒ·Created 4 months agoΒ·Updated about 5 hours agoΒ· 163
Video Pieces πŸ†Ž
  • images
  • clip_settings
  • pieces
  • start
  • frames
  • shared
  • continues
  • longest_start
  • longest_frames
β—„piece_frames192β–Ί
β—„shared_frames39β–Ί
β—„split_at_cutstrueβ–Ί
β—„scene_cut_threshold0.35β–Ί
β—„pieceβ€”β–Ί
CategoryπŸ†Ž AusBoss/Video

Inputs (7)

NameTypeDefaultDescription
piece_framesINT1921–100000Frames in each piece: as many as your video model makes at once. 192 is 8 s at 24 fps.
shared_framesINT390–99999Frames each piece repeats from the end of the piece before, so the two join without a jump. Never shared across a cut. Keep it below Piece.
split_at_cutsBOOLEANtrueon: a new piece starts at every cut between shots, so no piece mixes two shots. off: a new piece every Piece - Shared frames, cuts or not.
scene_cut_thresholdFLOAT0.350–1How big a change between two frames counts as a cut: a change that jumps out from the frames around it, or any change above this number. The same finder as Frame Interpolate.
imagesoptIMAGEYour whole clip, every frame. Or wire clip_settings instead.
clip_settingsoptAUSBOSS_CLIP_SETTINGSThe clip_settings of the Video Crop + Rotate + Pad -> Clip that loads your clip. The node then reads the clip itself, small, so a long clip never has to sit in memory.
pieceoptINTWhich piece, counting from 0: wire the loop's iteration index here. Not wired: the first piece.

Outputs (7)

NameTypeDescription
piecesINTHow many pieces the clip makes: wire it into Start Loop's max iteration.
startINTThe first frame of this piece, counting from 0.
framesINTFrames in this piece.
sharedINTFrames this piece repeats from the end of the piece before: 0 for the first piece and right after a cut.
continuesBOOLEANTrue when this piece carries on from the piece before (Shared above 0): wire it to Follow Video Latent's hold.
longest_startINTThe first frame of the clip's longest shot, the same for every piece. A clip that opens on someone else mostly does so briefly, so this is where to look for the person the clip is about.
longest_framesINTFrames in the longest shot, at most one piece.