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.


Third-Party Services & Trademarks

OpenVTO integrates with Google Cloud's Generative AI services. By using this library with Google's APIs, you agree to comply with (not limited to):

Trademark Notice: Google, Google Cloud, Vertex AI, Gemini, and Veo are trademarks of Google LLC. OpenVTO is an independent open-source project and is not affiliated with, endorsed by, or sponsored by Google LLC.


Data Privacy & Usage Disclaimer

⚠️ Important: OpenVTO processes personal images including selfies and full-body photographs. By using this library, you acknowledge and agree that:

  1. User Consent: You are solely responsible for obtaining all necessary rights, permissions, and consents from individuals whose images are processed. This includes explicit consent for:

    • Collection and processing of biometric data (facial features, body shape)
    • Generation of synthetic/AI-generated images based on their likeness
    • Any commercial or public use of generated content
  2. Data Handling: Images uploaded to this library may be sent to third-party AI services (e.g., Google Vertex AI) for processing. Review and comply with the data processing terms of these services.

  3. No Warranty: This software is provided "AS IS" without warranty of any kind. The authors and contributors are not liable for any claims, damages, or other liability arising from use of this software.

  4. Prohibited Uses: Do not use this library to:

    • Create non-consensual intimate imagery
    • Generate content for harassment, fraud, or deception
    • Impersonate individuals without their consent
    • Violate any applicable laws or regulations
  5. Regulatory Compliance: This library is not designed for, and should not be used in, regulated industries (healthcare, finance, legal) without appropriate professional guidance and compliance measures.


Demo Assets License

The demo assets in openvto/assets/ are provided for testing and demonstration purposes only.

Asset Type Source License
Avatar images AI-generated by OpenVTO team MIT License
Clothing images AI-generated by OpenVTO team MIT License
People images AI-generated by OpenVTO team MIT License

These assets are synthetic/AI-generated and do not depict real individuals. They are released under the same MIT license as the rest of this project and may be used freely for testing, development, and demonstration.

Note: When using OpenVTO in production, you should use your own properly licensed assets and ensure compliance with all applicable image rights and privacy laws.


License

This project is licensed under the MIT License. See the LICENSE file for details.

For information about third-party dependencies and their licenses, see THIRD_PARTY_LICENSES.md.

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.6.tar.gz (11.7 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.6-py3-none-any.whl (11.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openvto-0.1.6.tar.gz
  • Upload date:
  • Size: 11.7 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.6.tar.gz
Algorithm Hash digest
SHA256 3d04a2e431d8a2f5b9bc717c4483564ad5730f6163557d7f3b60d0d84b70523a
MD5 3c7588c1813431803365b6ff3200c376
BLAKE2b-256 de9f6c27df27248d7848abf63258aa9e678106b7c79b0d4aa68fa2c040ff859c

See more details on using hashes here.

Provenance

The following attestation bundles were made for openvto-0.1.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: openvto-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fb654bbd6dd5830e8be0b88010bf5e87f5b29feb657d7e0c747f5db6d2cc0dee
MD5 8bbbdad7f90d4f74c03b9d103d6931e8
BLAKE2b-256 fc2d5a0334ff00a3b03244686d34a3137ff41e134de4fc93241894bf8d2baafc

See more details on using hashes here.

Provenance

The following attestation bundles were made for openvto-0.1.6-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