Nodes/ComfyUI_Aniportrait/Load Video (Path) 🎥AniPortrait
ComfyUI Node

Load Video (Path) 🎥AniPortrait

Load a Video by Absolute Path and Get Frames, FPS, and Audio in One Shot

By frankchieng·Created 2 years ago·Updated 2 years ago· 59
Load Video (Path) 🎥AniPortrait
    • video
    • frames
    • frame_per_second
    • audio
    â—„videoX://insert/path/here.mp4â–º

    Every AniPortrait pipeline needs a driving video - a clip whose face motion gets copied onto your reference portrait. AniPortrait_LoadVideoPath is the pack's path-based way to pull that video in, and it does the job in one node instead of the usual two or three: it hands you the frames as an IMAGE batch, the frame rate, and the audio track.

    What it's for

    The author of this pack moved to Video Helper Suite (VHS Load Video) as the recommended way in, and that's honestly the better default - it's WYSIWYG, lets you pick files in the UI, and drops straight into the ecosystem. This node is the "give me an absolute filesystem path" alternative: type (or paste) the path to your .mp4, and it validates that the file exists and has a supported extension before doing anything. Some people prefer it because it never touches the file picker, and it plays nicer when you're scripting or reusing the same clip.

    How it works

    Under the hood it's PyAV (av==11.0.0, pinned in requirements.txt) decoding the whole video into a list of PIL frames, plus a read of the stream's average frame rate. It's a simple loader - no caching, no frame-limit widget - which means a long video becomes a big IMAGE batch sitting in memory. Keep clips short for your own sanity.

    Inputs and outputs

    Just one required input: video, a STRING defaulting to X://insert/path/here.mp4. Type your actual path there. If it doesn't resolve, the node raises a clear "video is not a valid path" error rather than silently failing.

    Four outputs, and you'll use at least two:

    • frames (IMAGE) - every decoded frame. This feeds AniPortrait_Video_Gen_Pose in the self-driven pose workflow, or the images input of AniPortrait_Audio2Video in the face-reenactment workflow.
    • frame_per_second - the clip's FPS, wired into AniPortrait_Audio2Video's fps input for reenactment (where it's used to decide whether to drop every other frame of a 60fps source).
    • video - the path itself, passed through as the custom AniPortrait_Video type. Mostly there for chaining to other nodes that want the path.
    • audio - the audio track handed over as an AniPortrait_Audio path (an intermediate .aac in your ComfyUI output directory). The README notes these intermediate files get cleaned up as they're consumed.

    Gotchas

    Square input, again. The README's warning applies to the whole pack: upload video that's roughly 512×512, or the landmark extraction gets weird - a landscape 1920×1080 clip will be squeezed into whatever the pose nodes resize to. And this node gives you the frames, but it won't crop a face for you: pick a clip where the face is centered and visible, or your landmark map will be off.

    Install

    It ships with the pack, so install the pack once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/frankchieng/ComfyUI_Aniportrait
    cd ComfyUI_Aniportrait && pip install -r requirements.txt
    

    or search "ComfyUI_Aniportrait" in ComfyUI Manager. Restart ComfyUI after. The heavy lifting (models for rendering) happens downstream - this node itself is just a loader, so it's one of the least intimidating places to start if you're poking at this pack.

    CategoryAniPortrait 🎥Video

    Inputs (1)

    NameTypeDefaultDescription
    videoSTRINGX://insert/path/here.mp4—

    Outputs (4)

    NameTypeDescription
    videoAniPortrait_Video—
    framesIMAGE—
    frame_per_secondFrame_per_second—
    audioAniPortrait_Audio—