Krea 2 Inpaint Edit LoRA: Masked Edits With ComfyUI Workflows

ComfyUI Wikinews

A Krea-2-Raw LoRA that repaints the black-masked region of an image from a text prompt, in mild, default and strong variants, with four example ComfyUI workflows.

krea2-inpaint-edit (Hugging Face) is a set of community LoRAs for Krea-2-Raw that turn masked editing into inpainting: fill the region you want to change with solid black, describe what should go there, and the model repaints that area while leaving the rest of the image alone. Cierpliwy published the weights on September 24, with three strength variants and four example ComfyUI workflows.

Masked editing is what Krea 2 already does when you hand it a reference and an instruction. This LoRA narrows the job down to the mask: the black area is the only thing that moves, and everything outside it is treated as fixed context. The repository compares its results against the earlier yijunwang2/krea2-anypaint adapter, column by column, with per-row difference maps.

Comparison of masked image, this LoRA and krea2-anypaint

Columns show the masked input, this LoRA's result and the krea2-anypaint adapter, with difference maps per row.

Three strength variants

FilePurpose
krea2_inpaint_edit.safetensorsDefault strength
krea2_inpaint_edit_mild.safetensorsMakes fewer changes outside the mask, and handles masks that cover the main subject better
krea2_inpaint_edit_strong.safetensorsBetter at outpainting, and adapts more strongly to the prompt

All three go into ComfyUI/models/loras/.

What you need

kv_cache has to be turned on in the Krea2OstrisEditModelPatch node. It is off by default, and masked editing comes out wrong without it.

The example workflows use only the ComfyUI-Krea2-Ostris-Edit nodes plus stock ComfyUI and comfy_extras nodes.

Quick start

  1. Download the strength variant you want into ComfyUI/models/loras/.
  2. Mask the image: paint the region to regenerate with solid black. The mask can cover part of the image or all of it.
  3. Load an example workflow (Workflow → Open).
  4. Connect your masked image to the image1 input of the inpaint TextEncodeKrea2OstrisEdit node, the one after the LoRA loader, replacing the reference the workflow feeds it by default.
  5. Write a prompt describing what should appear in the masked region.
  6. Confirm kv_cache is enabled on Krea2OstrisEditModelPatch, then queue the prompt.

Four example workflows

Each workflow first generates a base image with stock Krea-2, builds the black-masked reference from it, then runs the inpaint LoRA to fill the black region.

WorkflowWhat it doesExtra models
OutpaintPads the image onto a larger black canvas and extends the scene into the borderNone
Background replacementCuts out the subject and inpaints a new background behind itbirefnet.safetensors in models/bg_removal/
MoGe rotate inpaintEstimates geometry with MoGe-3, rotates the mesh and inpaints the scene around the new viewpointmoge_3_vitl_fp16.safetensors in models/geometry_estimation/
SAM 3 detectDetects a subject from a text description, moves it onto black and inpaints a new backgroundsam3.safetensors in models/checkpoints/

If you change the base generation size or the canvas size in any of these graphs, keep the composite offsets and canvas dimensions in sync.

Comments

Sign in with GitHub to join the discussion.

Loading comments…
Krea 2 Inpaint Edit LoRA: Masked Edits With ComfyUI Workflows | ComfyUI Wiki