Nodes/InsertAnything-ComfyUI-official/InsertAnything - Crop Back (No Scaling)
ComfyUI Node

InsertAnything - Crop Back (No Scaling)

The simpler stitch-back, for people who refuse to squish to 768

By mo230761·Created about a year ago·Updated about a year ago· 26
InsertAnything - Crop Back (No Scaling)
  • raw_image
  • old_tar_image
  • tar_box_yyxx_crop
  • IMAGE

Same job, fewer inputs

Crop Back (No Scaling) does what its scaled sibling does - take the generated half of the InsertAnything diptych and paste it back into your original photo - but it only needs three inputs: raw_image, old_tar_image, and tar_box_yyxx_crop. No crop_params.

Why the difference? In the scaled pipeline, FillProcess squashes everything to 768×768 and records how to undo the padding and resizing in crop_params. In this one, FillProcessNoScaling never resized the crop to 768 at all - it kept the region at native resolution and just aligned it to a VAE-friendly multiple of 8. Geometry stays 1:1, so the stitch-back only needs to know the box. Less bookkeeping, fewer places to get the math wrong.

How it actually works

raw_image arrives as the full generated frame: reference object on the left, target crop on the right. Crop Back (No Scaling) slices the right-hand region at exactly the width FillProcessNoScaling reported in the box, resizes it only if a rounding mismatch snuck in (it can, since dimensions get snapped to multiples of 8), and pastes it into old_tar_image at tar_box_yyxx_crop.

There's a graceful fallback worth appreciating: if the box is invalid or the paste hits an out-of-bounds error, the node returns old_tar_image unchanged instead of crashing your graph. You get the unedited original back rather than a corrupted image - which is honestly the right failure mode for a compositing node.

Pair it correctly

This node belongs to the no-scaling half of the pack. Match it with FillProcessNoScaling:

FillProcessNoScaling (image, mask)    → InpaintModelConditioning → KSampler → VAEDecode → raw_image
FillProcessNoScaling (old_tar_image,
                      tar_box_yyxx_crop) → Crop Back (No Scaling) → SaveImage

Mix and match with the scaled nodes at your own risk - the scaled FillProcess outputs a crop_params that this node doesn't accept, and feeding it a box recorded at a different resolution is how you get a paste in the wrong place.

Install

ComfyUI Manager: search InsertAnything or install via Git URL https://github.com/mo230761/InsertAnything-ComfyUI-official.git. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/mo230761/InsertAnything-ComfyUI-official.git

Restart, then put InsertAnything_noscaling.json into ComfyUI/user/default/workflows. Same dependency caveat as the rest of the pack: there's no requirements.txt, but the code imports cv2 and diffusers at load, so pip install opencv-python diffusers into the ComfyUI env if the pack won't import. The workflow expects flux1-fill-dev fp8, the Redux style model + SigLIP vision, SD3 text encoders, flux-ae, and the Insert Anything LoRA (WensongSong/Insert-Anything on HuggingFace). ~26 GB VRAM typical.

When to reach for it

If you're already running the no-scaling workflow because your insertion region is large or you care about fine texture, this is the node on your graph and you rarely touch it. If you're deciding between the two pipelines: the scaled one is more forgiving (fixed 768×768 works everywhere), the no-scaling one keeps detail at high resolution. This node is the payoff side of that trade - it's what lets the whole frame stay untouched while only the edit region gets regenerated.

Categorysd

Inputs (3)

NameTypeDefaultDescription
raw_imageIMAGE
old_tar_imageIMAGE
tar_box_yyxx_cropBOX

Outputs (1)

NameTypeDescription
IMAGEIMAGE