InstantID Mask Prepare Pipe (JPS)
Unpack the mask-prep bundle
- imageprepare_settings
- mask_type
- resize_to
- resize_type
- offset_width
- offset_height
- crop_left
- crop_right
- crop_top
- crop_bottom
- padding_left
- padding_right
- padding_top
- padding_bottom
- interpolation
- sharpening
Pairs with InstantID Mask Prepare Settings (JPS) - the node that decides where InstantID's identity injection is allowed to apply, by building a mask (from ComfyUI's mask editor, or pulled from a color channel of a reference image) and configuring how it gets resized and positioned to match your target canvas. This pipe takes that bundle apart again, dropped wherever downstream actually consumes the individual values.
What comes out of it
One input, imageprepare_settings - a BASIC_PIPE (JPS's own bundle, a plain tuple, not Impact Pack's object of the same type name). Fifteen outputs:
mask_type(INT) - which of six mask sources to use: no mask, the mask editor (regular or inverted), or the red/green/blue channel of a reference image.resize_to(INT) - resize to target, resize to source, or keep the mask's original size.resize_type- Crop or Stretch, for how a resize actually happens when aspect ratios don't match.offset_width/offset_height,crop_left/crop_right/crop_top/crop_bottom,padding_left/padding_right/padding_top/padding_bottom- fine positioning, cropping, and padding once the base resize strategy is chosen.interpolation- the resize algorithm. Nearest is usually the right call specifically for masks, since blending interpolation methods leave soft gray edges a binary mask shouldn't have.sharpening(FLOAT) - a mild sharpen pass, more relevant to the reference image a channel-extracted mask came from than the mask itself.
This node runs no masking logic itself - it's pure routing, handing each value to whatever downstream node actually builds and applies the mask before it reaches InstantID's identity-injection step.
Installing it
Ships with the pack. ComfyUI Manager: search JPS Custom Nodes for ComfyUI, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/JPS-GER/ComfyUI_JPS-Nodes.git
Restart afterward, deleting any earlier copy of the pack first. This node itself needs no models - but the InstantID pipeline it's built for does: an InstantID checkpoint and InsightFace's ArcFace models, both under a research/non-commercial license, so keep that in mind before building anything commercial around this workflow.
Where people get tripped up
Without an InstantID Mask Prepare Settings (JPS) node upstream, this pipe has nothing to unpack.
Watch the wiring more carefully than usual on this one. The input, imageprepare_settings, is a name several other Settings nodes in this pack reuse for their own outputs - Image Prepare Settings (JPS), InstantID Pose Prepare Settings (JPS), and InstantID Source Prepare Settings (JPS) all produce a BASIC_PIPE under that exact same label. Because BASIC_PIPE carries no schema ComfyUI actually validates, this pipe will accept a wire from any of those nodes without complaint - the connection looks correct in the UI. It won't unpack right, though: this pipe expects fifteen fields in a specific order, starting with mask_type, and a Settings node built for a different purpose (say, Image Prepare Settings, which has no mask_type or resize_type at all) will produce misaligned or nonsensical output values rather than a clean error. If the mask you're generating doesn't match what you configured, trace the imageprepare_settings wire back to confirm it's actually coming from Mask Prepare Settings and not one of its similarly-named cousins.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| imageprepare_settings | BASIC_PIPE | — |
Outputs (15)
| Name | Type | Description |
|---|---|---|
| mask_type | INT | — |
| resize_to | INT | — |
| resize_type | Crop,Stretch | — |
| offset_width | INT | — |
| offset_height | INT | — |
| crop_left | INT | — |
| crop_right | INT | — |
| crop_top | INT | — |
| crop_bottom | INT | — |
| padding_left | INT | — |
| padding_right | INT | — |
| padding_top | INT | — |
| padding_bottom | INT | — |
| interpolation | lanczos,nearest,bilinear,bicubic,area,nearest-exact | — |
| sharpening | FLOAT | — |