AIO Inpaint
Masked editing that leaves the rest of the frame pixel-identical
- image
- mask
- context_mask
- inpaint
- final_mask
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
imageandmask- the source image and the mask (white = regenerate, black = preserve).mask_invertflips 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_percentandmask_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 imageencodes the whole source frame as the input latent instead. WithComfyUI-Inpaint-CropAndStitchinstalled, the Flux path crops around the mask, usesInpaintModelConditioning, 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 themax_full_frame_megapixels/max_full_frame_sidecaps (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
masksocket on the main node isn't the inpaint path.AIO Inpaintis the contract. Connecting a bare mask toAIO Image Generate'smaskinput only works alongsideimage 1and 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 1reference; 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_megapixelsandmax_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.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Source image to preserve outside the inpaint mask. | |
| mask | MASK | White areas are regenerated; black areas are preserved. | |
| mask_invert | BOOLEAN | false | Invert the mask before inpainting. |
| mask_grow_percent | FLOAT | 8.00–100 | Expand the sampled mask by this percent of the active mask bounding box. |
| mask_feather | INT | 240–256 | Soften the final image blend edge in pixels. |
| denoise | FLOAT | 1.000–1 | How strongly to redraw the masked area. |
| final_blend | BOOLEAN | true | Composite the decoded result over the source image using the feathered mask. |
| crop_target_width | INT | 102464–16384 | Working crop width for optional crop/stitch inpaint. |
| crop_target_height | INT | 102464–16384 | Working crop height for optional crop/stitch inpaint. |
| context_from_mask_extend_factor | FLOAT | 1.601–100 | Grow the crop context area around the processed mask. |
| crop_output_padding | COMBO | 64 | Pad crop target dimensions to this multiple. |
| mask_fill_holes | BOOLEAN | true | Fill enclosed holes in the crop/stitch mask. |
| mask_hipass_filter | FLOAT | 0.100–1 | Ignore low mask values before crop/stitch processing. |
| max_full_frame_megapixels | FLOAT | 1.000.25–1024 | Maximum full-frame fallback size in megapixels when crop/stitch is unavailable. |
| max_full_frame_side | INT | 153664–16384 | Maximum full-frame fallback long side when crop/stitch is unavailable. |
| color_match_strength | FLOAT | 0.000–1 | Use Acly Color Match (Masked) after decoding Flux Klein inpaint, before final blend/stitch. |
| source_latent_mode | COMBO | crop/stitch | Use crop/stitch working crops by default, or encode the full source image as the sampler latent. |
| steps | INT | 00–100 | Inpaint sampling steps. Use 0 to reuse the main resolved step count. |
| context_maskopt | MASK | Optional extra area to include as crop/stitch context. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| inpaint | AIO_INPAINT_CONFIG | — |
| final_mask | MASK | — |