Nodes/comfyui-missed-tool/Load Image Alpha
ComfyUI Node

Load Image Alpha

The loader that keeps your transparent PNGs transparent

By ifmylove2011·Created about a year ago·Updated 10 months ago· 3
Load Image Alpha
    • image
    • mask
    • image_path
    rgba_modefalse
    image

    The stock ComfyUI loader quietly destroys the alpha channel. LoadImage opens your PNG, converts it to RGB, and the transparency is just gone - you get a square image where your cutout used to be. That's the gap LoadImageA fills: it's the same familiar upload-picker, but it can keep the alpha as a real RGBA tensor, and it hands you a mask and the file path as bonuses.

    It comes from comfyui-missed-tool, a small "a few tools that I wanted" pack by ifmylove2011. The name undersells it a little; this node is genuinely the thing you reach for when you build workflows around transparent assets.

    How it works

    Under the hood it's plain PIL plus a touch of torch. It opens the file, and the single switch on the node decides the rest:

    • rgba_mode on → the image is converted to RGBA and the tensor keeps all four channels.
    • rgba_mode off (the default) → it converts to RGB, alpha dropped. At that point it's just LoadImage with an extra string output.

    It then reads the alpha band, if the file has one, and emits mask = 1 - alpha. Note the inversion: this matches ComfyUI's own mask convention, where white means transparent / to be removed. If the file has no alpha band at all, you get a silent 64×64 zero mask instead.

    The inputs and outputs that matter

    One input matters: rgba_mode (BOOLEAN, default false). The other, image, is the same upload/choose dropdown you already know.

    The three outputs are where the value is:

    • image - the IMAGE tensor, RGBA if you flipped the mode.
    • mask - derived from the alpha, in ComfyUI's white-means-transparent convention.
    • image_path - the resolved file path on disk. This one's the sleeper hit: wire it into a text or file node to load a matching caption, a settings JSON, or whatever sits next to the image.

    A classic setup: LoadImageA feeds an RGBA cutout straight into a compositing or overlay step, while image_path pulls the sidecar file that tells you what to do with it.

    Installing it

    Easiest route is ComfyUI Manager - search for comfyui-missed-tool and install. Manual way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ifmylove2011/comfyui-missing-tool
    cd comfyui-missing-tool
    pip install -r requirements.txt
    

    Then restart ComfyUI. The pack's dependencies are torch, numpy, Pillow - all of which ComfyUI already ships, and there are zero model downloads. Install is boring, which is exactly what you want from a utility pack. The nodes land under a "missed-tool" section in the menu. One naming quirk: the README spells the clone URL "comfyui-missed-tool" while the repo is "comfyui-missing-tool"; GitHub redirects the old spelling, so either works.

    Where people get burned

    • The default kills your alpha. If you just plug in the node and don't touch rgba_mode, you've silently recreated plain LoadImage. If your output has square corners, flip the toggle - that's the number one gotcha.
    • The mask is inverted on purpose. 1.0 means transparent here, matching ComfyUI. Don't "fix" it with an Invert Mask unless you know your downstream node wants the other polarity.
    • No alpha band → junk mask. A 64×64 zero tensor comes back silently. Chain that into a mask-based operation and you'll get a confused result with no error to tell you why.

    Newer ComfyUI builds did add their own "Load Image (RGBA)" loader, so on a fresh install you have a choice. LoadImageA's edge is still the one-stop shop: RGBA image, mask, and path out of the same node - handy in a batch or a workflow you're tidying up.

    Categorymissed-tool

    Inputs (2)

    NameTypeDefaultDescription
    rgba_modeBOOLEANfalse
    imageCOMBO2 options: example.png, #DATA

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    image_pathSTRING