Nodes/InstaSD nodes for ComfyUI/InstaSD API Input - Load Image With Mask
ComfyUI Node

InstaSD API Input - Load Image With Mask

The InstaSD image node that hands users a mask to draw on

By WaddingtonHoldings·Created 2 years ago·Updated 10 months ago· 4
InstaSD API Input - Load Image With Mask
    • image
    • mask
    image

    This is the node you reach for when the person using your workflow needs to say where the edit happens, not just what to edit. InstaLoadImageWithMask loads an image and returns both the image and a mask - but unlike the other loaders in this pack, the mask is designed to be drawn: it comes back as an IMAGE, which means inpainting-style "paint the area to fix" UIs can display and edit it directly.

    Pick an image from the image dropdown (uploading is enabled, so you can drop a new file in from the widget). The node returns:

    • image - the loaded image tensor (type IMAGE).
    • mask - the mask, type IMAGE, not MASK. This trips people up constantly. Most ComfyUI mask nodes use the MASK type; this one deliberately emits an RGB image so it can be shown and edited like a normal image.

    Where does the mask come from? If no custom mask is provided, it's the image's alpha channel, inverted: transparent areas become white (the "replace me" region), opaque areas black. If you use ComfyUI's mask-editing tools (the hidden MASK_IMAGE input), or supply a separate mask file, that's used instead and resized to match the image.

    White = the area that gets regenerated, which matches how inpainting conditioners and most inpaint models interpret masks. If you're hooking this into an inpainting workflow, that polarity is the thing to get right - wire the mask into a Set Latent Noise Mask or an inpaint conditioning node and the white regions are what gets repainted.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/WaddingtonHoldings/ComfyUI-InstaSD
    

    Restart ComfyUI, or use ComfyUI Manager (search "InstaSD"). Dependencies: boto3, Pillow, requests, numpy. No models, no credentials.

    Gotchas

    • The mask is an IMAGE. If you plug it into a MASK-typed input, it won't connect. Nodes that want a MASK will reject it; you may need a converter or to use the built-in LoadImage instead.
    • Polarity. White = repaint here. If your inpaint results are regenerating everything except what you marked, flip the mask.
    • If the image has no alpha channel and you didn't supply a mask, you get an all-black mask - which means "nothing to replace". That's a no-op, not a bug; supply a mask or use an image with transparency.
    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    maskIMAGE