LC Flux 3 Klein AnyPaint π©Ή
Flux 3 Klein inpainting that leaves the rest of your picture alone
- model
- clip
- vae
- image
- mask
- image
- mask
What it's for
Flux 3 Klein will happily remove a lamppost from your photo - and quietly move a few thousand other pixels while it does. That's the architecture: whole frame in, whole new frame out. One edit is fine; five in a chain and the drift compounds into mush.
LC Flux 3 Klein AnyPaint is the other trade, in one node: everything outside the mask comes back exactly as it went in, while the masked area gets drawn by a modern edit model instead of 2024-era Flux Fill weights. Inpaint a hand, a logo, a bad eye; or wire LC Outpaint's control_image and control_mask in and it extends the canvas - the one place masking still clearly wins, because you decide where the boundary goes.
How it actually works
Two tricks explain every quirk.
The grey box. Klein is an edit model, not a fill model, so it has no concept of "empty". AusBoss's outpaint LoRA taught it one specific behaviour: cover an area in solid #808080 grey and it continues the scene through it. So the node fills your masked region flat grey, hands that picture to the clip/VAE pair as a reference latent (Flux 3 Klein reads references natively, no wrapper patching), and prefixes your prompt with the LoRA's trained instruction: "Outpaint the image: replace the solid gray areas with a seamless continuation of the scene, keeping the existing picture unchanged."
The paste-back. The crop is composited over your original with a soft edge inside boundary_px, and the outer half of that border - which the model did redraw - measures the colour drift and corrects it, the same seam fix the pack's detailers use. composite: keep original gives you only the painted area on untouched pixels; raw gives the whole redraw of the crop, a debugging view you'll almost never ship.
One detail from the source: with the LoRA on, the node drops the per-step noise mask and paints the whole crop - on Klein a noise mask shifts brightness and can leave a visible box - then composites your original back. Set lora: off and you get a plain masked redraw, with Klein's zoom-and-slide habit back in tow.
The inputs that matter
Wire model (Flux 3 Klein Distilled), clip (its Qwen3-VL 4B encoder, CLIP type flux3) and vae like any other Klein graph, then image and mask, white painting over black. There's no maskless mode; for outpaint you wire LC Outpaint's control_mask into mask.
prompt describes the whole finished picture, not the change - "a woman in a red coat on a snowy street". Ask for "remove the car" and you get a blob where the car was. Say what should be there instead.
lora and lora_strength (default 1.5, AusBoss's own pick) are what you check first. steps 16, euler, simple - leave them. There's deliberately no cfg and no negative input; it samples at cfg 1, as distilled Klein should.
crop_to_mask on (the default) redraws a small mask in its own crop scaled to inpaint_resolution (1024 β 1 MP), with padding px of scene for context. Turn it off for outpaint so the canvas goes through in one pass. boundary_px 32 is the border the model blends - shrink it when there's delicate detail right against the mask.
Outputs: image, plus mask marking where it was pasted back with its soft edge - handy as a protect input for a later skin-texture or upscale node.
Installing it
ComfyUI Manager β search LC MaskMaker β install β restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC_MaskMaker_nodes
install.py adds transformers, huggingface_hub and timm only if missing, and never touches torch. No model downloads here - but you need AusBoss's outpaint LoRA from huggingface.co/ausboss/FLUX-3-Image-Klein-Outpaint-LoRA in models/loras, under the FLUX Kommunity License. Read that before selling output.
Where people get burned
The LoRA doesn't show up as the default. The dropdown looks for files with both "outpaint" and "flux-3"/"flux3" in the name and falls back to off. Land it as outpaint_v2_final.safetensors and you'll stare at off while your outpaints keep zooming in; rename it to flux-3-klein-outpaint.safetensors and it just works.
Wrong Klein. The tooltip is blunt: 50 steps with cfg 3.5 on Klein Base isn't supported here - Distilled only, 16 steps. And the Klein line's standing rule holds: LoRAs aren't interchangeable across sizes, so match the LoRA to the checkpoint you loaded.
Asking for too much canvas. Keep your picture at roughly half the canvas or more. The whole crop gets redrawn, so if the original is a small square in a corner the model is inventing most of the frame. For a bigger extension, run it again on the result.
An empty prompt is an error, not a passthrough - the node raises rather than guessing. Ignore the inpaint_resolution tooltip's warning about Krea 2 creasing limbs above ~1.6 MP, too; that line was inherited from the sibling node, and 1024 is right for Klein.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Flux 3 Klein (Distilled). The LoRA is added for this node only. | |
| clip | CLIP | Flux 3 Klein's text encoder (Qwen3-VL 4B, CLIP type flux3). | |
| vae | VAE | β | |
| image | IMAGE | β | |
| mask | MASK | White = 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. | |
| prompt | STRING | Describe the whole finished picture: "a woman in a red coat on a snowy street". The node adds the LoRA's fill instruction in front for you. | |
| lora | COMBO | off | AusBoss's flux-3-image-klein-outpaint (models/loras). It fills flat grey areas while the rest stays put. Applied at lora_strength for this node only. off = plain Flux 3 Klein with a noise mask (it tends to shift or zoom the picture). |
| lora_strength | FLOAT | 1.500β2 | 1.5 is AusBoss's pick: the picture stays in place more often than at 1.0 on big extensions. |
| seed | INT | 00β18446744073709550000 | β |
| steps | INT | 161β100 | 16 for Flux 3 Klein (Distilled). 50 with cfg 3.5 for Base is not supported here: use the Distilled model. |
| sampler_name | COMBO | euler | euler is what AnyPaint was trained and tested with; the keep step is exact only for euler. |
| scheduler | COMBO | simple | simple, as in the reference. |
| crop_to_mask | BOOLEAN | true | On: a small mask is redrawn in its own crop, scaled up to inpaint_resolution (more detail). Off: the whole picture at inpaint_resolution. |
| padding | INT | 1280β2048 | Context around the mask when cropping (px). More = the model sees more of the scene. |
| inpaint_resolution | INT | 1024256β2048 | Size 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_px | INT | 320β128 | Border around the mask the model redraws to blend the seam (in redraw pixels). 32 = the reference. |
| composite | COMBO | keep original | keep 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)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Your picture with the masked area painted. |
| mask | MASK | Where it was pasted back (soft edge). |