Nodes/InsertAnything-ComfyUI-official/InsertAnything - Fill Process (No Scaling)
ComfyUI Node

InsertAnything - Fill Process (No Scaling)

FillProcess without the 768x768 tax

By mo230761·Created about a year ago·Updated about a year ago· 26
InsertAnything - Fill Process (No Scaling)
  • source_image
  • ref_image
  • source_mask
  • ref_mask
  • image
  • mask
  • old_tar_image
  • tar_box_yyxx_crop
  • preview_image
iterations2
expand_pixels0

The "don't squish my crop" version

FillProcessNoScaling builds the same reference-on-the-left, target-on-the-right diptych as its scaled sibling - minus one big assumption: that everything has to be forced through 768×768. The pack's own README says it plainly: the Insert Anything LoRA performs fine at larger resolutions, and downsampling to 768×768 just throws away detail. This node keeps your crop at native resolution instead.

That matters most when the region you're filling is large or textured. In the scaled pipeline a big crop gets shrunk to 768, regenerated, and blown back up - soft by construction. Here the region stays at its real size, so what you generate is what you get, seams and all.

The two knobs

Inputs mirror FillProcess (source_image, source_mask, ref_image, ref_mask, iterations) plus one extra:

  • iterations (INT, default 2, range 0–100) - dilates the source mask with a 7×7 kernel that many times. More = bigger fill area = more blending room. 0 = use the mask as-is.
  • expand_pixels (INT, default 0, range 0–1024) - grows the crop bounding box beyond the mask by this many pixels on each side. This is the native-resolution way to give the model context to blend against, since there's no resize step doing it for you. The shipped no-scaling workflow runs iterations=0, expand_pixels=64 - worth taking as a starting point rather than inventing your own.

One subtlety the code handles for you: the final crop dimensions get snapped up to a multiple of 8 before sampling, because FLUX's VAE wants dimensions it can tile. You don't need to worry about it, but it's why the box that comes back out may be a hair larger than what your mask implied.

Outputs

Five outputs: image + mask (the diptych and its mask, feeding InpaintModelConditioning), old_tar_image (the untouched original), tar_box_yyxx_crop (BOX - where the crop lives in the original), and preview_image (the highlighted diptych to eyeball before sampling). Note there's no crop_params here: geometry never got mangled by a resize, so the stitch-back side (CropBackNoScaling) only needs the box.

FillProcessNoScaling (image, mask) → InpaintModelConditioning → KSampler → VAEDecode
FillProcessNoScaling (old_tar_image, tar_box_yyxx_crop) → CropBackNoScaling → SaveImage

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 pack-wide caveat: no requirements.txt, but cv2 and diffusers are imported at load time, 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.safetensors from WensongSong/Insert-Anything on HuggingFace. ~26 GB VRAM typical.

When this beats the scaled version

High-resolution insertions, fine texture (fabric, fur, product shots), or any time the 768×768 route comes back soft. The cost is a bit more VRAM and slower sampling because you're generating at a bigger canvas. If your crops are small and you want predictable speed, the scaled pipeline is fine - but for a large object in a big photo, this is the one that doesn't make you regret it after the fact.

Categorysd

Inputs (6)

NameTypeDefaultDescription
source_imageIMAGE
ref_imageIMAGE
source_maskMASK
ref_maskMASK
iterationsINT20–100
expand_pixelsINT00–1024

Outputs (5)

NameTypeDescription
imageIMAGE
maskMASK
old_tar_imageIMAGE
tar_box_yyxx_cropBOX
preview_imageIMAGE