图片序列合成视频
Turn your generated frames into an actual video file
- video_path
At the end of every long-video workflow there's the same letdown: you've generated 400 frames, they look great in the preview grid, and they're still just files in a folder. ImageSequenceToVideo is the pack's closer - it runs ffmpeg (via imageio-ffmpeg, which bundles its own ffmpeg binary so you don't need one installed) over a folder of frames and produces an actual .mp4. It's an output node, and in the pack's WanAnimate and SCAIL-2 workflows it's literally the last node in the graph.
Point it at a folder_path containing your sequence (png, jpg, webp, etc., sorted by filename), and it encodes them into a video under your ComfyUI output directory. The output is video_path - a string you can route to a Show Text node or just read in the console.
The inputs that matter
folder_path- where the frames live. Required.fps- the frame rate. The useful default is0, which means auto: it derives the fps so the frames fill the duration of your audio track. That's the "make my dance clip sync to the song" mode. Set it explicitly if you want a fixed rate.audio_source- an audio file to mux in as the soundtrack. The wholefps=0auto-duration logic revolves around this.crf- encoding quality, default 23. Lower is better; the author suggests 18–28. For generated footage you can afford high quality (low CRF) since it's not huge.total_frames- cap how many frames to use (0 = all).start_frame_offset- skip that many frames' worth of the audio's start, useful when the audio has a lead-in.output_path_prefix- subfolder under the output directory, defaultvideo/temp.
How it behaves
The fps=0 + audio logic is the clever bit and worth understanding: it roughly fits frames to the audio length, applies your start offset, then recomputes fps against the remaining audio so the video lands exactly on the end of the track. If the math exceeds 120fps it clamps and drops frames. If the offset overshoots the audio duration it raises an error rather than producing a broken clip. folder_path can be relative to ComfyUI's root or absolute, and the same path resolution applies to audio_source.
Install
Ships in user2318/ComfyUI-CustomNodeKit. ComfyUI Manager: search "CustomNodeKit". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/user2318/ComfyUI-CustomNodeKit.git
cd ComfyUI-CustomNodeKit
pip install -r requirements.txt
then restart. The ffmpeg it needs comes from the imageio-ffmpeg package in that requirements file - it downloads a static ffmpeg binary on first use, no system install required.
The gotcha
The pack's README is explicit that generated sequences should be saved as frames first (via a Save Image node in the segment loop), then this node assembles them - don't expect it to live-feed from the sampler. And the two silent-failure shapes are: a folder with no images raises a clear error (good), but a folder with the right count and wrong sort order encodes a scrambled video (bad, and it won't tell you). Name your frames with zero-padded numbers - frame_001.png through frame_400.png - so lexicographic sorting equals temporal order. That's the single most common reason a "perfect" sequence comes out as a slideshow shuffle.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | 包含图片序列的文件夹路径。Folder path containing the image sequence. | |
| fpsopt | FLOAT | 0.000–120 | 输出视频帧率,设为0则根据音频时长自动推导。Output video frame rate, set to 0 to auto-calculate based on audio duration. |
| total_framesopt | INT | 00–1000000 | 使用的总帧数,设为0则使用文件夹中所有图片。Total frames to use, set to 0 to use all images in the folder. |
| audio_sourceopt | STRING | 音频文件路径,用于为视频添加背景音。Audio file path to add as background to the video. | |
| output_path_prefixopt | STRING | video/temp | 输出文件路径前缀,相对于 ComfyUI 输出目录。Output file path prefix, relative to the ComfyUI output directory. |
| start_frame_offsetopt | INT | 00–1000000 | 从音频的起始偏移帧数,用于跳过音频开头。Frame offset from the start of the audio, used to skip the beginning of the audio. |
| crfopt | INT | 230–51 | 视频编码质量(CRF值),越低质量越高,建议18-28。Video encoding quality (CRF value), lower is better quality, recommended 18-28. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video_path | STRING | — |