InstaSD API Input - Load Image With Mask
The InstaSD image node that hands users a mask to draw on
- image
- mask
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 theMASKtype; 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 aMASKwill reject it; you may need a converter or to use the built-inLoadImageinstead. - 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.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | IMAGE | — |