Smart Object Isolate Crop
Smart Object Isolate Crop — show the editor the garment and nothing else
- image
- mask
- stitcher
- isolated_image
- isolated_mask
- isolated_mask_image
- preview_image
- info
Smart Mask Crop sends the editor a crop with the mask drawn on it - but the rest of the crop is still visible, so GPT Image can "helpfully" rebuild the whole scene. Smart Object Isolate Crop takes the opposite approach: it hides every pixel outside the semantic mask, hands the model an RGBA isolated object on a blank background, and only that object is up for editing.
It's purpose-built for garment and product detail passes - the pack's recommended use is texture/detail enhancement on a garment that already exists, not replacement. If you want to swap the garment or change the silhouette, this is the wrong tool; if you want to enhance the fabric weave, seams, and stitching on the bra or pants someone is already wearing, this is exactly the tool.
How it works
You feed it image and a mask (usually from Florence-2 with region_type = object, or from the SAM 3 segmenter with a garment prompt). It crops to the object's bounding box, blanks everything outside the mask, and outputs an RGBA isolated_image plus matching mask. The editor only ever sees the object. Then the stitcher pastes the enhanced object back into the source, so the body and background stay bit-identical.
Inputs worth knowing
edge_guard_percent(default 3) - forces the outer crop border to remain uneditable. This is a subtle killer feature: it discourages editors from completing garments that are cut off by the crop or the source frame. Without it, GPT Image will happily grow a sleeve that was cropped mid-arm.outside_fill(black/white/gray/transparent_rgb_black) - the RGB color written outside the object in case a downstream model ignores alpha.grayis the default and a fine middle ground.alpha_feather_percent(default 1.5) - softens the isolated object's edge and the final paste mask.target_size_mode/target_aspect_ratio- default tomax_for_aspect_ratiowithmask_bbox, which gives you the largest valid edit size at the object's own shape. Good default.crop_padding_percent(default 8) andvisible_context_percent(default 10) - padding expands the crop so original skin/background survives nearby;visible_context_percentshows a thin ring of original pixels around the object while keeping the edit mask limited to the garment. That ring matters for color coherence.mask_expand_percent- keep near 0; the tooltip says it plainly: "avoid body context."
The flow
Florence object "bra" -> Smart Object Isolate Crop -> GPT Image 2 Edit \
Florence object "pants" -> Smart Object Isolate Crop -> GPT Image 2 Edit -> Smart Mask Multi Stitch -> final image
Wire isolated_image → editor image_1, isolated_mask_image → mask_image, info → region_info, and set the editor's size_mode = auto_from_region. For separate top/bottom passes, run two selectors and two edits, then combine with Smart Mask Multi Stitch - the pack ships this exact setup as 06_florence_garment_detail_gpt_image2_multistitch.json and a Seedream 4.5 version as 07_....
Prompting matters here. The README's suggested prompt is worth cribbing: enhance fabric texture/seams/weave only on the visible garment, preserve silhouette, cut-off edges, position, scale, and blank background, and do not add body, skin, or mannequin.
Install
Search comfyui-inpaint-cropstitch-nb2 in Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/amortegui84/comfyui-inpaint-cropstitch-nb2
Restart. The crop is local; the selector (Florence/SAM via FAL) and the editor need FAL_KEY.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| resize_mode | COMBO | upscale_to_target_if_smaller | 3 options: keep_local_size, upscale_to_target_if_smaller, resize_to_target |
| target_width | INT | 102464–16384 | — |
| target_height | INT | 102464–16384 | — |
| mask_expand_percent | FLOAT | 0.00–30 | Small expansion for edit coverage. Keep near 0 to avoid body context. |
| alpha_feather_percent | FLOAT | 1.500–20 | Softens the isolated object edge and final paste mask. |
| target_size_mode | COMBO | max_for_aspect_ratio | 2 options: manual_width_height, max_for_aspect_ratio |
| target_aspect_ratio | COMBO | mask_bbox | 11 options: mask_bbox, input_image, 1:1, 16:9, 9:16, 4:5, +5 |
| outside_fill | COMBO | gray | RGB color written outside the object in case a downstream model ignores alpha. |
| downscale_algorithm | COMBO | bilinear | 6 options: nearest, bilinear, bicubic, lanczos, box, hamming |
| upscale_algorithm | COMBO | bicubic | 6 options: nearest, bilinear, bicubic, lanczos, box, hamming |
| device_mode | COMBO | gpu (much faster) | 2 options: gpu (much faster), cpu (compatible) |
| depad_florence | BOOLEAN | true | Keep True when the mask comes from Florence-2. |
| region_infoopt | STRING | — | |
| edge_guard_percentopt | FLOAT | 3.000–15 | Forces the outer crop border to remain uneditable. This discourages image editors from completing garments that are cut off by the crop or source frame. |
| crop_padding_percentopt | FLOAT | 8.00–60 | Expands the crop around the garment so nearby original skin/background can be preserved. |
| visible_context_percentopt | FLOAT | 10.00–80 | Shows a small ring of original pixels around the garment to the editor. The edit mask remains limited to the garment. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| stitcher | STITCHER | — |
| isolated_image | IMAGE | — |
| isolated_mask | MASK | — |
| isolated_mask_image | IMAGE | — |
| preview_image | IMAGE | — |
| info | STRING | — |