To change clothes with Stable Diffusion inpainting, mask only the garment (a little past its edges, never the face or hands), describe the new clothing with its type, color, fabric, and fit, and generate several attempts at a strength high enough to replace the old one. On iPhone, PhoneDiffusion's Inpaint does this on-device: tap Select area, paint the clothing, describe the replacement, and move Replacement strength toward Replace more.
How to change clothes with inpainting: the short answer
Inpainting regenerates only the part of an image you mask and keeps the rest. Diffusers describes the mask simply: white pixels are repainted from the prompt and black pixels are kept. To change an outfit, that means painting over the clothes you want to replace, leaving the face, hair, hands, and background untouched, and writing a prompt for the new garment.
Expect to try a few times. Keep the attempt where the new clothing follows the body and the light, then repair any seams with a second, smaller pass. The steps are the same on iPhone and on desktop; only the names of the controls change.
Mask the clothing, not the person
Paint the whole garment and go slightly past its edges so the new piece can blend in. Leave the face, hands, and hair unpainted: anything inside the mask can change, and those are the hardest parts to get back. If the old garment casts a shadow that should change too, include it.
If the new piece is bigger than the old one, paint where the new one should be, not just the old one. A T-shirt cannot become a long coat if the arms and the area down to the knees stay outside the mask. For a smaller garment, paint the old one completely and describe what shows where it used to be, such as skin, a belt, or the background.
Painting by hand works well on a phone. On desktop you can also make the mask automatically: Segment Anything produces object masks from a click or a box, and the Inpaint Anything project combines it with Stable Diffusion so you click a garment and fill it from a text prompt.
Write a prompt for the new clothes
Describe the garment you want to see, not the change: its type, color, fabric, fit, and one or two details, for example ‘navy wool overcoat, knee length, notch lapels, buttoned’ or ‘white linen shirt, loose fit, sleeves rolled up’. ‘Change the shirt’ or ‘different clothes’ gives the model nothing concrete to draw.
Add the light and the pose that are already in the photo, such as ‘soft window light from the left, standing, arms at sides’, so the new fabric gets shadows and folds that match the rest of the image. In desktop tools that redraw only the masked area at full resolution, keep the prompt about the clothing and its light rather than the whole scene.
Choose the right strength
Strength (denoising strength in AUTOMATIC1111) decides how far the masked area may move away from the original. A recolor, such as a red sweater turned blue, works at a moderate strength that keeps the folds and shape. A different kind of garment needs a higher strength, or the old clothing shows through. AUTOMATIC1111's img2img default is 0.75.
AUTOMATIC1111 also asks what to start from in the masked area. Masked content ‘original’ (the default) keeps the old garment as the starting point, which helps when the shape stays similar; the other options (‘fill’, ‘latent noise’, ‘latent nothing’) start the masked area from a blurred fill or from noise instead and need a high denoising strength, which suits a new piece with a different silhouette. Dedicated inpainting checkpoints usually blend new content into the surroundings better than regular checkpoints.
PhoneDiffusion generates on-device on iPhone or iPad, with optional cloud models. Download on the App Store →
Keep the pose and the body intact
A large mask at high strength can also change the body under the clothes. If arms or posture start to drift, make the mask tighter, lower the strength one step, or split the job into two passes, such as the top first and then the trousers.
On desktop, ControlNet can lock the structure while the clothes change: ControlNet 1.1 includes an OpenPose model with body, hand, and face keypoints, and depth control keeps the overall shape. In ComfyUI, VAE Encode (for Inpainting) grows the mask by 6 pixels by default for a softer transition; Set Latent Noise Mask with a lower denoise keeps more of the original underneath.
Match a specific garment with a reference image
Text alone cannot copy an exact jacket or print. On desktop, IP-Adapter adds a reference image to the text prompt and works with the inpainting pipeline in Diffusers, so the masked area can take on the look of a garment photo. Its scale sets how strongly the reference counts: 1.0 is full strength and about 0.5 balances the text and the image.
Even with a reference, small logos, lettering, and exact patterns rarely come out identical. Treat the result as a close match, not a product photo of the real garment.
Fix seams and edges
A hard line where the new garment meets skin or background usually means the mask edge is too sharp or too tight. AUTOMATIC1111 softens the edge with Mask blur (4 pixels by default) and, with Inpaint area set to ‘Only masked’, redraws the masked region at full resolution with 32 pixels of padding around it.
For a leftover strip of the old garment or a seam at the collar, mask just that strip and inpaint it again with a short prompt describing what belongs there. Small second passes are faster and safer than redoing the whole outfit.
Edit people responsibly
Only change clothing in photos you have the right to edit, and get the person's permission before you edit a photo of someone else. Don't create sexualized images of real people, and don't present an edited photo as a real event. Label edited images when you share them where it matters.
PhoneDiffusion availability and article scope
PhoneDiffusion runs curated Core ML model packs (SD 1.5, SD 2.1, and SDXL) on supported iPhone and iPad devices with iOS 17 or later; local generation and editing are private and work offline once a pack is downloaded. It also offers optional cloud models, such as FLUX and Seedream, on paid monthly or yearly plans; those are text-to-image only, so changing clothes in an existing photo always uses local inpainting.
To change clothes in the app, open the image and choose Inpaint, then tap Select area. Paint the clothing with the Brush (red areas will be regenerated); Brush size and Edge softness adjust the stroke, Erase removes paint, and Invert swaps the painted and unpainted areas. Then describe the new clothing and set Replacement strength, which runs from Preserve more through Balanced to Replace more.
If you give a result a thumbs-down and choose ‘The painted area did not change enough’, the app suggests covering the whole object, moving Replacement strength toward Replace, and describing what should fill the area. For ‘The edit has seams or changed nearby details’, it suggests tuning Edge softness, describing the nearby light and material, and using a smaller brush or Erase near important edges. The app has no automatic garment selection, no ControlNet or OpenPose input, and no IP-Adapter or reference-image input; those steps above describe desktop and server tools.
Field notes
- Mask only the clothing, slightly past its edges, and keep the face, hands, and hair out of the mask.
- Describe the new garment's type, color, fabric, and fit plus the photo's light and pose.
- Recolors work at moderate strength; a different kind of garment needs a higher strength and a mask shaped like the new piece.
- ControlNet keeps the pose and IP-Adapter matches a reference garment on desktop; fix seams with a second, smaller pass.
Try it on your phone
- Paint the garment you want to replace, a little beyond its edges, and leave the face and hands unpainted.
- Describe the new clothing: type, color, fabric, fit, and the existing light and pose.
- Generate at a balanced strength and raise it if the old clothing still shows through.
- Generate several attempts and keep the one that follows the body best.
- Inpaint any seams or leftover strips with a smaller mask and a short prompt.
Sources and verification
Primary and maintainer documentation checked for this guide. Product-specific details were reviewed against the current PhoneDiffusion scope.
- Hugging Face Diffusers: InpaintingMaintainer guide: the mask's white pixels are repainted from the prompt and black pixels are kept; strength sets how far the masked area moves from the original.
- AUTOMATIC1111 Stable Diffusion web UI: Features wiki: inpainting, negative prompt, Hires. fixProject wiki: Masked content options, ‘Only masked’ inpainting that resizes just the masked region and pastes it back, dedicated inpainting checkpoints, negative prompts, and Hires. fix.
- AUTOMATIC1111 Stable Diffusion web UI: modules/ui.pySource for the inpaint controls and defaults: Mask blur 4, Masked content ‘original’, Inpaint area ‘Whole picture’ or ‘Only masked’, Only masked padding 32 pixels, and img2img Denoising strength 0.75.
- ComfyUI: inpainting tutorialOfficial walkthrough: paint the mask with Open in MaskEditor, use VAE Encode (for Inpainting) with grow_mask_by for a soft transition, and prefer a dedicated inpainting checkpoint.
- ComfyUI: nodes.py (VAE Encode for Inpainting, Set Latent Noise Mask, KSampler)Source: VAE Encode (for Inpainting) defaults grow_mask_by to 6 and fills masked pixels with neutral gray before encoding; Set Latent Noise Mask limits sampling to a mask; KSampler denoise keeps more structure at lower values.
- Meta AI: Segment Anything (SAM) repositoryOfficial README: SAM produces high-quality object masks from input prompts such as points or boxes (Apache 2.0).
- Yu et al.: Inpaint Anything (arXiv 2304.06790) repositoryResearch project combining Segment Anything with inpainting: click an object to segment it with SAM, then Fill Anything regenerates it from a text prompt with Stable Diffusion.
- ControlNet 1.1 (lllyasviel): OpenPose and Depth modelsMaintainer documentation for ControlNet 1.1: the Openpose Full preprocessor (body, hands, and face), an improved OpenPose processor that is more accurate for hands, and depth control.
- Hugging Face Diffusers: ControlNetMaintainer guide: a ControlNet steers a model with a structural control image such as canny edges or depth while keeping the text prompt; controlnet_conditioning_scale sets how strongly.
- Hugging Face Diffusers: IP-AdapterMaintainer guide: IP-Adapter steers a frozen model with a reference image while keeping the text prompt, works with the inpainting pipeline, and set_ip_adapter_scale sets its strength (1.0 full, about 0.5 balances text and image).