Nodes/ComfyUI-nhknodes/πŸ“Έ Load Image Series (nhk)
ComfyUI Node

πŸ“Έ Load Image Series (nhk)

A whole folder of images, loaded one at a time, on autopilot

By EnashkaΒ·Created 12 months agoΒ·Updated 28 days agoΒ· 23
πŸ“Έ Load Image Series (nhk)
    • image
    • filename
    • current_index
    • total_images
    β—„modeβ–Ύβ–Ί
    β—„pathβ–Ί
    β—„pattern*β–Ί
    β—„index0β–Ί
    β—„seed0β–Ί
    β—„labelSeries001β–Ί
    β—„resetfalseβ–Ί

    The stock LoadImage is fine for one picture, but it's a dead end the moment you want to run img2img over a folder of 200 images and walk away. LoadImageSeries is the version that does that folder run for you: point it at a directory, and every execution it hands you the next image - automatically, in order, wrapping around at the end. Set it, wire it into your img2img pipeline, and let the queue chew through the whole folder.

    This is part of the nhknodes image family from the same author, and it shares its DNA with the pack's other series loaders (Load2x2GridSeries, Load3x3GridSeries, and the prompt-attaching variant). The series concept is the pack's strongest idea, and LoadImageSeries is the plain, no-frills version of it.

    How it works

    On each run the node globs the folder (matching your pattern), sorts the file list, and loads one file. It keeps an in-memory counter per label, so it remembers where it is between executions - that's what makes the auto-advance work even when nothing else in your workflow changes. Every run it loads the current file, bumps the counter, and wraps around to the first image when it hits the end.

    Two modes:

    • single_image - the default. Loads by index and auto-advances. The index input sets where the sequence starts; the reset flag bounces it back to 0. (The tooltip suggests control_after_generate=increment on the index widget as an alternative pattern, but the label counter is doing the real advancing here - index is the starting point.)
    • random - picks a random file, deterministically seeded. Same seed = same image, which is handy for reproducible testing.

    Inputs and outputs that matter

    • path - the folder. Required; missing path returns a black 512Γ—512 placeholder with an empty filename, so check it if you're getting black frames.
    • pattern - a glob filter. * is everything; *.png for one type; **/*.png even recurses into subfolders.
    • label - this one's easy to overlook. Because counters are keyed by label, giving each loader a unique label lets you run multiple independent sequences side by side without them stomping on each other.

    Outputs are image (RGB tensor, EXIF-transposed so phone photos load right-side up), filename (base name), current_index, and total_images - the last two are handy for a text-display progress readout. It's marked as an output node, so it'll show the loaded image in the UI.

    Installing

    Same as every node in this pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Enashka/ComfyUI-nhknodes
    

    or via ComfyUI Manager (search "NHK Nodes"), then restart ComfyUI. No models to download, no extra Python deps beyond what ComfyUI already has. It'll appear under nhk/image.

    Where people get burned

    • "It's loading the same image every time." You changed the folder but not the label - the counter is still parked where the old folder left off, and it wraps/advances from there. Give it a fresh label (or flip reset) when you point it at new files.
    • "My frames come back black." Path doesn't exist or the pattern matched nothing. Check the console - it prints exactly what went wrong.
    • "It skipped my sequence." Files are sorted as absolute paths, so filename ordering matters. frame_10.png sorts before frame_2.png - pad your numbers if you care about strict order.

    The one real limitation: counters are in-memory, so reloading or restarting resets everything. That's fine for a session-long batch run, which is exactly what this node is for. For frame-by-frame img2img, style transfer over a folder, or feeding frames into a video pipeline, LoadImageSeries is the least-effort way to get there.

    Categorynhk/image

    Inputs (7)

    NameTypeDefaultDescription
    modeCOMBOsingle_image: load by index (use with control_after_generate=increment for sequences), random: load random image by seed
    pathSTRINGDirectory path containing images to load
    patternSTRING*Glob pattern to filter files (e.g., '*.png', 'img_*.jpg', '**/*.png' for recursive)
    indexINT0Starting index for single_image mode (auto-increments with control_after_generate)
    seedINT0Seed for random mode (same seed = same random image)
    labelSTRINGSeries001Unique identifier for tracking this sequence independently from others
    resetBOOLEANfalseReset counter back to index 0

    Outputs (4)

    NameTypeDescription
    imageIMAGEβ€”
    filenameSTRINGβ€”
    current_indexINTβ€”
    total_imagesINTβ€”