Nodes/ComfyUI LC MaskMaker Nodes/LC Krea2 AnyPaint 🩹
ComfyUI Node

LC Krea2 AnyPaint 🩹

Krea 2 Inpainting That Leaves the Rest of the Picture Alone

By lonecatone23·Created about a month ago·Updated about 13 hours ago· 11
LC Krea2 AnyPaint 🩹
  • model
  • clip
  • vae
  • image
  • mask
  • image
  • mask
◄prompt►
◄lora►
◄lora_strength1.00►
◄seed0►
◄steps8►
◄sampler_nameeuler►
◄schedulersimple►
◄crop_to_masktrue►
◄padding128►
◄inpaint_resolution1024►
◄boundary_px32►
◄vlm_referencetrue►
◄compositekeep original►

Here's the awkward gap Krea 2 left. It's the default open base for training and for stylized work as of mid-2026 - 12B, natural-language prompting, Turbo at 8 steps - and there is no inpainting checkpoint for it, and no FLUX.1 Fill equivalent. So the mask-based workflow everybody still wants for the cases where nothing outside the mask may change (bit-identical unmasked pixels, local detail at full resolution, a denoise dial instead of a yes/no instruction) has to be built on the base model itself.

This node is one attempt at that, using yijunwang2's AnyPaint LoRA for Krea 2. Worth knowing up front: on its own, the LoRA does very little. It was trained against a specific runtime, and the runtime is this node - a whole-canvas reference, the kept pixels forced back every step, and a border the model gets to blend.

How it actually works

The node's own docstring is the honest description, and it matches the code.

A reference is built from your picture: the kept pixels stay as they are, the area to paint gets filled with the median colour of the kept pixels, and the whole thing is shrunk to a 384px edge. That goes in as a reference latent at timestep zero - and, with vlm_reference on, it's also shown to the text encoder, since Krea 2's encoder is Qwen3-VL 4B and can look at pictures. Its tokens are spread over the full canvas and isolated from each other, matching training.

Then the keep: after every step, every latent token whose pixels all sit outside the mask grown by a border is put back exactly. That's the trick that makes the claim true - with euler, the kept pixels come back unchanged. The border (boundary_px, 32 by default, in redraw pixels) is deliberately left to the model to blend into.

Finally the composite: the redraw is pasted back with a soft edge inside that border, and the colour drift measured in the outer half of the border - where the true colour is known because it was redrawn but isn't pasted back - is spread as a smooth field and subtracted. That seam fix is the same one LC Smart Detailer uses. composite set to raw skips all of it and hands you the model's whole redraw of the crop.

Sampling is hardcoded to cfg 1.0 and denoise 1.0 with a noise mask, because that's what the LoRA was trained for. The whole prompt is described, not the change.

The inputs that matter

model, clip (Krea 2's text encoder) and vae. image and mask - white paints, black keeps - arrive on the canvas labelled control_image and control_mask so LC Outpaint or LC Image Rotate + Pad wire straight in. prompt must describe the whole finished picture ("a woman in a red coat on a snowy street"), not the edit; a removal-only prompt like "remove the car" tends to leave a flat blob. lora picks the AnyPaint file (the dropdown floats anything with "anypaint" in the name to the top and defaults to it - name it that way). lora_strength at 1.0 is the trained value.

Then: steps 8, sampler_name euler, scheduler simple. Leave those alone unless you like re-learning what the LoRA saw. crop_to_mask on for inpaint (the area is redrawn in its own crop) and off for outpaint, padding at 128 for context, inpaint_resolution at 1024 - this is an area, roughly one megapixel, and the pack's author notes that above about 1.6MP Krea 2 starts creasing limbs and darkening skies. boundary_px 32 is the reference value. vlm_reference on is the reference recipe.

Outputs are image (your picture with the masked area painted) and mask (where it got pasted back, soft edge).

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC_MaskMaker_nodes
# restart ComfyUI

ComfyUI Manager: search "LC MaskMaker", pack ComfyUI_LC_MaskMaker_nodes. Models are never bundled: download the AnyPaint LoRA from yijunwang2/krea2-anypaint (krea2_anypaint_rank32) into ComfyUI/models/loras. The LoRA is applied for this node only, on a cloned model, so your other Krea 2 nodes are unaffected. The pack's installer just makes sure transformers and huggingface_hub are importable.

Gotchas

An empty prompt raises rather than painting something random - read the error, it tells you what to write. Same if steps ends up 0, which usually means you wired the wrong output into it.

The keep is exact with euler; other samplers will still run, but the guarantee is the thing you're paying for, so don't spend it. And if you're outpulling canvas rather than filling a hole, crop_to_mask off - outpaint wants the whole frame at inpaint_resolution, not a crop around the new edge.

Licensing, since it's a two-part stack: Krea 2 is under the Krea 2 Community License (free commercially below $1M trailing-twelve-month revenue, and you run your own filters - the open weights are the aligned variant, so expect refusals on some prompts). The LoRA is a third party's release; check its card before you ship anything commercial. The pack itself is MIT.

CategoryLC MaskMaker/inpaint

Inputs (18)

NameTypeDefaultDescription
modelMODELKrea 2 (Turbo). The LoRA and patches are added for this node only.
clipCLIPKrea 2 text encoder (Qwen3-VL 4B, CLIP type krea2).
vaeVAE—
imageIMAGE—
maskMASKWhite = paint, black = keep. Optional: no mask with LC Outpaint's canvas uses its mask. Wire LC Outpaint's control_image as the image and control_mask as the mask to outpaint.
promptSTRINGDescribe the WHOLE finished picture, not just the change: "a woman in a red coat on a snowy street". Removal-only prompts ("remove the car") tend to leave a flat blob.
loraCOMBOyijunwang2's krea2_anypaint_rank32 (models/loras). Applied at lora_strength for this node only.
lora_strengthFLOAT1.000–21.0 is what it was trained for.
seedINT00–18446744073709550000—
stepsINT81–1008 (Krea 2 Turbo). The keep is exact with euler.
sampler_nameCOMBOeulereuler is what AnyPaint was trained and tested with; the keep step is exact only for euler.
schedulerCOMBOsimplesimple, as in the reference.
crop_to_maskBOOLEANtrueOn: a small mask is redrawn in its own crop, scaled up to inpaint_resolution (more detail). Off: the whole picture at inpaint_resolution.
paddingINT1280–2048Context around the mask when cropping (px). More = the model sees more of the scene.
inpaint_resolutionINT1024256–2048Size of the redraw (as an area: 1024 = about 1 MP). AusBoss found above about 1.6 MP Krea 2 starts to crease limbs and darken skies.
boundary_pxINT320–128Border around the mask the model redraws to blend the seam (in redraw pixels). 32 = the reference.
vlm_referenceBOOLEANtrueShow the reference to the text encoder too. On = the reference recipe.
compositeCOMBOkeep originalkeep original = only the painted area (soft edge, colour fixed) is pasted back: everything else is exactly your picture. raw = the model's whole redraw of the crop.

Outputs (2)

NameTypeDescription
imageIMAGEYour picture with the masked area painted.
maskMASKWhere it was pasted back (soft edge).