ComfyUI Node

AIO Inpaint

Masked editing that leaves the rest of the frame pixel-identical

By helto4real·Created 3 months ago·Updated 23 days ago· 1
AIO Inpaint
  • image
  • mask
  • context_mask
  • inpaint
  • final_mask
mask_invertfalse
mask_grow_percent8.0
mask_feather24
denoise1.00
final_blendtrue
crop_target_width1024
crop_target_height1024
context_from_mask_extend_factor1.60
crop_output_padding64
mask_fill_holestrue
mask_hipass_filter0.10
max_full_frame_megapixels1.00
max_full_frame_side1536
color_match_strength0.00
source_latent_modecrop/stitch
steps0

Instruction-editing models took over most of inpainting's old job, but masks still own one thing nothing else does: bit-identical pixels outside the edited region, plus the denoise dial that lets you control how much of the region actually changes. AIOInpaint is how the AIO pack gives you that on FLUX.2 Klein 9B, Ideogram 4, and Krea 2. It's a config node - it doesn't sample anything itself. You wire image + mask in, set the behavior, and connect its inpaint output to the inpaint socket on AIO Image Generate. The main node then edits only the masked area with the family-appropriate mechanism.

The inputs that matter

  • image and mask - the source image and the mask (white = regenerate, black = preserve). mask_invert flips that.
  • denoise - how strongly to redraw the masked area (default 1.0). This is the mask equivalent of the Krea reference dial: 1.0 replaces the region outright, lower values keep more of what's there. The reason people still reach for masks is having this dial at all.
  • mask_grow_percent and mask_feather - expand the sampled mask (8% of the mask bounding box by default) and soften the blend edge (24px default). These default to crop/stitch-style values tuned for the Flux workflow, and they're where seams live or die.
  • source_latent_mode - crop/stitch (default) samples a working crop around the mask and stitches the decoded result back to the original canvas; full image encodes the whole source frame as the input latent instead. With ComfyUI-Inpaint-CropAndStitch installed, the Flux path crops around the mask, uses InpaintModelConditioning, samples the working crop, and stitches back - that's the memory-friendly route for big images. Without that pack, Flux falls back to full-frame masked sampling with the max_full_frame_megapixels / max_full_frame_side caps (1 MP / 1536px defaults).
  • steps - 0 means "reuse the main node's resolved step count." Set a positive value to run the inpaint pass with more or fewer steps than the main generation.
  • crop_target_width / crop_target_height / context_from_mask_extend_factor / crop_output_padding - the working-crop geometry for crop/stitch mode (1024x1024 target, 1.6x context extension, padding to a multiple).
  • color_match_strength - uses Acly Color Match (Masked) after decoding Flux Klein inpaint, before the final blend. 0 (default) off; nudge it up when the inpainted region's colors don't match the surrounding photo.
  • mask_fill_holes, mask_hipass_filter, final_blend, context_mask - mask hygiene and optional extra context area.

Two outputs: inpaint (the config, into the main node) and final_mask - the source-size blend mask after grow/feather, handy for previewing exactly what will be touched.

Wiring and install

Pack install as usual:

cd ComfyUI/custom_nodes
git clone https://github.com/helto4real/comfyui-all-on-one-image-generation-node
cd comfyui-all-on-one-image-generation-node
python -m pip install -r requirements.txt

Or ComfyUI Manager → search "AIO Image Generate" → install → restart. All nodes under AIO/Image. For the best Flux inpaint experience, also install ComfyUI-Inpaint-CropAndStitch - without it you get the full-frame fallback, which downsizes large sources before sampling and may return a smaller image than the original.

Gotchas

  • The legacy mask socket on the main node isn't the inpaint path. AIO Inpaint is the contract. Connecting a bare mask to AIO Image Generate's mask input only works alongside image 1 and is not what you want for masked editing on these families.
  • Reference vs inpaint on Krea 2. An active inpaint config takes priority over Krea's image 1 reference; a retained workflow wire alone doesn't activate it. If a Krea run is sampling as img2img when you meant inpaint (or vice versa), check which config is actually live.
  • Full-frame fallback shrinks big images. Without crop/stitch, large sources get capped by max_full_frame_megapixels and max_full_frame_side. If your output comes back smaller than the source, that's why.
  • Ideogram 4 inpaint is dims-strict. Multiples of 16, 256–2048 per side, aspect ratio no wider than 6:1.

The rest of the frame doesn't move, and that's the whole selling point.

CategoryAIO/Image

Inputs (19)

NameTypeDefaultDescription
imageIMAGESource image to preserve outside the inpaint mask.
maskMASKWhite areas are regenerated; black areas are preserved.
mask_invertBOOLEANfalseInvert the mask before inpainting.
mask_grow_percentFLOAT8.00–100Expand the sampled mask by this percent of the active mask bounding box.
mask_featherINT240–256Soften the final image blend edge in pixels.
denoiseFLOAT1.000–1How strongly to redraw the masked area.
final_blendBOOLEANtrueComposite the decoded result over the source image using the feathered mask.
crop_target_widthINT102464–16384Working crop width for optional crop/stitch inpaint.
crop_target_heightINT102464–16384Working crop height for optional crop/stitch inpaint.
context_from_mask_extend_factorFLOAT1.601–100Grow the crop context area around the processed mask.
crop_output_paddingCOMBO64Pad crop target dimensions to this multiple.
mask_fill_holesBOOLEANtrueFill enclosed holes in the crop/stitch mask.
mask_hipass_filterFLOAT0.100–1Ignore low mask values before crop/stitch processing.
max_full_frame_megapixelsFLOAT1.000.25–1024Maximum full-frame fallback size in megapixels when crop/stitch is unavailable.
max_full_frame_sideINT153664–16384Maximum full-frame fallback long side when crop/stitch is unavailable.
color_match_strengthFLOAT0.000–1Use Acly Color Match (Masked) after decoding Flux Klein inpaint, before final blend/stitch.
source_latent_modeCOMBOcrop/stitchUse crop/stitch working crops by default, or encode the full source image as the sampler latent.
stepsINT00–100Inpaint sampling steps. Use 0 to reuse the main resolved step count.
context_maskoptMASKOptional extra area to include as crop/stitch context.

Outputs (2)

NameTypeDescription
inpaintAIO_INPAINT_CONFIG
final_maskMASK