Nodes/comfyui-pertineo-vfx/Pertineo Load Image Sequence
ComfyUI Node

Pertineo Load Image Sequence

Load Image Won't Touch Your 16-Bit PNGs. Load the Whole Sequence Instead.

By Pertineo·Created 8 days ago·Updated 8 days ago· 0
Pertineo Load Image Sequence
    • image
    • mask
    • first_frame
    • frame_count
    • folder
    ◄folder►
    ◄first_frame-1►
    ◄last_frame-1►
    ◄mask_channel▾►
    ◄exr_to_srgbtrue►
    ◄missing_frames▾►
    ◄show_previewtrue►

    ComfyUI's stock Load Image node is built for one picture with a name like Untitled.png. It has no concept of frame numbers, it hands you an 8-bit-ish tensor, and it isn't going to read your EXR. The moment you're working on a rendered shot - frames named shot_v01.1001.png through 1121, 16-bit, maybe scene-linear EXR - you've left its design envelope.

    Pertineo Load Image Sequence is the loader for that situation: point it at a folder, give it a range in real frame numbers, and get the batch plus a mask pulled from any channel.

    Why this matters more than it sounds

    Most of the ComfyUI ecosystem is 8-bit sRGB travelling through nodes that assume 0–1 values. That's fine for generation. It's wrong for compositing: an 8-bit matte has 256 steps and gradients that band on the way into a comp, and scene-linear EXR handed to a node that thinks it's sRGB will look wrong in both directions. This node is the front door of the pro-pipeline path - full precision in, and a raw (never colour-converted) channel out for the matte.

    How it works

    It indexes the folder by parsing frame numbers out of file names, so name.1001.png and name.1001.exr both map to frame 1001. Then it loads the inclusive range you asked for and stacks those frames into an IMAGE batch. Frame numbers are preserved, not reindexed - ask for 1001–1121 and that's 121 frames ending on 1121.

    EXRs are scene-linear, so with exr_to_srgb on it converts the IMAGE output to sRGB, which is what ViTMatte and most ComfyUI nodes expect. The MASK output is never converted. It also caches sensibly: it only reloads when the files on disk change, so you're not re-reading a 4K sequence every queue. After loading, it renders the middle frame of the range as a small preview straight onto the node.

    The inputs

    • folder - multiline, and more forgiving than it looks. Paste the folder, paste the path of any one frame (right-click a file, copy, paste - that works), a file:// URI, or a pattern like name.####.png, name.%04d.png, name.$F4.exr. It resolves all of them to the folder.
    • first_frame / last_frame - real frame numbers, -1 meaning "whichever end of the sequence". Default both to -1 the first time you set up a shot; you can always look at what it found.
    • mask_channel - red, green, blue, alpha, or luminance, read raw from the file. For a matte rendered as grey RGB, red or luminance both give you the same thing. alpha requires the files to actually have an alpha channel.
    • exr_to_srgb - leave on unless you're deliberately carrying linear through to nodes that want it. No effect on PNG/TIFF.
    • missing_frames - error, hold previous, or skip. This is the one to think about.
    • show_preview - the middle-frame thumbnail. Turn it off on huge sequences if you want to save a second.

    Outputs: image, mask, first_frame, frame_count, and folder. That last one looks unremarkable and is the nicest part of the pack - wire it into Pertineo Save Matte Sequence's source_folder and your mattes land in a sibling folder with matching names, no path typing at all.

    Install

    ComfyUI Manager → Pertineo VFX. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/pertineo/comfyui-pertineo-vfx
    pip install -r comfyui-pertineo-vfx/requirements.txt
    

    OpenEXR>=3.2 is the one dependency, and this node is the reason it exists. If that install fails you'll get a console line saying the image_io group couldn't load - the matting nodes still come up, because the pack imports each group separately.

    Where people get burned

    missing_frames = skip silently desyncs you. If your plate is missing frame 1043 and your matte isn't, skip gives you a shorter batch that no longer lines up with the other sequence. error is the boring correct default: it stops and tells you, and your plate and matte stay in sync.

    RAM, not VRAM, is the limit. A batch of 4K frames is roughly 100 MB per frame in memory. A couple of hundred frames will happily eat your system RAM before the GPU notices anything. For long shots, don't load the sequence into a batch at all - use Pertineo ViTMatte Tiled (Sequence), which reads folder-to-folder frame by frame.

    Paths are checked at queue time, not at type time. A missing folder or a folder with no numbered images is reported on the node before anything computes, which is good - but it means a graph that "looked fine" can refuse to queue, and the message is on the node itself, not in the console.

    Loading 16-bit and expecting it to look right in a preview. Complain to ComfyUI, not the node: previews are 8-bit. The data is fine; the thumbnail is a thumbnail.

    CategoryPertineo/IO

    Inputs (7)

    NameTypeDefaultDescription
    folderSTRINGFolder with the numbered image sequence. You can also paste the path of any frame of the sequence or a pattern like name.####.png.
    first_frameINT-1-1–10000000First frame number to load, as in the file names (e.g. 1001). -1 = first frame of the sequence.
    last_frameINT-1-1–10000000Last frame number to load, as in the file names. -1 = last frame of the sequence.
    mask_channelCOMBOChannel for the mask output, read raw from the file (no color conversion). For a matte rendered as grey RGB use red or luminance; 'alpha' needs an alpha channel in the files.
    exr_to_srgbBOOLEANtrueEXR files are scene-linear. On = convert the IMAGE output to sRGB (what most ComfyUI nodes and ViTMatte expect). Has no effect on PNG / TIFF and never on the mask output.
    missing_framesCOMBOIf a frame inside the range is missing: stop with an error (safest, keeps plate and matte in sync), repeat the previous frame, or skip it.
    show_previewBOOLEANtrueAfter loading, show the middle frame of the range as a small preview on the node.

    Outputs (5)

    NameTypeDescription
    imageIMAGE—
    maskMASK—
    first_frameINT—
    frame_countINT—
    folderSTRING—