Skip to main content

Open-source toolkit for building studio-quality virtual try-ons with generative AI

Project description

OpenVTO Header

OpenVTO

OpenVTO is an open-source toolkit for building studio-quality virtual try-ons with generative AI, both as high-end still photos and short animated loops.

It provides a stable and consistent workflow for generating clean "studio avatar" images, swapping outfits from product images, and optionally turning the result into a 4-8s motion clip using image-to-video models.

OpenVTO is designed for speed, consistency, and aesthetics: uniform lighting, controlled backgrounds, repeatable outputs that feel like a premium fashion app.


Goal

OpenVTO's goal is simple: make it easy for teams to ship virtual try-ons that look good enough to market, not just "tech demos."


What OpenVTO Includes

Feature Description
Avatar Generation Generate studio-quality avatars from 2 photos (selfie and posture) with controlled lighting and backgrounds
Virtual Try-On Garment swap from catalog images — single items or complete outfits
Video Loop Generation Animated try-ons as loop-friendly 4–8s clips using image-to-video models
Prompt Presets & Guardrails Keep identity, body shape, and style consistent across generations
Example Implementations Just Jupyter notebooks with code and visualizations

Installation

pip install openvto

Google Vertex AI Setup

  1. Set up a Google Cloud project and enable the Vertex AI API.
  2. Create a service account and download the JSON key file.
  3. Set the following environment variables:
export GOOGLE_SERVICE_ACCOUNT_KEY="path/to/service-account-key.json"
export GOOGLE_CLOUD_PROJECT="your-project-id"
export GOOGLE_CLOUD_LOCATION="us-central1"
export GOOGLE_GENAI_USE_VERTEXAI="true"

Quick Start

import openvto

# Initialize the client (uses Google Vertex AI by default)
vto = openvto.OpenVTO()

# 1. Generate a studio-quality avatar from selfie + posture photos
avatar = vto.generate_avatar(
    selfie="selfie.jpg",
    posture="posture.jpg",
    return_type="pil"
)

# 2. Apply clothing items to the avatar
tryon = vto.generate_tryon(
    avatar=avatar,
    clothes=["jacket.jpg", "pants.jpg", "shirt.jpg"],
    return_type="pil"
)

# 3. Generate an animated video loop
video = vto.generate_videoloop(
    static_image=tryon,
    mode="turn_360",
    return_type="b64"
)

Pipelines

Avatar Generation

Generate a studio-quality avatar from input photos. Requires a selfie (for identity) and a posture image (for pose reference).

avatar = vto.generate_avatar(
    selfie=selfie_image,
    posture=posture_image
)

Virtual Try-On

Apply clothing items to an avatar. Accepts a list of garment images (front views).

tryon = vto.generate_tryon(
    avatar=avatar,
    clothes=[jacket, pants, shirt]
)

Video Loop Generation

Turn a static try-on result into an animated 4-8s video loop.

video = vto.generate_videoloop(
    static_image=tryon,
    mode="turn_360"
)

Models

OpenVTO uses these models from Google Vertex AI by default:

Model Purpose
gemini-3-pro-image-preview High-quality image generation
veo-3.1-fast-generate-preview Cost-effective video generation

Example Assets

OpenVTO includes bundled demo assets for quick testing and prototyping. Access them via the openvto.example module:

from openvto.example import example

# Get all items in a category
all_jackets = example.clothes("jackets")
# [{'i': 1, 'front': Path(...), 'back': Path(...)}, ...]

# Get a specific item (both views)
jacket = example.clothes("jackets", i=2)
# {'front': Path('.../2_front.jpg'), 'back': Path('.../2_back.jpg')}

# Get a specific view
front_path = example.clothes("jackets", i=2, view="front")
# Path('.../2_front.jpg')

# Get an avatar image
avatar_path = example.avatar(i=1)
# Path('.../1.png')

# Get a person photo (posture or selfie)
posture_path = example.person(i=1, kind="posture")
selfie_path = example.person(i=1, kind="selfie")

Available Assets

Category Items Views
jackets 1-4 front, back
pants 1-4 front, back
shirts 1-4 front, back
avatars 1 -
people 1 posture, selfie

Return Types

By default, functions return pathlib.Path objects. You can also request:

# Get raw bytes
data = example.clothes("jackets", i=1, view="front", return_type="bytes")

# Get PIL Image (requires pillow: pip install openvto[examples])
img = example.clothes("jackets", i=1, view="front", return_type="pil")

FastAPI Example

OpenVTO includes a FastAPI example server. To run it, use the following command:

uvicorn fastapi.app.main:app --reload

Then, you can access the API at http://localhost:8000.


Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


License

This project is open source. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openvto-0.1.3.tar.gz (11.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openvto-0.1.3-py3-none-any.whl (11.8 MB view details)

Uploaded Python 3

File details

Details for the file openvto-0.1.3.tar.gz.

File metadata

  • Download URL: openvto-0.1.3.tar.gz
  • Upload date:
  • Size: 11.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openvto-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f9da2c14da1b0699e1d48c78a8013b55a30700e3ea7b2e9e58a3bb37301ba7ce
MD5 5ef160f420f1b33bfd580226616d88db
BLAKE2b-256 d61cbb0ad460a9ec3c0a2dbb643cd925d44df113228e38e923c5a41d4bbb4c07

See more details on using hashes here.

Provenance

The following attestation bundles were made for openvto-0.1.3.tar.gz:

Publisher: python-publish.yml on Prompt-Haus/OpenVTO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openvto-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: openvto-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openvto-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 75d0b7da4dcd54866af9937aeaab6259e62933086a27e5a6383f0c301a09f031
MD5 2f0cd7fd1aa9741849dbffd4b065f086
BLAKE2b-256 d6862ae579aa98aa24b13798810b3f3a79f5ad41d392d50b04c63dcbc351e27d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openvto-0.1.3-py3-none-any.whl:

Publisher: python-publish.yml on Prompt-Haus/OpenVTO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page