ComfyUI Node

Load Image @MW

The file picker that finally sees your subfolders

By billwuhao·Created about a year ago·Updated about a year ago· 21
Load Image @MW
    • IMAGE
    • MASK
    image

    Core ComfyUI's Load Image only shows the flat contents of ComfyUI/input/. Load Image @MW is a drop-in replacement that walks a whole directory tree - subfolders included - and it'll happily point at a folder of your choosing instead of the default input dir. If your photo project is organized into faces/, id_photos/, client_a/, this is the loader that doesn't make you flatten it.

    It's the first node of the PortraitTools pack, and honestly the least glamorous one. But for batch portrait work it saves a lot of "why won't my image show up" grumbling.

    How it works

    The trick is a small config file. The pack ships an extra_help_file.yaml.example; you rename it to extra_help_file.yaml and set one key:

    images_dir: D:\AIGC\ComfyUI-Data\images_input   # Windows
    # images_dir: /mnt/photos/faces                 # Linux
    

    On startup the node reads that path, recursively scans it for PNG/JPG/JPEG/WebP/GIF/BMP/TIFF files, and populates its dropdown. Two implementation details worth knowing: it physically copies each file it finds into ComfyUI's input directory (so the standard file machinery keeps working), and it hashes the source file for its change-detection - edit the file on disk, and the node knows and re-loads. It handles multi-frame images like GIFs too, and returns a proper MASK alongside the IMAGE, just like the core loader.

    The inputs and outputs

    Only one input: image, the dropdown of found files (with an upload button, so you can still just drop a new file in). Outputs are the standard pair:

    • IMAGE - the pixels, as a batch tensor.
    • MASK - the alpha channel as a mask (inverted, so 1 = opaque, matching ComfyUI convention). Feed this to anything that wants a mask, or ignore it.

    Wire the IMAGE into any of this pack's face nodes or just into a normal workflow - it's a straight swap for Load Image.

    How to install

    It ships in billwuhao/ComfyUI_PortraitTools, so:

    cd ComfyUI/custom_nodes
    git clone https://github.com/billwuhao/ComfyUI_PortraitTools.git
    cd ComfyUI_PortraitTools
    pip install -r requirements.txt   # or: ./python_embeded/python.exe -m pip install -r requirements.txt
    

    Dependencies are just huggingface_hub, opencv-python and PyYAML. No models needed for this node - only the face nodes in the pack want the RetinaFace weights.

    Where people get burned

    • The node won't see your files if you skipped the YAML step. If you don't create extra_help_file.yaml, it silently falls back to the default input directory - so nothing breaks, it just quietly does what core Load Image already did.
    • Path format matters. Windows uses backslashes and a drive letter; Linux uses forward slashes from root. Copying a Windows path into the Linux example is the classic "why is it broken" moment.
    • The copying-to-input-dir behavior means your custom folder's files end up duplicated in ComfyUI/input/. Harmless, but it surprises people who assumed a symlink.
    • It's a picker, not a preprocessor - no resizing, no EXIF rotation beyond what PIL does by default. Keep expectations honest.
    Category🎤MW/MW-PortraitTools

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK