CivArchive
    krea2_anypaint_inpaint_outpaint_v4 - v1.0
    Preview 150303639

    krea2_anypaint_inpaint_outpaint_v4: Krea2 AnyPaint Inpainting with Crop & Stitch for ComfyUI

    A ComfyUI inpainting workflow built on Krea2 AnyPaint. Paint a mask over the part of an image you want to change, describe what should go there, and the workflow regenerates only that region and stitches it back into the original. Everything outside the mask stays untouched, and the crop-and-stitch approach means the masked area is rendered at full working resolution even on large images.

    In the example, a plain portrait gets "a beautiful woman wearing cateye sunglasses" painted in, with the original lighting and skin tones preserved.

    !IMPORTANT: Outpainting and inpainting are independent!

    • If you mask the image, outpainting will fail. Clear the masks to outpaint:

    • If you extend the image the inpainting will fail. These values need to be 0,0,0,0 for inpainting:

    How it works

    The workflow runs in three stages, laid out as three groups left to right.

    1. Prepare mask + crop

    • Load Image: load your image and paint the mask directly in ComfyUI's mask editor.

    • Inpaint Crop (Inpaint-CropAndStitch): crops a working region around your mask, with settings to control the result:

      • Downscale/upscale algorithm (Lanczos), pre-resize to a minimum of 1536 px

      • Mask fill holes, expand (20 px) and blend (60 px) for soft, seamless edges

      • Context-from-mask extend factor (1.20) so the model sees enough surroundings

      • Output resized to a 1024x1024 target with padding, running on GPU

    • If/Else switches let you choose the source image and generated mask, and a Preview Mask group is included for checking the crop before you generate.

    • Extend for outpainting is available (extend up/down/left/right factors), and the AnyPaint Prepare node lets you set left/top/right/bottom values when outpainting.

    2. Krea2 AnyPaint generation

    • Load Diffusion Model, CLIP and VAE supply the base models.

    • Load LoRA: the AnyPaint LoRA (krea2_anypaint_rank32.safetensors, strength 1.00).

    • Power Lora Loader (rgthree): optional extra LoRAs. The style LoRA snofs_krea_v1_6 is enabled at 0.75 here, while the anatomy and detail LoRAs in the list are toggled off. Turn them on only as needed.

    • Krea2 AnyPaint Encode: takes your prompt plus the image and mask as references (semantic reference, known image, keep mask).

    • Krea2 AnyPaint Model Patch (KV cache on) speeds up generation.

    • Differential Diffusion (strength 1.00) lets the mask act as a soft, graduated edit strength.

    • Negative: leave empty.

    • KSampler: 8 steps, CFG 1.0, euler / simple, denoise 1.00, seed set to increment.

    3. Stitch into original

    • VAE Decode converts the result, and Inpaint Stitch pastes the new region back into the original full-size image.

    • Switch: final image lets you pick the stitched output or the raw one.

    • Save Image writes the file with a date-based filename prefix.

    • Image Compare (slider, side-by-side, difference, toggle) gives an instant before/after of the original against the edit.

    Models used

    TypeFileDiffusion model[Krea2 model name + link]CLIP / text encoder[name + link]VAE[name + link]AnyPaint LoRAkrea2_anypaint_rank32.safetensors [link]Style LoRA (optional)snofs_krea_v1_6 [link]

    Required custom nodes

    Install via ComfyUI Manager:

    • ComfyUI-Inpaint-CropAndStitch (Inpaint Crop / Stitch)

    • Krea2-AnyPaint nodes (Encode, Prepare, Model Patch)

    • rgthree-comfy (Power Lora Loader)

    • Deno custom nodes (Image Compare)

    How to use

    1. Load the workflow and download the models above.

    2. In the first group, load your image and paint a mask over the area to change.

    3. Write what you want in the AnyPaint Encode prompt box, describing only the new content.

    4. Run the workflow and check the result in Image Compare.

    5. If the edges are visible, raise mask_blend_pixels or mask_expand_pixels. If the result lacks context, raise context_from_mask_extend_factor.

    Tips

    • Keep the mask a little larger than the object you're adding or replacing for cleaner blending.

    • Change the seed (or leave it on increment) to get new variations of the same edit.

    • Leave the negative prompt empty; at CFG 1.0 it isn't used.

    • For outpainting, enable extend_for_outpainting and set the extend factors or the AnyPaint Prepare edge values.

    • Toggle the optional LoRAs off if you want a neutral edit that stays true to the source.

    Notes

    • Example images were generated with [settings / seed].

    • Please tag mature content appropriately and follow Civitai's content rules.

    Feedback welcome. If something breaks, tell me your ComfyUI version and which node errored.

    Description

    Workflows
    Krea 2 Turbo

    Details

    Downloads
    61
    Platform
    CivitAI
    Platform Status
    Available
    Created
    11/26/2026
    Updated
    11/27/2026
    Deleted
    -

    Files

    krea2_anypaint_inpaint_outpaint_v4.json

    Mirrors