Nodes/ComfyUI-KYNode/KY_FFmpeg: Image Sequence to Video
ComfyUI Node

KY_FFmpeg: Image Sequence to Video

Image Sequence to Video — full encoder control for frames already on disk

By yorkane·Created 2 years ago·Updated 6 months ago· 10
KY_FFmpeg: Image Sequence to Video
    • video_path
    input_dirC:/path/to/input/frames
    output_pathC:/path/to/output.mp4
    input_fps30
    encoder_namelibx264
    quality_typeCRF (Constant Rate Factor)
    quality_value18
    colorspace_choiceBT.709 (HD)
    pix_fmtyuv420p
    audio_in_path
    audio_codecaac
    audio_shortesttrue

    Where KY_SaveVideo takes an IMAGE tensor batch straight out of your ComfyUI graph and writes a video, this node starts from the other end: frames that are already sitting on disk as individual image files. Point it at a folder, and it runs a proper ffmpeg encode with the kind of controls you'd expect from actually driving ffmpeg by hand - codec choice, rate-control mode, colorspace, pixel format - rather than a couple of simplified sliders.

    When you'd reach for this instead of KY_SaveVideo

    If your frames came from this pack's own KY_FFmpegVideoToImages (extracting frames from a source video), from an external tool, or from a batch render you already saved to a folder with KY_SaveImageSequence, they're on disk, not sitting in VRAM as a tensor. Re-loading them all back into ComfyUI as an IMAGE batch just to hand them to KY_SaveVideo wastes memory for no reason - this node skips that round-trip and lets ffmpeg read the files directly.

    Inputs that matter

    • input_dir / output_path - the source frame folder and the destination video file. No defaults worth keeping; the schema ships Windows-style placeholder paths (C:/path/to/...) that make it obvious you're expected to override both.
    • input_fps - a long dropdown of standard rates from 2 up to 59.94+, matching the source frame rate your images were extracted or rendered at.
    • encoder_name - libx264 (default, safe, CPU, broadly compatible), h264_nvenc/hevc_nvenc (GPU-accelerated, but only work if ffmpeg was built with NVENC support and you actually have an NVIDIA GPU available to it), libx265, prores_ks, libvpx-vp9.
    • quality_type - CRF, QP, or Bitrate. This changes what quality_value actually means, which is the trap worth flagging up front (see Common issues).
    • colorspace_choice (BT.709 HD / BT.2020 UHD-HDR / Unspecified) and pix_fmt - for matching whatever your downstream player or editor expects; leave at the HD default unless you know you need otherwise.

    Optionally, audio_in_path lets you mux an audio track in alongside the video, with audio_codec (aac/copy) and audio_shortest (default true - trims the output to the shorter of the video or audio stream, rather than padding or looping to match).

    One output: video_path, the finished file's location. It's marked an output node, so it writes to disk as its side effect.

    Installing it

    ComfyUI Manager: search ComfyUI-KYNode, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yorkane/ComfyUI-KYNode
    

    Restart ComfyUI. Like the rest of the KY_FFmpeg* family, this needs ffmpeg itself installed and reachable on your system PATH - the pack's own README doesn't call this dependency out explicitly, so it's easy to miss until the node fails on first use. Run ffmpeg -version from wherever ComfyUI's process actually runs to confirm before you troubleshoot anything else.

    Common issues

    quality_value means a genuinely different thing depending on quality_type. A value of 18 under CRF is a well-known "visually lossless" x264 setting; that same 18 under QP or Bitrate mode is a completely different number with a completely different effect. Check which mode you're in before assuming a familiar CRF number will behave the same way.

    h264_nvenc/hevc_nvenc will fail - often with a cryptic ffmpeg error rather than a clear "no GPU found" message - if your ffmpeg build wasn't compiled with NVENC support, or if there's no compatible NVIDIA GPU visible to the process. Run ffmpeg -encoders | grep nvenc first if you're not sure your setup actually supports it; if it comes back empty, stick with libx264.

    audio_shortest defaulting to true means a longer audio track than your video gets silently cut short, not looped or padded - if your final video's audio ends early and you didn't expect that, this is the setting to check.

    And since the node writes to a real file path, make sure the destination directory in output_path actually exists - the schema doesn't document whether it auto-creates missing folders, so pre-creating the destination is the safe move.

    CategoryVideo/KY_FFmpeg

    Inputs (11)

    NameTypeDefaultDescription
    input_dirSTRINGC:/path/to/input/frames
    output_pathSTRINGC:/path/to/output.mp4
    input_fpsCOMBO3014 options: 2, 3, 6, 12, 15, 23.976, +8
    encoder_nameCOMBOlibx2646 options: libx264, h264_nvenc, libx265, hevc_nvenc, prores_ks, libvpx-vp9
    quality_typeCOMBOCRF (Constant Rate Factor)3 options: CRF (Constant Rate Factor), QP (Quantization Parameter), Bitrate (k/M)
    quality_valueCOMBO1824 options: 12, 13, 14, 15, 16, 17, +18
    colorspace_choiceCOMBOBT.709 (HD)3 options: BT.709 (HD), BT.2020 (UHD/HDR), Unspecified
    pix_fmtCOMBOyuv420p7 options: yuv420p, yuv420p10le, yuv444p, yuv444p10le, nv12, p010le, +1
    audio_in_pathoptSTRING
    audio_codecoptCOMBOaac2 options: aac, copy
    audio_shortestoptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    video_pathSTRING