Nodes/ComfyUI_AIIA/AIIA Video Combine (Images or Dir)
ComfyUI Node

AIIA Video Combine (Images or Dir)

The node that actually turns your 1,500 frames into a video

By havvk·Created about a year ago·Updated 6 months ago· 13
AIIA Video Combine (Images or Dir)
  • images
  • audio_tensor
  • video_filepath
frame_rate25.0
output_filename_prefixAIIA_Video
format
pix_fmt_h264yuv420p
h264_profilehigh
h264_level4.1
pix_fmt_h265yuv420p10le
h265_profilemain10
crf23
codec_presetmedium
save_outputtrue
cleanup_framesfalse
frames_directory
filename_patternframe_%08d.png
audio_file_path
audio_codecauto
audio_bitrateauto
custom_ffmpeg_args

Every long-form talking-head pipeline in the AIIA pack ends at this node. Ditto spits out frames, Float and PersonaLive ToDisk nodes write frame directories, Body Sway nudges them - and AIIA Video Combine is what finally turns all of it into an MP4 you can play. It's also the most configurable single node in the pack, which cuts both ways: the defaults are sane, but it rewards a two-minute read.

It accepts frames two ways. Feed it an IMAGE tensor from an in-memory node and it works fast for short clips. Feed it a frames_directory (STRING path) and it streams from disk in batches - the OOM-safe path that's the whole point of the pack's ToDisk design. You can mux audio in from either a tensor or a file, and if you're coming out of a disk pipeline the natural wiring is frames dir + generated audio tensor → MP4.

How it works

It shells out to system ffmpeg (with ffprobe for bitrate auto-detection), looking first inside your conda env, then on the system PATH. Encoding is defined by JSON format presets - video/h264 and video/h265 ship with the pack, and the JSON format lets you add your own without touching code. The H.264 preset maps directly to libx264 args: -crf, -preset, -profile:v, -level, and so on, with the extra widgets (pix_fmt, profile, level) you see in the node generated dynamically from the preset file.

The inputs that matter

Most people touch five:

  • frame_rate - 25 is the default and is right for most talking-head models (Ditto trains at 25).
  • format - video/h264 or video/h265. H.264 if you care about compatibility; H.265 if you want smaller files at the same quality.
  • crf - 23 default. Lower = better quality, bigger file. 18–23 is the sensible band.
  • codec_preset - medium default. Use ultrafast/veryfast while iterating, drop back to slow for the final render.
  • output_filename_prefix - becomes the output filename (with a timestamp suffix) in ComfyUI's output/ folder.

The detail fields (pix_fmt, profile, level for each codec) - the defaults are correct: yuv420p/high/4.1 for H.264, yuv420p10le/main10 for H.265. Leave them alone until you have a reason not to.

Audio comes from audio_tensor or audio_file_path, with audio_codec and audio_bitrate defaulting to auto (the preset provides codec, and ffprobe reads the source bitrate). cleanup_frames (default off) is the new-ish one: turn it on and a successful combine deletes the input frames directory - but only if it contains the .aiia_temp marker file the pack's own ToDisk nodes write. Your hand-built frame folders never get touched, and a failed combine deletes nothing.

Output: video_filepath (STRING). It's an output node, so attach a text preview to see the path.

Install

Pack install plus one real system dependency - FFmpeg:

cd ComfyUI/custom_nodes
git clone https://github.com/havvk/ComfyUI_AIIA.git

Then make sure ffmpeg and ffprobe are on your PATH (README is explicit: ffmpeg -version and ffprobe -version should both work from a terminal). On Windows, download the binaries and add the bin folder to PATH.

Common issues

  • "FFmpeg not found." The classic. It searches your conda env first, then PATH - if neither has it, everything fails at the encode step. Install FFmpeg and restart.
  • Nothing on disk but no error. Check save_output (default on) - flip it off and the node runs the encode without keeping the file.
  • You enabled cleanup_frames and got spooked. The .aiia_temp marker gate means your own directories are safe; only AIIA-generated temp frame dirs get deleted, and only on success.
  • Audio/visual drift. If you're combining a disk pipeline, make sure the audio tensor's sample rate matches what the TTS produced - the pack's audio nodes output float32 at consistent rates, but third-party sources can vary.
CategoryAIIA/视频

Inputs (20)

NameTypeDefaultDescription
frame_rateFLOAT25.00.01–1000
output_filename_prefixSTRINGAIIA_Video
formatCOMBO2 options: video/h264, video/h265
pix_fmt_h264COMBOyuv420p像素格式。yuv420p 兼容性最好。
h264_profileCOMBOhighH.264 Profile. 'high' 通常是个不错的选择。
h264_levelCOMBO4.1H.264 Level. 影响分辨率和帧率上限。
pix_fmt_h265COMBOyuv420p10le像素格式。H.265 常用于 10-bit (p10le)。
h265_profileCOMBOmain10H.265 Profile. 'main10' 支持 10-bit。
crfINT230–51
codec_presetCOMBOmedium10 options: ultrafast, superfast, veryfast, faster, fast, medium, +4
save_outputBOOLEANtrue
cleanup_framesBOOLEANfalse
imagesoptIMAGE
frames_directoryoptSTRING
filename_patternoptSTRINGframe_%08d.png
audio_tensoroptAUDIO
audio_file_pathoptSTRING
audio_codecoptCOMBOauto5 options: auto, aac, libmp3lame, libopus, copy
audio_bitrateoptCOMBOauto7 options: auto, 96k, 128k, 192k, 256k, 320k, +1
custom_ffmpeg_argsoptSTRING

Outputs (1)

NameTypeDescription
video_filepathSTRING