Nodes/BrevImage/BrevImage Node
ComfyUI Node

BrevImage Node

BrevImage Skips the File Picker

By bkunbargi·Created 3 years ago·Updated 2 years ago· 1
BrevImage Node
    • image
    • mask
    • filename_text
    image_path./ComfyUI/input/example.png
    RGBA
    filename_text_extension
    use_opt_directory

    ComfyUI's stock LoadImage only lets you pick from a dropdown of files already sitting in your input/ folder. Fine for drag-and-drop, useless when the image lives somewhere else - on disk, or behind a URL. BrevImage is a one-node answer to that: type a path, or paste a URL, and out come an image, a mask, and a filename string. The name sounds like it should call some API. It doesn't. No key, no account, nothing to configure.

    It's really two loaders in one. Give image_path something starting with http and it fires a plain requests.get, slurps the bytes into memory, and decodes with PIL - the image never touches disk. Give it a plain path and it opens a local file instead. The URL half is the reason most people reach for it: it's how you feed a generated image into a fresh workflow without first saving it and re-uploading it into input/. The local half is where you need to be careful (see below).

    The three outputs are what you wire onward:

    • image (IMAGE) → straight into VAE EncodeKSampler for img2img, or into a Load Image-style slot on a ControlNet or a details pass.
    • mask (MASK) → into Set Latent Noise Mask for inpainting. If the image has an alpha channel, the mask is 1 − alpha, so the transparent regions come out white - exactly what an inpaint pass wants. No alpha, and you get an all-black 64×64 mask, i.e. "mask nothing."
    • filename_text (STRING) → a basename you can pipe into a prompt, a note node, or a save node. filename_text_extension toggles whether it keeps the extension.

    That's most of what you'll set. The other two inputs are the odd ones. RGBA (default false) flattens to RGB for the sampler; flip it to true and the alpha channel survives in the image itself (the mask comes out either way, from the original file). use_opt_directory decides which hardcoded folder local paths get glued onto: true/opt/ComfyUI/input/, false/runpod-volume/ComfyUI/input/.

    The trap, and it's a real one. Those are RunPod serverless paths. This node was clearly pulled out of a RunPod serverless template - that's the giveaway - and on a stock desktop ComfyUI, neither directory exists. Worse, when the file can't be opened the code swallows the OSError and substitutes a blank 512×512 black image. No red error, no red border. You just quietly get a black square and wonder what you broke. So on a normal install, type only the filename (it gets joined onto the hardcoded root - the default ./ComfyUI/input/example.png joined onto that root is nonsense) and make sure the file actually lives there, or stick to URLs. The repo's standalone BrevLoadImage.py uses ComfyUI's proper folder_paths.input_directory, but the registered node is the hardcoded-__init__.py version, so that's what you get. Worth knowing before you fight it for an hour.

    Two more behaviors to expect. Because IS_CHANGED returns NaN for URLs, the node re-downloads every single queue run - no caching, so big remote images cost you time on every execution. Local files get a SHA-256 hash and only re-run when the content changes, which is the right call. And there's no URL validation: feed it a non-image URL and you'll get an HTTP error printed to the console and no output.

    Install is as easy as it gets. ComfyUI Manager → search BrevImage → install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bkunbargi/BrevImage
    

    Restart ComfyUI and it appears under the BrevMage category (typo in the menu is theirs, not yours). There's no requirements.txt - it only needs requests, PIL, numpy, and torch, all of which ComfyUI already ships. No models to download, no extra runtime. If your use case is "load an image from a URL into my workflow," it does that one job and disappears. Just don't let it talk you into trusting the local-path half on a machine that isn't a RunPod box.

    CategoryBrevMage

    Inputs (4)

    NameTypeDefaultDescription
    image_pathSTRING./ComfyUI/input/example.png
    RGBACOMBO2 options: false, true
    filename_text_extensionoptCOMBO2 options: true, false
    use_opt_directoryoptCOMBO2 options: true, false

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filename_textSTRING