Nodes/ComfyUI-Inpaint-CropStitch-NB2/Smart Object Isolate Crop
ComfyUI Node

Smart Object Isolate Crop

Crops an object and returns an RGBA isolated image plus matching mask for GPT Image detail enhancement without body/background context.

By amortegui84·Created 5 months ago·Updated 2 months ago· 3
Smart Object Isolate Crop
  • image
  • mask
  • stitcher
  • isolated_image
  • isolated_mask
  • isolated_mask_image
  • preview_image
  • info
resize_modeupscale_to_target_if_smaller
target_width1024
target_height1024
mask_expand_percent0.0
alpha_feather_percent1.50
target_size_modemax_for_aspect_ratio
target_aspect_ratiomask_bbox
outside_fillgray
downscale_algorithmbilinear
upscale_algorithmbicubic
device_modegpu (much faster)
depad_florencetrue
region_info
edge_guard_percent3.00
crop_padding_percent8.0
visible_context_percent10.0
Categoryinpaint/masked

Inputs (18)

NameTypeDefaultDescription
imageIMAGE
maskMASK
resize_modeCOMBOupscale_to_target_if_smaller3 options: keep_local_size, upscale_to_target_if_smaller, resize_to_target
target_widthINT102464–16384
target_heightINT102464–16384
mask_expand_percentFLOAT0.00–30Small expansion for edit coverage. Keep near 0 to avoid body context.
alpha_feather_percentFLOAT1.500–20Softens the isolated object edge and final paste mask.
target_size_modeCOMBOmax_for_aspect_ratio2 options: manual_width_height, max_for_aspect_ratio
target_aspect_ratioCOMBOmask_bbox11 options: mask_bbox, input_image, 1:1, 16:9, 9:16, 4:5, +5
outside_fillCOMBOgrayRGB color written outside the object in case a downstream model ignores alpha.
downscale_algorithmCOMBObilinear6 options: nearest, bilinear, bicubic, lanczos, box, hamming
upscale_algorithmCOMBObicubic6 options: nearest, bilinear, bicubic, lanczos, box, hamming
device_modeCOMBOgpu (much faster)2 options: gpu (much faster), cpu (compatible)
depad_florenceBOOLEANtrueKeep True when the mask comes from Florence-2.
region_infooptSTRING
edge_guard_percentoptFLOAT3.000–15Forces 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_percentoptFLOAT8.00–60Expands the crop around the garment so nearby original skin/background can be preserved.
visible_context_percentoptFLOAT10.00–80Shows a small ring of original pixels around the garment to the editor. The edit mask remains limited to the garment.

Outputs (6)

NameTypeDescription
stitcherSTITCHER
isolated_imageIMAGE
isolated_maskMASK
isolated_mask_imageIMAGE
preview_imageIMAGE
infoSTRING