Open-source toolkit for building studio-quality virtual try-ons with generative AI
Project description
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
- Set up a Google Cloud project and enable the Vertex AI API.
- Create a service account and download the JSON key file.
- 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")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openvto-0.1.2.tar.gz.
File metadata
- Download URL: openvto-0.1.2.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a976fdad3062e7bda2d55316bd3115136a3394a9effb0976568ca45c9f94dd7
|
|
| MD5 |
daa5b4de3c98d9b5c9ada2b69465acaf
|
|
| BLAKE2b-256 |
6687c22008010d644b03776e92a9281bef6fe80a819018cc2f7e3a9cdc4c07a8
|
Provenance
The following attestation bundles were made for openvto-0.1.2.tar.gz:
Publisher:
python-publish.yml on Prompt-Haus/OpenVTO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openvto-0.1.2.tar.gz -
Subject digest:
2a976fdad3062e7bda2d55316bd3115136a3394a9effb0976568ca45c9f94dd7 - Sigstore transparency entry: 813187126
- Sigstore integration time:
-
Permalink:
Prompt-Haus/OpenVTO@3ce11bd3b51152f0048eee73d3a1fe87d74ed7ee -
Branch / Tag:
refs/tags/v.0.1.2 - Owner: https://github.com/Prompt-Haus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3ce11bd3b51152f0048eee73d3a1fe87d74ed7ee -
Trigger Event:
release
-
Statement type:
File details
Details for the file openvto-0.1.2-py3-none-any.whl.
File metadata
- Download URL: openvto-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43626bd474af87e4fc688530a98be3a78f19f55b139268e821bc9f7256ea738e
|
|
| MD5 |
06e9c825f051c1cd7e2f834aa2ec60a8
|
|
| BLAKE2b-256 |
395ab166aeab3afbd457de0f77b5d750ff2ca41202597f20f41b5f128195c311
|
Provenance
The following attestation bundles were made for openvto-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on Prompt-Haus/OpenVTO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openvto-0.1.2-py3-none-any.whl -
Subject digest:
43626bd474af87e4fc688530a98be3a78f19f55b139268e821bc9f7256ea738e - Sigstore transparency entry: 813187139
- Sigstore integration time:
-
Permalink:
Prompt-Haus/OpenVTO@3ce11bd3b51152f0048eee73d3a1fe87d74ed7ee -
Branch / Tag:
refs/tags/v.0.1.2 - Owner: https://github.com/Prompt-Haus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3ce11bd3b51152f0048eee73d3a1fe87d74ed7ee -
Trigger Event:
release
-
Statement type: