Nodes/was-node-suite-comfyui/Load Image Batch
ComfyUI Node Runs on cloud

Load Image Batch

Step through a folder one image per run

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Load Image Batch

      The core "Load Image" node makes you pick one file from a dropdown. That's fine until you've got a folder of 200 frames or reference shots and you want to run the same graph over every one of them without babysitting a dropdown. That's the whole reason Load Image Batch exists: point it at a directory and it hands you the next image each time you queue a prompt.

      It has two modes, and the mode is the thing people misread. In incremental mode it walks the folder one file per run - queue once, get image 1; queue again, get image 2 - which is what you want for batch-processing a set. In single image mode it just grabs one specific image out of that folder by index, so it behaves like a fancier Load Image. Most people who google this node wanted the first mode and got confused by the second.

      How it works

      The node keeps a little cursor for the folder you gave it. Each queued run advances the cursor and loads the file at that position, wrapping back to the start when it runs off the end. The README calls out the one gotcha that saves you a headache: it resets its place whenever you change the path or the pattern. So if you were 40 images deep and you tweak the folder, don't be surprised when it starts over at zero.

      The pattern field is a glob, which is more powerful than it looks. *.jpg selects only JPEGs in the folder. **/* recurses into subdirectories and grabs everything. That recursion is the trick most people miss - if your images are nested one level down, a plain * finds nothing and you'll swear the node is broken.

      Inputs and outputs that matter

      Three things do the real work here:

      • path - the folder to read from, an absolute path on the machine running ComfyUI.
      • mode - incremental (walk the folder) vs single image (fetch one by index). Pick deliberately.
      • pattern - the glob. Use *.png to filter by type, **/* to recurse.

      The output is a standard IMAGE, so it wires straight into a VAE Encode, a preprocessor, an upscaler, whatever your graph does next. It also hands back the loaded filename as text, which is handy if you want to pass the original name through to a save node.

      How to install it

      Easiest path is ComfyUI Manager: open the manager, search was-node-suite-comfyui, install, restart. Manually it's the usual dance:

      cd ComfyUI/custom_nodes
      git clone https://github.com/WASasquatch/was-node-suite-comfyui
      

      then install the pack's requirements (python_embeded/python.exe -s -m pip install -r was-node-suite-comfyui/requirements.txt on a portable build, or pip install -r requirements.txt in your venv) and restart. This one node needs nothing exotic - it's just reading files off disk.

      Common issues & troubleshooting

      It loads the same image every time. You're in single-image mode, or you're expecting the counter to advance on its own without re-queuing. Incremental only moves when you queue a new prompt. If you want to actually process a whole folder, queue with a batch count, or set it to run the count you need.

      The pattern matches nothing. Your files are in a subfolder and you used a non-recursive glob. Switch to **/* (or **/*.png) and restart the run.

      It restarted counting from the beginning. You edited the path or pattern mid-batch. That's by design - the cursor is tied to the exact path+pattern string, so any change resets it.

      "Import Failed" on the whole pack after a ComfyUI update. This is the classic WAS Node Suite failure, not specific to this node. The suite pins/downgrades a few packages for compatibility with older modules, and a ComfyUI update that bumps them can break the import on startup. The fix is re-running the pack's requirements.txt against the correct venv - activate your ComfyUI environment first, or use the pack's install.bat which finds the venv for you. Worth knowing going in: WAS Node Suite has been in maintenance-only mode since late 2023, so it lags behind current ComfyUI more than actively-developed packs do.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs