Skip to main content

Overview

AI Clothes Changer lets you virtually try on different clothing items on a person in an image. The API uses advanced AI to realistically change outfits, styles, and clothing accessories while preserving the person’s pose, lighting, and background.

How It Works

  1. Provide a person image - Upload an image of the person you want to dress
  2. Provide a garment image - Upload an image of the clothing item you want to try on
  3. Specify garment type - Indicate whether it’s upper_body, lower_body, or full_body
  4. API generates the result - AI applies the garment to the person realistically
  5. Download the result - Retrieve your image with the new outfit

Use Cases

  • E-commerce virtual try-on - Let customers preview outfits before buying
  • Fashion design - Prototype clothing designs on models
  • Social media content - Create outfit inspiration posts
  • Personal styling apps - Build virtual wardrobe features
  • Marketing campaigns - Generate product variations efficiently

Best Practices

Image Quality

Use clear, full-body or half-body shots - The AI works best when the person’s clothing is clearly visible.
  • Good lighting - Well-lit images produce more realistic results
  • Visible clothing area - Ensure the clothing you want to change is fully visible
  • Minimal obstructions - Avoid crossed arms or objects covering clothing
  • Simple backgrounds - Solid or simple backgrounds work best

Garment Image Requirements

✅ Good garment images:
  • Clear, well-lit photos of the clothing item
  • Flat lay or on a mannequin works best
  • Minimal background distractions
  • Full view of the garment
Garment Types:
  • upper_body - Shirts, jackets, tops, blouses
  • lower_body - Pants, skirts, shorts
  • full_body - Dresses, jumpsuits, full outfits

Code Examples

Basic Clothes Change

from magic_hour import Client
import os

client = Client(token=os.getenv("MAGIC_HOUR_API_KEY"))

result = client.v1.ai_clothes_changer.generate(
    assets={
        "person_file_path": "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/freedom.jpg",
        "garment_file_path": "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/michael-jackson-red-jacket.png",
        "garment_type": "upper_body"
    },
    name="Clothes Changer image",
    wait_for_completion=True,
    download_outputs=True,
    download_directory="./outputs/"
)

if result.status == "complete":
    print(f"✅ Clothes change complete!")
    print(f"Downloaded to: {result.downloaded_paths}")
    print(f"Credits charged: {result.credits_charged}")
else:
    print(f"❌ Job failed with status: {result.status}")
    if hasattr(result, 'error_message'):
        print(f"Error: {result.error_message}")

Different Garment

result = client.v1.ai_clothes_changer.generate(
    assets={
        "person_file_path": "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/bullsjersey.webp",
        "garment_file_path": "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/rookiesteph.jpg",
        "garment_type": "upper_body"
    },
    name="Clothes Changer image",
    wait_for_completion=True,
    download_outputs=True,
    download_directory="./outputs/"
)

if result.status == "complete":
    print(f"✅ Clothes change complete!")
    print(f"Downloaded to: {result.downloaded_paths}")
    print(f"Credits charged: {result.credits_charged}")
else:
    print(f"❌ Job failed with status: {result.status}")
    if hasattr(result, 'error_message'):
        print(f"Error: {result.error_message}")

Pricing

OutputCredits
1 clothes change25 credits

Resolution Limits

AI Clothes Changer has a maximum resolution of 1472px (either width or height).
Try this in our Google Colab Cookbook: Run this API with sample code. Just add your API key.

API Reference

AI Clothes Changer API Reference

View full API specification