Nodes/ComfyUI-Apt_Preset/Image_solo_crop
ComfyUI Node

Image_solo_crop

Deprecated — crop a subject and get its background separately

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
Image_solo_crop
  • image
  • mask
  • mask_stack
  • bj_image
  • bj_mask
  • crop_image
  • crop_mask
  • stitch
crop_modeno_scale_crop
long_side512
upscale_methodbilinear
expand_width0
expand_height0
divisible_by2
crop_img_bjimage
auto_expand_squarefalse

This one's filed under the pack's own Deprecated category, and the give-away is right there in the naming: Image_solo_crop2 exists as its cleaner successor. If you're starting a new workflow, go straight to Image_solo_crop2 - it covers the same crop-around-a-mask job with a simpler output set. This article is for anyone maintaining an older graph that still references Image_solo_crop directly.

What it does

It's a mask-driven crop: point it at an image and a mask, and it isolates the masked subject into its own cropped image while separately handing you back the background it cropped away from - image and mask both. That's the "solo" in the name: it splits a scene into the subject you cropped and everything that wasn't the subject, as two parallel pairs of outputs. It's built for a crop-process-stitch workflow - crop the subject out, run it through a sampler or an effect at a smaller working size, then reassemble later with a matching stitch node.

The inputs and outputs that matter

  • crop_mode - four options: no_crop (skip cropping, only process the mask), no_scale_crop (crop as-is, default, no resizing of the cropped region), scale_crop_image (crop, then scale the cropped image's long side), scale_bj_image (scale the background image's long side instead - doesn't support expansion).
  • long_side (INT, default 512) - the target size for whichever scale mode you picked.
  • upscale_method - interpolation algorithm for any scaling (nearest-exact, bilinear default, area, bicubic, lanczos).
  • expand_width / expand_height (INT, 0–2048) - pad the crop region outward before cutting, so you capture a margin around the subject rather than a razor-tight box.
  • divisible_by (INT, default 2) - rounds the final crop size to a multiple of this.
  • Optional auto_expand_square (BOOLEAN) - forces the crop into a square, but only applies in no_scale_crop and scale_crop_image modes.
  • Optional mask_stack (this pack's MASK_STACK2 type) and crop_img_bj - a fallback fill color for the cropped-away region if you'd rather have a flat color than the literal background pixels.

Five outputs: bj_image/bj_mask (the background, minus your subject), crop_image/crop_mask (the isolated subject), and stitch (a STITCH2 bundle for reassembly - pairs with Image_Solo_data or Image_solo_stitch, not with the Image_Resize_sum family's STITCH3).

How to install it

ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r requirements.txt

install.bat runs on Windows only; on Linux (comfy.icu's executor included) pip install -r requirements.txt is the real step.

Common issues

Since this node is deprecated, the first fix for most problems is switching to Image_solo_crop2 rather than debugging this one further - the newer node covers the same ground with fewer, simpler outputs (no separate background-image/mask pair). If you must keep using this one, the setting people miss most is expand_width/expand_height: leaving both at 0 gives you a crop that hugs the mask exactly, which often clips too close for a clean composite later - a small margin (20–50px) gives the eventual stitch step room to blend.

Watch the stitch type, too - bj_image... wait, the stitch output here is STITCH2, and it only connects to Image_Solo_data or Image_solo_stitch. If you're also using Image_Resize_sum elsewhere in the same graph, its STITCH3 output looks similar in the UI but is a different type and won't wire into this family's restore nodes, or vice versa.

Standard pack-wide note: a fresh ComfyUI-Apt_Preset install pulls in a large requirements.txt (onnxruntime, gguf, transparent-background, scenedetect, and more) covering the pack's full 100+-node scope - there's a documented case of that failing to import cleanly on a fresh setup. If you hit IMPORT FAILED, the real error is in the ComfyUI console above the generic message.

CategoryApt_Preset/🚫Deprecated/🚫

Inputs (11)

NameTypeDefaultDescription
imageIMAGE
crop_modeCOMBOno_scale_crop4 options: no_crop, no_scale_crop, scale_crop_image, scale_bj_image
long_sideINT51216–9999
upscale_methodCOMBObilinear5 options: nearest-exact, bilinear, area, bicubic, lanczos
expand_widthINT00–2048
expand_heightINT00–2048
divisible_byINT20–128
maskoptMASK
mask_stackoptMASK_STACK2
crop_img_bjoptCOMBOimage10 options: image, white, black, red, green, blue, +4
auto_expand_squareoptBOOLEANfalse

Outputs (5)

NameTypeDescription
bj_imageIMAGE
bj_maskMASK
crop_imageIMAGE
crop_maskMASK
stitchSTITCH2