Nodes/VRGameDevGirl Video Enhancement Nodes/Image From Folder (Index For Remake Mode)
ComfyUI Node

Image From Folder (Index For Remake Mode)

Re-load the exact reference frame by matching the filename number, not the sort order

By vrgamegirl19·Created about a year ago·Updated about 22 hours ago· 682
Image From Folder (Index For Remake Mode)
    • image
    folder_path
    index0

    This is the stricter sibling of IndexedImageFromFolder. Where the regular node sorts your folder and picks by position, this one matches the filename number directly: index 0 loads the file whose name contains 1, index 1 loads the one containing 2, and so on. It's built for the pack's "remake" mode - when you've already generated a video and want to re-render one specific scene, you need the exact same reference frame it used the first time, not "whatever image happens to sort into slot N today."

    So the load rule is literally target_number = index + 1, matched against the first number in each filename. If your files are images_00001_.png, images_00002_.png, etc., then index 0 finds images_00001_.png and there's no ambiguity. That's why this node exists: to survive re-runs where a folder's file list might have changed, by keying on the number the filenames already carry.

    Inputs and outputs

    Two inputs, both required: folder_path and index. No random_after_end, no modulo loop - this variant is deliberately dumb and deterministic, which is exactly what a re-render path needs. Output is a single image tensor.

    The error behavior is what you'd hope for in a remake tool: missing folder raises, no images raises, and - the important one - if index + 1 doesn't match any filename, you get a clean error rather than a silently wrong frame. A remake that silently loads the wrong reference would be worse than no remake at all.

    When to reach for which

    Use IndexedImageFromFolder when you want position-based loading with looping and random mode. Use this one when the filename itself is the source of truth - the remake/redo path, or any workflow where your output files carry scene numbers in their names and you want the reference to follow them. If your files aren't numbered (random names, no digits), this node can't match anything and you want the other one.

    Install

    Same pack as everything here: ComfyUI Manager → search "vrgamedev", or git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl into ComfyUI/custom_nodes, restart. No models, no extra deps beyond the pack's kornia, librosa, imageio. It's a 30-line utility and behaves like one - the whole job is "find the numbered file, load it, hand it over."

    Categoryimage

    Inputs (2)

    NameTypeDefaultDescription
    folder_pathSTRING
    indexINT0

    Outputs (1)

    NameTypeDescription
    imageIMAGE