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

LC SDXL AnyPaint 🩹

Inpaint and outpaint any SDXL checkpoint without an inpaint model

By lonecatone23·Created about a month ago·Updated a day ago· 18
LC SDXL AnyPaint 🩹
  • model
  • clip
  • vae
  • image
  • mask
  • image
  • mask
◄prompt►
◄negative►
◄controloff►
◄control_strength1.00►
◄fooocus_inpaintoff►
◄seed0►
◄steps25►
◄cfg5.0►
◄sampler_namedpmpp_2m►
◄schedulerkarras►
◄crop_to_masktrue►
◄padding128►
◄inpaint_resolution1024►
◄boundary_px32►
◄compositekeep original►

SDXL isn't dead - Pony and Illustrious forks are still what plenty of people render with - but its inpainting story has always been the annoying part. You either load a dedicated inpaint checkpoint that's mediocre at everything else, or you do the masked-VAE-encode dance and live with the seam and the colour halo. LC SDXL AnyPaint takes the machinery from the pack's Krea 2 AnyPaint node and points it at any SDXL checkpoint you like. No LoRA, no inpaint model.

What it's actually doing

Three mechanisms stack, and knowing them tells you which knob to turn.

The kept pixels are pinned every step. The workflow where you just VAE-encode a masked image, denoise, and decode is where seams come from. Here the mask is turned into a per-step noise mask (grown by boundary_px), and samples outside it are restored each step from your original picture. Everything outside the mask comes back as your file, not as a re-encode of your file.

The starting latent is filled from around the hole, not from the masked grey. For SDXL the crop is Telea-filled before encoding, so even at full denoise the painted area starts from the colours that surround it. That's why "remove the car" doesn't come back as a flat blob.

Structural guidance comes from xinsir's ControlNet Union, in repaint mode. The node loads your union file, forces the repaint condition type (type 7 on ProMax), and feeds it your picture with the painted area blacked out at control_strength - that's what holds edges, light and perspective while the hole is filled. Prefer Fooocus's inpaint patch for the blending instead? fooocus_inpaint greys the area (mask + border) to 0.5 and hands it to INPAINT_ApplyFooocusInpaint from Acly's pack. Fooocus blends beautifully and matches surrounding colour, but it rebuilds what was there more than it invents new objects.

Around that: crop_to_mask redraws a small mask in its own crop at inpaint_resolution (with padding context around it) instead of re-rendering the whole frame; composite: keep original pastes back only the painted area with a soft alpha and a seam colour match, while raw gives you the whole redraw. Inpaint vs outpaint is just where the mask came from.

The settings that matter

  • prompt - short and about the mask: "a red bucket full of fish on the pier". To remove something, describe what belongs there instead. Empty is legal and fills from the surrounding picture; leave the prompt empty on an outpaint and you'll get mush, though.
  • negative / cfg - SDXL uses both properly. Defaults are 25 steps, cfg 5, dpmpp_2m / karras, and those defaults are right for a normal checkpoint. Lightning/DMD models want far fewer steps and cfg 1–2.
  • control_strength - this is the one that bites. 1.0 for inpaint, because the mask is surrounded by your picture and the union holds the light through the hole. On outpaint, drop to about 0.2: at 1.0 the straight edge of your old picture reads to SDXL as a real edge and it dutifully paints a window frame, a fence, or a line along the seam. With fooocus_inpaint on, drop to about 0.5 as well - Pony and Illustrious go to noise at 1.0 with both active. A boolean and two float nodes into control_strength will switch it for you off your inpaint/outpaint toggle.
  • mask - optional. For outpaint you wire LC Outpaint's control_image into image and its control_mask into mask; the canvas comes with its own mask anyway.
  • inpaint_resolution - the redraw's area in pixels. Above ~1.6 MP it starts creasing limbs and darkening skies, so don't treat it as a quality dial.

Outputs are image (your picture with the masked area painted) and mask (where it was pasted back, soft edge - useful downstream as a protect region).

Install

ComfyUI Manager, search ComfyUI LC MaskMaker Nodes, or cd ComfyUI/custom_nodes && git clone https://github.com/lonecatone23/ComfyUI_LC_MaskMaker_nodes, then restart. The pack's install.py only adds transformers, huggingface_hub and timm if they're missing.

Then the models, and this is the part to read once:

# ControlNet: xinsir/controlnet-union-sdxl-1.0  →  models/controlnet
#   the ProMax file is the one the dropdown sorts to the top
# Fooocus inpaint (optional): lllyasviel/fooocus_inpaint  →  models/inpaint
#   keep fooocus_inpaint_head.pth beside the .patch file

Fooocus also needs Acly's ComfyUI Inpaint Nodes installed - the node will say so by name if it's missing.

Where people get burned

  • Both control and fooocus_inpaint off is an error, not a fallback. With both off it'd be a plain masked redraw that ignores your picture, so it refuses.
  • Wrong architecture. Feed it a Flux or Krea checkpoint and it stops with a message pointing you at LC Krea2 AnyPaint or LC Z-Image AnyPaint. It wants a 4-channel latent.
  • steps is 0. That error usually means something got wired into steps, often a detailer's settings output.
CategoryLC MaskMaker/inpaint

Inputs (20)

NameTypeDefaultDescription
modelMODELAny SDXL checkpoint. The inpaint patch is added for this node only.
clipCLIPThe checkpoint's CLIP.
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 what goes in the mask, short: "a red bucket full of fish on the pier". To remove something, describe what should be there instead ("empty wooden planks"). Empty works too: it fills from the picture around the mask.
negativeSTRINGWhat you don't want. SDXL uses a real negative prompt.
controlCOMBOoffxinsir's ControlNet Union SDXL ProMax (models/controlnet), used in repaint mode: it holds edges, light and perspective to your picture. off = Fooocus inpaint only.
control_strengthFLOAT1.000–2How strongly the ControlNet holds the painting to your picture. Lower = more freedom inside the mask.
fooocus_inpaintCOMBOoffOptional. lllyasviel's Fooocus inpaint patch (models/inpaint, with fooocus_inpaint_head.pth next to it). Blends best and matches the colours around it, but rebuilds what was there more than it adds new things. Good for outpaint and fills. With the ControlNet on too, drop control_strength to about 0.5 (Pony / Illustrious turn to noise at 1). Needs Acly's comfyui-inpaint-nodes.
seedINT00–18446744073709550000—
stepsINT251–10025 - 30 for a normal SDXL checkpoint, fewer for Lightning / DMD ones (then cfg 1 - 2).
cfgFLOAT5.00–30SDXL cfg. 4 - 6 for most checkpoints.
sampler_nameCOMBOdpmpp_2m44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBOkarras9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
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.
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).