Nodes/ComfyUI-TJ_NODE_STUDIO_ONE/LTX Chunk Writer (TJ 2.5)
ComfyUI Node

LTX Chunk Writer (TJ 2.5)

Writes a chunk of a long video out as PNG frames instead of encoding video, and copies the last N frames into ComfyUI's input folder so they can be dropped straight onto the timeline as guides for the next chunk. Passes images through unchanged, so it can sit in front of Video Combine rather than replacing it.

By designloves2·Created 4 months ago·Updated 3 days ago· 35
LTX Chunk Writer (TJ 2.5)
  • images
  • audio
  • images
  • handoff_folder
  • info
◄run_namerun01►
◄chunk_index1►
◄handoff_frames8►
◄runs_folderltx25_one_runs►
◄save_all_framestrue►
◄clear_chunk_firsttrue►
◄total_chunks1►
◄auto_assembletrue►
◄write_videotrue►
◄video_fps25.00►
◄video_crf18►
◄match_to_previousfalse►
◄frame_formatjpeg►
◄jpeg_quality95►
◄write_final_framesfalse►
◄seam_modeearly_cut►
◄seam_blend_frames3►
◄assemble_match_levelstrue►
CategoryWhatDreamsCost CS 2.5

Inputs (20)

NameTypeDefaultDescription
imagesIMAGE—
run_nameSTRINGrun01Folder name for this whole long-video run. Keep it the same across every chunk of the same video.
chunk_indexINT11–999Which chunk this is. 1 for the first, 2 for the next, and so on.
handoff_framesINT80–64How many frames from the END of this chunk to copy into the input folder, ready to guide the next chunk. Snapped to a multiple of 8 because the LTX VAE packs 8 pixel frames into 1 latent frame — an unaligned handoff lands mid-latent and causes a hitch. 0 disables the handoff.
runs_folderSTRINGltx25_one_runsSubfolder of ComfyUI's output directory where full chunk frames are written.
save_all_framesBOOLEANtrueOff = only write the handoff frames. Useful for testing the seam without filling a disk.
clear_chunk_firstBOOLEANtrueWipe this chunk's folder before writing, so re-running a chunk doesn't leave stale frames behind. Only ever touches this one chunk folder.
total_chunksINT11–999How many chunks this run has in total. Set automatically by Render All. When chunk_index reaches this number the run is assembled.
auto_assembleBOOLEANtrueAfter writing the final chunk, join every chunk into <run>/final/ with a cross-dissolve across the overlap. Uses handoff_frames as the overlap width.
write_videoBOOLEANtrueAfter assembling the final chunk, also encode <run>_final.mp4 next to the final/ folder. The PNGs are written either way - the video is a convenience copy, not the master.
video_fpsFLOAT25.001–240Frame rate for the assembled video. Render All sets this from the timeline automatically; only set it by hand if you're queueing chunks yourself.
video_crfINT180–51h264 quality. Lower is better and bigger; 18 is visually near-lossless.
match_to_previousBOOLEANfalseLevel-match this chunk to the previous one. Compares this chunk's first frame against the previous chunk's last handoff frame - the same moment, regenerated - and applies that per-channel correction to every frame. Off for chunk 1, or when you'd rather grade in your editor.
frame_formatCOMBOjpegFormat for the chunk frames, which are intermediates on their way to the mp4. JPEG is about 30x faster to write and several times smaller; measured end to end, q95 4:4:4 lands within 0.2dB of lossless PNG because the h264 encode that follows loses far more than the JPEG does. Handoff frames are ALWAYS PNG regardless - those go back into LTX as guides and must stay clean.
jpeg_qualityINT9570–100Only used when frame_format is jpeg. 95 is visually identical to PNG once the video is encoded. 100 is near-lossless but roughly PNG-sized, so it buys speed rather than space. Chroma is never subsampled.
write_final_framesBOOLEANfalseAlso write the assembled sequence as stills in <run>/final/. Off by default because the mp4 is the deliverable. Forced on if write_video is off, so an assembly always produces something.
seam_modeCOMBOearly_cutUsed by auto_assemble. Where to join two chunks: early_cut switches at the frame the two chunks share (the handoff guide, reproduced), so there is nothing to ghost. early_scurve ramps across seam_blend_frames with an S-curve, which smooths a velocity difference between chunks; early_blend is the straight-line version. dissolve and hard_cut are the old behaviour.
seam_blend_framesINT31–32How many frames the early_scurve / early_blend seam covers. Clamped to handoff_frames. Short is usually right: the chunks only agree near the start of the overlap, so a long blend reaches into frames that have already diverged.
assemble_match_levelsBOOLEANtrueUsed by auto_assemble. Corrects each chunk's brightness to the one before it, carried forward so chunk 3 matches corrected chunk 2. With early_cut the correction is measured from the single frame the two chunks share, which makes it exact. Unrelated to match_to_previous above, which is per-frame and unreliable.
audiooptAUDIOOptional. Wire this chunk's audio in - normally the LTXV Audio VAE Decode hanging off the FIRST pass. Saved next to the chunk's frames and crossfaded into one continuous track when the run is assembled. Leave unconnected for a silent run.

Outputs (3)

NameTypeDescription
imagesIMAGE—
handoff_folderSTRING—
infoSTRING—