FLUX.2 Klein 4B and LanPaint for Swap Clothes
Replace clothes using the Flux.2 Klein 4B
Clothes Swap
Flux
Flux.2 Klein
Image Editing
LanPaint
4
597
Nodes & Models
UNETLoader
flux-2-klein-4b.safetensors
CLIPLoader
qwen_3_4b.safetensors
PrimitiveFloat
VAELoader
flux2-vae.safetensors
LoadImage
CLIPTextEncode
ImageScaleToTotalPixels
VAEEncode
ConditioningZeroOut
SetLatentNoiseMask
ReferenceLatent
VAEDecode
GetImageSize
FluxGuidance
EmptyFlux2LatentImage
ComfySwitchNode
SaveImage
ImageConcanate
Anything Everywhere
LanPaint_KSampler
Flux 2 Klein 4B clothes swapping with LanPaint inpainting. Upload a portrait, upload a garment reference, describe the swap, get the result.
The workflow reads Image 1 as the subject and Image 2 as the clothing reference. Klein 4B handles the edit: it replaces the outfit, matches the lighting and texture from the reference, and leaves the face, pose, and background intact. LanPaint keeps the inpainting area clean, so there are no hard edges where the new clothes meet the body.
No manual masking required. No inpainting prompts to tune. Text instruction plus two images.
How do you use Flux 2 Klein 4B with LanPaint for clothes swapping?
Upload your subject photo to Image 1, upload the garment reference to Image 2, and describe the swap in the prompt. Flux 2 Klein 4B reads both images together and replaces the outfit while keeping the face, pose, and background locked. LanPaint handles the inpainting boundary so edges blend cleanly.
Image 1 (subject) Your portrait or full-body shot. The person whose outfit you want to change. Face, pose, lighting, and background are all preserved from this image.
Image 2 (garment reference) A photo of the clothing you want to put on the subject. A catalog shot, lookbook image, or product photo all work. The model reads color, texture, cut, and structure from the reference. The more clearly the garment is visible, the tighter the match.
Prompt Describe the swap in plain language. The default prompt ships as: "Replace the clothes in Image 1 with the red t-shirt from Image 2, while keeping the colors consistent." That structure works well: name which image is the source, name what to swap, specify what to preserve.
Tips for prompts that work: Name which image holds what: "the dress from Image 2," "the person in Image 1." Specify what to keep: "while keeping the background unchanged," "preserving the original lighting." For multi-piece outfits, describe each item: "replace the top and trousers with the suit from Image 2." For color accuracy: "keep the exact color from Image 2" or "match the garment color."
Guidance (default: 4) Controls how closely the output follows your prompt. 4 is the default and works well for most swaps. Want the garment reference to dominate more precisely? Go higher. Need more natural variation or softer blending? Go lower.
Megapixels (default: 2MP) Sets output resolution. 2MP is the default, which gives you a sharp, high-res output. Lower it to speed up test runs before committing to the final resolution.
Steps (default: 4) LanPaint KSampler is set to 4 steps by default. Klein 4B is distilled for fast inference, so 4 steps is enough for production-quality output. Increase to 8 if you want finer detail at higher megapixels.
Disable Inpainting switch Enabled by default. When on, LanPaint applies full inpainting to the clothing region, giving clean edges and natural fabric integration. Turn it off if you want to see the base Klein 4B output without the inpainting pass for comparison.
What is Flux 2 Klein 4B + LanPaint good for?
Flux 2 Klein 4B with LanPaint is built for outfit swaps where the subject's identity, pose, and scene must stay intact. Feed a portrait and a garment reference, describe the swap, and get clean results without manual masking. Strongest for e-commerce, lookbook generation, and character outfit iteration.
E-commerce and product photography get the clearest wins. Put a catalog garment onto a model photo without a photoshoot. Swap the same outfit across multiple model shots. Generate color variants of a product on-figure without reshooting. The model reads garment structure from the reference and fits it to the subject's proportions.
For character design and lookbook work, the multi-reference setup handles outfit iteration fast. Upload the same character shot and cycle through different garment references to build a wardrobe. Klein 4B is distilled for low latency, so iteration is quick on consumer GPUs.
The LanPaint inpainting layer is what separates this from standard Klein 4B edits. Standard image editing can leave hard edges where the new clothing meets skin or background. LanPaint reconstructs the boundary so the garment looks like it belongs in the scene, matching the original lighting and blending naturally at the edges.
The tradeoff: Klein 4B is a 4B parameter model. For fine fabric texture detail (lace, embroidery, complex patterns), the 9B model produces more precise reproduction. For most catalog garments, solid colors, and standard clothing categories, 4B is fast and accurate.
How does Flux 2 Klein 4B compare to Klein 9B for clothes swapping?
Klein 4B is faster and lighter than Klein 9B. For most clothes swap tasks, the quality gap is small and the speed gain is worth it. Klein 9B produces finer texture detail on complex fabrics and handles more difficult lighting scenarios. Use 4B for iteration and production at scale; reach for 9B when fabric detail is the priority.
Klein 4B runs on consumer GPUs with less memory pressure and completes in fewer steps. If you're cycling through multiple garment references to find the right fit, 4B lets you do that quickly. The face, pose, and background preservation is comparable between both models.
Klein 9B handles more demanding cases: highly detailed fabrics, hard lighting mismatches between source and target, and cross-style swaps (putting a garment reference from one aesthetic onto a stylistically different subject). If your source and target images have significantly different lighting or the fabric has fine structure you need accurately reproduced, 9B is the stronger pick.
FAQ
How does Flux 2 Klein 4B clothes swapping work with LanPaint?
Image 1 is the subject, Image 2 is the garment reference. Klein 4B reads both and applies the outfit swap guided by your prompt. LanPaint handles the inpainting boundary, blending the new clothing into the scene without hard edges. No manual masking required.
What garment reference images work best with Klein 4B?
Clean, well-lit catalog or product shots where the garment is clearly visible. Front-facing shots give the model the most detail to work from. The model reads color, texture, and cut from the reference, so the clearer the garment, the tighter the match in the output.
Does Klein 4B preserve the face and background during a clothes swap?
Yes. The workflow is designed to change only the clothing region. Face, pose, hair, and background stay locked from Image 1. LanPaint limits the edit area to the outfit, and the prompt structure reinforces this by explicitly naming what to keep.
When should I use Klein 9B instead of Klein 4B for clothes swapping?
When fabric texture detail matters (lace, embroidery, complex patterns), when there's a strong lighting mismatch between your subject and garment reference, or when you're doing cross-style swaps. For standard catalog garments and iterative outfit testing, 4B is fast and accurate enough.
How do I run Flux 2 Klein 4B + LanPaint for clothes swapping online?
You can run this workflow online through Floyo. No installation, no setup. Open the workflow in your browser, upload your two images, and hit run. Free to try.
Read more




