Nodes/ComfyUI-WJNodes/Load Image Adv
ComfyUI Node

Load Image Adv

The ComfyUI loader that hands back the file path

By 807502278·Created 2 years ago·Updated 11 months ago· 21
Load Image Adv
    • image
    • mask
    • path
    image
    invert_maskfalse

    The stock ComfyUI "Load Image" node is fine right up until you need two things it doesn't give you: the actual file path on disk, and a mask that isn't inverted the way you expected. Load Image Adv is a drop-in replacement that fixes both, and it's one of the more genuinely useful nodes buried in ComfyUI-WJNodes, a personal grab-bag pack from a GitHub user who goes by nothing but a number (807502278) and describes the whole repo as "a simple node package that I use myself."

    What it does

    Functionally it's the same job as the built-in loader - pick a file from ComfyUI's input folder - but it does two extra things. First, it hunts through subfolders too, so if you've organized your inputs into project folders instead of dumping everything flat, this node still finds them. Second, and this is the useful bit, it outputs the file's path as a string alongside the image and mask. The stock loader throws that information away the moment it reads the file; this one keeps it.

    It also reads a wider set of formats than the default - jpg, png, jpeg, webp, tiff, bmp, gif, ico, and even svg - where the built-in loader is happiest with png/jpg/webp and can choke on the rest.

    Inputs and outputs that matter

    There are only two inputs, so there's nothing to overthink:

    • image - the file picker dropdown, same as the standard loader, just scanning subfolders too.
    • invert_mask - a boolean, off by default. Flip it if the alpha channel comes out backwards for what you're trying to do (a common gotcha: ComfyUI's mask convention treats white as "selected," and not every image's alpha channel agrees with that by default).

    Three outputs come back: image and mask work exactly like the built-in node and plug into whatever you'd normally wire an image/mask into. path is the string that makes this node worth using - wire it into anything downstream that wants to know where the source file lives: a filename-prefix on a save node so your output matches your input name, a log/preview text box, or another WJNode utility like Split_Path if you want to pull just the filename or extension out of it.

    Installing it

    Two ways, same result. Easiest is ComfyUI Manager - search for "ComfyUI-WJNodes" and install. If you'd rather do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/807502278/ComfyUI-WJNodes.git
    

    Restart ComfyUI after either method. The README says most Python dependencies are already covered by a normal ComfyUI install, but there's an optional pip install -r requirements.txt inside the cloned folder if something's missing. Load Image Adv itself doesn't need any external models or extra dependencies - it's pure Python file-handling, so if the node loads at all, it'll work.

    Where you'll get stuck

    This is a low-traffic personal pack - there's no forum thread or wiki page to fall back on if something breaks, so the README genuinely is the whole manual. A couple of things worth knowing going in:

    If the node doesn't show up in the menu after install, check ComfyUI's console output on startup for an import error rather than assuming the install silently worked - that's the standard first move for any custom node that goes missing, WJNodes included.

    The path output is exactly whatever ComfyUI resolves internally, which for files loaded from the input folder is typically an absolute path on the machine running the workflow. If you're chaining that path into something that expects a relative path (or vice versa), that mismatch is on you to reconcile - the node doesn't normalize it.

    And remember custom nodes in ComfyUI run as plain Python with full filesystem access - there's no sandbox around what a node can read or do once it's installed, which is generally true of any third-party node pack, not a WJNodes-specific concern, but worth keeping in the back of your mind before installing anything from an unfamiliar author.

    CategoryWJNode/ImageFile

    Inputs (2)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    invert_maskBOOLEANfalse

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    pathSTRING