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
Image to Image
virtual try-on
6
1.4k
Nodes & Models
UNETLoader
flux-2-klein-4b.safetensors
CLIPLoader
qwen_3_4b.safetensors
VAELoader
flux2-vae.safetensors
LoadImage
SaveImage
LanPaint_KSampler
ImageConcanate
HOW IT WORKS
Step 1. Upload your two images Put the person in Image 1 and the clothing you want to use in Image 2. A clear shot of the person and a clean reference of the garment give the best swap. Works great with: full or half-body shots · a clear garment reference
Step 2. Mask the clothes to replace Brush over the clothing on Image 1, right in the image box. This tells the model which part of the photo to repaint. Cover the whole garment with a solid stroke.
Step 3. Describe the swap Write a short prompt naming what to replace and what to replace it with, like "replace the shirt with the red t-shirt from Image 2, keep the colors consistent."
Step 4. Run and compare LanPaint paints the new clothing into the masked area and keeps the rest of the photo unchanged. You get the original and the result side by side to compare. Ready for: Photoshop · Figma · Canva · any editor
First time? Leave every setting as-is. The defaults (4 steps · CFG 1 · random seed · Image First mode) are the right starting point for almost everyone.
RECOMMENDED SETTINGS
Quick-start guide. Find the goal that matches yours and copy the settings.
Standard swap (most people) Start here — Mask the garment, write one clear prompt, leave the rest. The right starting point for almost everyone.
Mask edges look rough or haloed — Use a clean, solid mask. Brush fully over the garment with a hard edge and no feathering. LanPaint works from a binary mask, so soft edges get converted and can bleed.
The swap spills outside the clothing — Tighten the mask to the garment alone and name what to keep in the prompt, like "keep the face, hair, and hands unchanged."
Match the reference garment closely — Describe it in the prompt: color, sleeve length, pattern, fit. The more you name, the harder the model leans on Image 2.
Reproduce a result you liked — Lock the seed to the number that produced it. Same seed, same mask, and same prompt gives you the same swap again.
Result looks over-processed — Keep CFG at 1. Flux 2 Klein is a distilled model that runs without classifier-free guidance, and raising CFG breaks LanPaint's Image First mode on Flux.
Prompt: Name the clothes to replace and what to replace them with. Keep it short and concrete. "Replace the jacket with the denim jacket from Image 2" reads better than "change the outfit."
Steps: 4 is the sweet spot. Flux 2 Klein is distilled to run in 4 steps, so raising the count adds time without much gain.
USE CASES
👗 Fashion & E-commerce Show one model in several outfits without a reshoot. Take a garment from a product photo and place it onto a model shot, then deliver the variations.
🛍️ Virtual Try-On Preview how a piece of clothing reads on a person from a single reference image. Good for catalog tests, fit previews, and pitch mockups.
🎨 Lookbooks & Concept Iterate outfit ideas on a fixed model for a lookbook or a client pitch. Keep the pose and setting, change only the clothing.
📸 Photo Editing Replace a branded or unlicensed garment with a clean one while the pose, lighting, and background stay put.
WHAT WORKS BEST / WHAT TO AVOID
✅ Works great
A clear, well-lit person shot
A clean garment reference in Image 2
A solid mask over the clothing to replace
Simple, describable garments
⚠️ May produce softer results
Heavily patterned or reflective fabrics
Clothing hidden by arms, hair, or props
Soft or feathered masks
Loose prompts with no garment detail
NEW TO COMFYUI?
Start with the free ComfyUI for Beginners Course on Floyo. Sixteen short videos take you from zero to running your own AI workflows. No setup headaches, no jargon, clear hands-on lessons. Watch the course, then run any workflow here in your browser.
👉 Watch the free ComfyUI for Beginners Course →
FAQ
What is FLUX 2 Klein? FLUX 2 Klein is the fastest model in Black Forest Labs' FLUX.2 family. The 4B version used here is open under the Apache 2.0 license, runs on a consumer GPU, and is distilled to generate in about 4 steps, which is what gives it sub-second speed. It handles text-to-image, editing, and reference-based generation in a single model.
What is LanPaint and why is it in this workflow? LanPaint is a training-free inpainting method that lets almost any model repaint a masked region without a dedicated inpainting checkpoint. It runs extra "thinking" steps during sampling so the repainted area stays consistent with the rest of the image. Here it does the work of placing the new garment into the masked area while holding the original photo steady.
Do I need to mask the clothes I want to swap? Yes. Brush over the garment on Image 1 so the model knows which region to repaint. Use a solid, hard-edged stroke that covers the whole piece. LanPaint expects a clean binary mask, so avoid soft or feathered edges, which can cause bleeding at the boundary.
How is this different from a dedicated virtual try-on model? Try-on models are trained specifically to fit a garment to a body and often need garment segmentation and pose maps. This workflow is more flexible: it is general inpainting guided by your mask, a reference image, and a prompt. That means it handles more than clothing, but you control the result through the mask and prompt rather than an automatic fit step.
Can I use the results commercially? Yes. FLUX 2 Klein 4B is released under the Apache 2.0 license, which permits commercial use, and images you generate on Floyo carry full commercial rights. You can use the swapped results in catalogs, listings, client work, and shipped projects.
Why does my output show two images side by side? That is by design. The workflow stitches the original photo and the swapped result into one before-and-after frame so you can judge the change against the source. If you only want the final image, save the right-hand side or adjust the workflow to skip the join step.
How to run FLUX 2 Klein and LanPaint online? You can run FLUX 2 Klein and LanPaint online through Floyo. No installation, no setup, no GPU to rent. Open the workflow in your browser, upload your two images, mask the clothing, write a prompt, and hit run. Free to try.
WHY FLOYO?
Floyo is the only platform with team collaboration for ComfyUI in the browser. You run workflows with no install. You share run history, assets, and models across your team. You pay only when you generate. Floyo supports open-source and closed-source models.
A designer runs a swap and likes the result. A teammate opens that exact run from shared history and keeps going. No file handoffs. No version confusion.
For studios and enterprise teams, Floyo adds private workspaces, pooled resources, and a team usage dashboard. Other ComfyUI cloud tools run for one person at a time. Floyo runs for the whole team, with transparent per-generation costs.
Ready to try it? Upload your two images and run it. Mask the clothes, write a short prompt, and the rest is set.
Questions? Watch the free course or check the FAQ above.
Read more









