Nodes/ComfyUI_Zwng_Nodes/Load Image Path or URL
ComfyUI Node

Load Image Path or URL

Load an image from a file path or a straight URL

By za-wa-n-go·Created 2 years ago·Updated about a year ago· 7
Load Image Path or URL
    • IMAGE
    • MASK
    image_path"./input/example.png"

    The stock Load Image node in ComfyUI wants you to click a button, pick a file, and watch it get copied into your input folder. That's fine when you're sitting at the browser clicking things. It's useless the moment you're scripting a batch, feeding a workflow from code, or pointing at an image that already lives somewhere else, like a link someone dropped in Discord or a file sitting on an R2 bucket. ZwngLoadImagePathOrURL skips the upload dance entirely: you give it a string, either a file path or a URL, and it goes and gets the image itself.

    How it works

    There's no dropdown of previously-uploaded files here, just one text field. Feed it a path (relative to wherever ComfyUI is running, or absolute if you want to be safe) and it reads the file straight off disk. Feed it something starting with http:// or https:// and it fetches it first, then treats the result the same way. That second case is the one that actually earns this node a spot in your custom_nodes folder: pulling a reference image directly from a link without a manual download-then-upload round trip.

    The inputs and outputs that matter

    There's exactly one input worth knowing: image_path, a plain string field defaulting to "./input/example.png" as a placeholder. Swap that for your own path or paste in a URL and you're done.

    Out the other side you get the same pair the built-in Load Image node produces: an IMAGE and a MASK. Like that stock node, the mask is almost certainly pulled from the image's alpha channel if it has one, so unless you're loading PNGs with transparency baked in, you can generally ignore that second output and just wire IMAGE onward.

    The pack's own README suggests pairing this with Impact Pack's Preview Bridge node, and that's a good habit specifically because URL loads are a black box until they run. You can't preview a link the way you can preview a file in a browser upload dialog, so having a bridge or a plain Preview Image node right after this one saves you from discovering a broken link three nodes downstream.

    How to install it

    Easiest path is ComfyUI Manager: search for "ComfyUI_Zwng_Nodes" (or just "Zwng"), install, restart. Manually, it's the usual drill:

    cd ComfyUI/custom_nodes
    git clone https://github.com/za-wa-n-go/ComfyUI_Zwng_Nodes
    

    then restart ComfyUI. There's nothing to download here beyond the node code itself: no model weights, no heavyweight Python dependencies. It's a genuinely small pack.

    Common issues & troubleshooting

    Local path doesn't resolve. Relative paths are relative to wherever the ComfyUI process is running, which is not necessarily where you'd guess. If a relative path keeps failing, switch to an absolute one and confirm it works before you spend time debugging the workflow around it.

    Running via an API or a remote GPU service? Worth remembering that a local file path only exists if that path exists on the machine actually executing the workflow, not on your laptop. If your run happens somewhere other than the box you're typing on, a URL is the reliable option; a local path assumes the file is already staged there.

    URL loads fail or return garbage. Make sure the link points directly at an image file, not at a webpage that happens to display one. A gallery page or a share link that redirects through HTML first will not load correctly here; you need the direct image URL, the kind that ends in .png, .jpg, and so on when you paste it into a browser's address bar.

    CategoryZWNG

    Inputs (1)

    NameTypeDefaultDescription
    image_pathSTRING"./input/example.png"

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK