Nodes/ComfyUI-CustomNodePacks/Load Images Path (C2C)
ComfyUI Node

Load Images Path (C2C)

Pull an image sequence in by path, decode only what you need

By Code2CollapseΒ·Created 8 months agoΒ·Updated a day agoΒ· 58
Load Images Path (C2C)
    • IMAGE
    • MASK
    • frame_count
    • video
    β—„directoryβ€”β–Ί
    β—„image_load_cap0β–Ί
    β—„skip_first_images0β–Ί
    β—„select_every_nth1β–Ί

    Render farms, Blender, After Effects, most VFX exports - they all hand you a folder of numbered frames rather than a video file. This node is the door for that: type a directory, get images.

    The reason it's worth having instead of the stock image loaders is what it doesn't do. It reads the sequence's header information first and returns a frame_count and a lazy C2C_VIDEO handle; it only decodes pixels if the IMAGE or MASK output is actually linked to something. Trim a graph so a branch isn't consuming frames, and the frames never get decoded. That's a meaningful difference on a 4K EXR sequence where "loading" is the expensive part.

    What you type

    directory is a plain string - an absolute path, a path to a folder of numbered frames, or a sequence pattern like /renders/shot_010.####.exr. Quotes around a pasted path are stripped for you, which is a small kindness if you've ever pasted a Windows path with quotes into a widget. The node validates it before the run and tells you exactly what it couldn't find.

    The three optional widgets are the trim controls, and they behave like the ones in VHS: image_load_cap (0 = everything), skip_first_images, and select_every_nth. Nothing here reads your intent - skip 200 frames of a 180-frame sequence and you get a clear refusal rather than an empty batch, which is the right failure.

    Outputs: IMAGE (the batch), MASK (alpha, if the format carries one), frame_count, and video - a C2C_VIDEO handle that the pack's other video nodes understand, so you can pass the same sequence around without re-decoding it.

    Formats

    Common stills and VFX formats are in the extension list: PNG, JPG, TIFF, EXR, HDR and DPX. Sequence patterns cover ####, @@@@, %04d, $F4 and [1-10] styles - the vocabularies different tools export with. If the frames are 16-bit or EXR, remember that everything downstream is 8-bit float in the usual ComfyUI pipeline, so a "why is my highlight clipping" question often starts here.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git
    

    Or "CustomNodePacks" in ComfyUI Manager, then restart. The C2C video loaders decode through PyAV (the av package), which modern ComfyUI builds already ship. If yours doesn't, the node will say so, and the fix is:

    pip install av
    

    Run that in whatever Python environment ComfyUI itself uses - the portable/embedded install has its own. And as with everything in this pack, don't reinstall the pack's requirements.txt wholesale; opencv-python, scipy and safetensors are the only hard requirements, and ComfyUI supplies torch, torchvision, numpy and Pillow already.

    Where it fits

    The sequence loader is the "upstream" end of a VFX-ish graph: load frames β†’ mask (SAM, or painted in the Image Mask Editor, which will show a C2C sequence loader's frames with no run needed) β†’ inpaint or refine β†’ write back out. It's also the honest way to feed a video model more frames than you generated, by re-loading a rendered sequence instead of chaining whatever the sampler produced.

    One caveat that isn't a bug: sequences are treated as a fixed frame rate, and the node doesn't know yours. For the video-handling side of the pack, an images-only sequence has to be told its rate explicitly, which the video-path loader exposes as sequence_fps. If your pipeline cares about timing rather than just frame order, set it.

    Category🐺 C2C/🧰 Core/Video

    Inputs (4)

    NameTypeDefaultDescription
    directorySTRINGDirectory of sequential images.
    image_load_capoptINT00–1000000Max images; 0 = no cap.
    skip_first_imagesoptINT00–1000000Skip this many images first.
    select_every_nthoptINT11–100000Keep every Nth image.

    Outputs (4)

    NameTypeDescription
    IMAGEIMAGEβ€”
    MASKMASKβ€”
    frame_countINTβ€”
    videoC2C_VIDEOβ€”