Nodes/MLSuite/Image Loader
ComfyUI Node

Image Loader

The Load Image node that browses your folders for you

By marcolopezs·Created 25 days ago·Updated 25 days ago· 1
Image Loader
    • IMAGE
    ◄image▾►
    ◄folder▾►
    ◄start_index0►
    ◄sort_method▾►
    ◄image_url►
    ◄manual_path►
    ◄selected_image►

    ComfyUI's stock Load Image reads from exactly one place: ComfyUI/input/. Everything else - the dataset folder three drives away, the pile of outputs you want to cull and re-upscale, the image URL someone dropped in chat - means copying files in by hand or symlinking. MLSuite's Image Loader is one node that handles all of it, with a gallery browser bolted on top.

    It's the whole pack: v0.1.1, MIT, one Python file, and new enough that there's no community folklore yet - so what follows comes from the shipped code, not the README.

    How it decides which image to load

    Here's the priority chain, and knowing it saves you the classic "wrong picture" half hour:

    1. image_url - if you typed anything in the URL field, it wins. Period.
    2. image - the upload/input folder dropdown. If it's set to anything other than (none), this wins over the gallery.
    3. selected_image - whatever you clicked in the gallery browser.
    4. Rotation - if all of the above are empty, it walks the folder (recursively, via os.walk) and returns the image at the current index.

    For rotation it keeps a per-folder counter in memory, sorts the files by sort_method, and returns index % total - so when you hit the end it wraps to the start. After each run the frontend writes the next index back into the start_index widget, so one click of Queue is one image - no queue-count workaround needed. The node also returns IS_CHANGED as float("NaN") - the standard ComfyUI idiom for "never cache me" - which is what lets the counter advance on a re-queue with identical settings. The trade-off: this node never hits the cache, so the graph behind it re-executes every queue. Here that's the point.

    It's the same one-image-per-queue folder walk as WAS Node Suite's "Load Image Batch", with a browser attached.

    The inputs you'll actually touch

    • folder - only three choices: input, output, temp. Want somewhere else? Use manual_path.
    • sort_method - seven options: alphabetical, numerical, datetime and random, each in ASC/DESC. Numerical sorts by the first number it finds in the filename, not by natural order, so 2024_cat.png sorts under 2024 and files with no digit at all sort last.
    • manual_path - any absolute folder path. On Windows, "Copy as path" gives you a quoted string; the node strips the quotes for you. This is the field that makes the node useful for a real dataset on your own disk.
    • start_index - where rotation begins. Set it by hand and the counter restarts there.
    • image_url / selected_image - optional, and both are set by the UI buttons rather than by typing. Browse gallery, Open folder and Clear selection appear under the node.

    The only output is IMAGE - ready for a VAE Encode, a ControlNet preprocessor, an upscaler, IPAdapter, whatever eats pixels. Two things to know: there's no MASK output (core Load Image gives you one, this doesn't), and everything is converted to RGB, so PNG alpha is dropped. Use a different loader for inpainting or transparent assets.

    Installing it

    ComfyUI Manager: search MLSuite and install, then restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/marcolopezs/ComfyUI_MLSuite
    pip install -r ComfyUI_MLSuite/requirements.txt
    

    That requirements file is one line: Pillow. No torch pinning, no CUDA wheels, no model downloads - nothing that can collide with your existing environment, and given how much ComfyUI troubleshooting is dependency conflict, that's the whole story. The web/ folder ships the JavaScript for the gallery, so if you see the node but no browse button, your browser cached the old frontend - hard refresh.

    Where people get burned

    • The URL field is sandboxed on purpose. It only accepts http/https, refuses any host resolving to a private, loopback, link-local or reserved address, and caps the download at 64 MB. So http://192.168.1.50/photo.jpg - your own NAS, your own web server - will be rejected as an SSRF guard. For local files, manual_path is the tool; the URL field is for the public internet.
    • The upload dropdown outranks the gallery. Pick something in the gallery, forget there's still a file selected up top, and you'll get the dropdown image. Set image to (none) or hit Clear selection.
    • Rotation covers the whole tree. A nested dataset becomes one flat sequence, re-scanned on every run - fine for a few hundred images, noticeable on tens of thousands.
    • Random mode doesn't walk the folder. It reshuffles each run and holds the index, so you get a different image per queue, not a full pass.
    • Open folder fails on a headless box. No xdg-open, no file manager, no dice - it'll just tell you so. Everything else works fine over a web session.
    • Formats: jpg/jpeg/png/webp/bmp/tiff/tif/gif, plus .jxl if you've separately installed pillow_jxl. No HEIC or AVIF, and a GIF gives you its first frame.
    CategoryMLSuite/image

    Inputs (7)

    NameTypeDefaultDescription
    imageCOMBO2 options: (none), example.png
    folderCOMBO3 options: input, output, temp
    start_indexINT00–18446744073709550000—
    sort_methodCOMBO7 options: Alphabetical (ASC), Alphabetical (DESC), Numerical (ASC), Numerical (DESC), Datetime (ASC), Datetime (DESC), +1
    image_urloptSTRING—
    manual_pathoptSTRING—
    selected_imageoptSTRING—

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE—