Nodes/IAMCCS-nodes/Start Dir To Video Latent ??
ComfyUI Node

Start Dir To Video Latent ??

Same start-frame injection, but reading from disk so long runs stay low-RAM

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
Start Dir To Video Latent ??
  • vae
  • latent
  • latent
  • frames_loaded
  • report
start_diriamccs_extension_disk/start
modeall
count9
insert_at_pixel_frame0
strength1.00
preprocesstrue
preprocess_crf33

IAMCCS_StartDirToVideoLatent is the disk-backed twin of StartImagesToVideoLatent. Same job - encode the previous segment's tail frames and inject them into the next segment's latent so the video continues without a seam - but instead of taking an IMAGE batch in memory, it reads the frames from a directory on disk. In a very long extension run, that's the difference between your system RAM slowly filling with carried-over image batches and a loop that churns along at a steady footprint.

It slots into the pack's disk-based extension loop: the source cache gets written once (by SourceFramesToDisk / the extension module), the planner computes each segment, and this node pulls the boundary frames off disk for each iteration. It also reads the directory fresh every run - IS_CHANGED returns nan - so ComfyUI's cache can't serve you stale frames when the folder's contents changed.

How it works

It lists the frame files in start_dir, trims to count frames per mode (all, from_start, from_end), loads them, optionally runs LTXVPreprocess with preprocess_crf (default 33), resizes to the latent's dimensions, encodes with your vae, and splices the encoded frames into the latent at insert_at_pixel_frame, setting a noise_mask weighted by strength (1.0 = locked in place). The mechanics are identical to the IMAGE-input version; only the source differs. Frame files are discovered by extension, so the exact naming convention doesn't matter as long as they sort in order.

Inputs and outputs

  • start_dir (default iamccs_extension_disk/start) - relative to ComfyUI's output folder unless absolute.
  • vae, latent - as with the image version.
  • insert_at_pixel_frame, strength, mode, count, preprocess, preprocess_crf - injection controls.

Outputs: latent, frames_loaded, report.

Installing

ComfyUI Manager → search "IAMCCS", or

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Restart. Requires ComfyUI's native LTXV nodes for preprocessing (it falls back gracefully if missing) and Pillow to load the frames, which ships with ComfyUI.

Gotchas

The whole node collapses if start_dir is empty or points at the wrong folder - the error is a hard ValueError ("No start frames found"), which is at least loud. The typical cause is a relative path that resolved to the output folder instead of where the extension module actually wrote the frames, so use the exact frames_dir output from the writer node rather than retyping the path. And keep the frame ordering convention consistent: from_end takes the last N by sorted filename, so a prefix that changes naming mid-run scrambles which frames you get. Finally, remember frame files on disk are the source of truth here - if you changed the video upstream, clear the cache or the injector happily feeds you the old boundary.

CategoryIAMCCS/LTX-2

Inputs (9)

NameTypeDefaultDescription
start_dirSTRINGiamccs_extension_disk/startDirectory containing the start frames for the next segment.
vaeVAE
latentLATENT
modeCOMBOall3 options: all, from_start, from_end
countINT91–512
insert_at_pixel_frameINT00–100000
strengthFLOAT1.000–1
preprocessBOOLEANtrue
preprocess_crfINT330–100

Outputs (3)

NameTypeDescription
latentLATENT
frames_loadedINT
reportSTRING