Nodes/Bjornulf_custom_nodes/๐Ÿ“ฅ๐Ÿ–ผ Load Image with Transparency From Path
ComfyUI Node

๐Ÿ“ฅ๐Ÿ–ผ Load Image with Transparency From Path

Load Image with Transparency From Path (Bjornulf_custom_nodes) โ€” ComfyUI Node Guide

By justUmenยทCreated 2 years agoยทUpdated about a year agoยท 545
๐Ÿ“ฅ๐Ÿ–ผ Load Image with Transparency From Path
    • image
    • mask
    • image_path
    โ—„image_pathโ–บ

    ComfyUI's built-in Load Image node has a well-known blind spot: it drops the alpha channel. Load a PNG with a transparent background through the stock node and you get an opaque image back - the transparency data is just gone. Bjornulf's pack fixes that with a couple of transparency-preserving loaders, and this is the path-based one: instead of clicking through a file picker widget, you give it a plain string path and it goes and reads the file directly, alpha intact.

    Why the path variant matters

    The picker-widget version of this idea (the pack's plain "Load Image with Transparency" node) is fine when you're working interactively - click, browse, pick a file. But a path-based version opens up scripted and batch pipelines: chain it after any node in this pack that outputs a file path (Load Images from Output Folder, for instance), point it somewhere entirely outside ComfyUI's own input/ folder, or drive it from an external process that just needs to hand ComfyUI a string. It's the same loading logic, just decoupled from the UI widget.

    Inputs and outputs

    One required input: image_path, a single-line STRING with an empty default - you supply the full path to the image file, wherever it lives on disk. Three outputs: image (the IMAGE, transparency preserved), mask (the alpha channel split out as its own MASK, ready to wire into compositing or inpainting), and image_path - yes, it echoes the path back out. That's more useful than it sounds: it lets you carry the source filename downstream for logging, or to base an output filename on the input one without needing a second string variable floating around your graph.

    Installing it

    Part of the standard Bjornulf_custom_nodes install. ComfyUI Manager โ†’ search "Bjornulf_custom_nodes" โ†’ install โ†’ restart, or cd ComfyUI/custom_nodes && git clone https://github.com/justUmen/Bjornulf_custom_nodes and restart manually. Nothing extra required for this specific node beyond the pack's base install.

    Common issues & troubleshooting

    The most common snag is a plain path mistake: relative paths get interpreted relative to wherever ComfyUI's process is running from, which is often not what you expect if you're used to thinking in terms of the input/ or output/ folders specifically. When in doubt, use an absolute path, at least while you're setting a workflow up.

    If your image loads but comes back looking opaque anyway, double-check the source file actually has an alpha channel in the first place - this node preserves transparency that exists, it doesn't invent any. A JPEG, for instance, has no alpha channel to preserve at all; you'll need a PNG or WebP with real transparency for the mask output to be meaningful. And if you're chaining this after a path-producing node elsewhere in the pack, make sure that upstream node's path format (forward slashes vs. backslashes, trailing slashes) matches what your OS expects - cross-platform path quirks are one of the more common "works on my machine" complaints across this pack's file-path-based nodes.

    CategoryBjornulf

    Inputs (1)

    NameTypeDefaultDescription
    image_pathSTRINGโ€”

    Outputs (3)

    NameTypeDescription
    imageIMAGEโ€”
    maskMASKโ€”
    image_pathSTRINGโ€”