Skip to main content

Tryon-Tray

A Python package for virtual try-on services integration, supporting multiple VTON (Virtual Try-On)providers.

Installation

pip install tryon-tray

Usage

# Using Alphabake's virtual try-on API

from dotenv import load_dotenv
from tryon_tray.vton_api import VTON
load_dotenv()

result = VTON(
    model_image="inputs/person.jpg",
    garment_image="inputs/garment.jpeg",
    model_name="alphabake",
    auto_download=True,
    download_path="result_alphabake.png",
    show_polling_progress=True,
    # Alphabake specific parameters
    mode="balanced",  # Options: 'fast', 'balanced', or 'quality'
    garment_name="garment-example",
    tryon_name="tryon-example"
)

print(f"Result saved to: {result.get('local_paths')}")
print(f"Time taken: {result['timing']['time_taken']}")

Exploring Available Models

# Discover available models and their parameters
from tryon_tray import get_available_models, get_model_params, get_model_sample_config

# List all available models
all_models = get_available_models()
print("Available models:", all_models)

# List just the virtual try-on models
vton_models = get_available_models(category="vton")
print("VTON models:", vton_models)

# List video models
video_models = get_available_models(category="video")
print("Video models:", video_models)

# Get parameters for a specific model
alphabake_params = get_model_params("alphabake")
print("Alphabake parameters:", alphabake_params)

# Get a sample configuration for a model
sample_config = get_model_sample_config("klingai")
print("Sample KlingAI config:", sample_config)

# Use the sample config directly
from dotenv import load_dotenv
from tryon_tray import VTON
load_dotenv()

config = get_model_sample_config("fashnai")
result = VTON(model_name="fashnai", **config)

Features

  • Multiple VTON service providers support
  • Automatic image downloading
  • Progress tracking
  • Model discovery and parameter exploration

Configuration

Create a .env file with your API keys:

FASHNAI_API_KEY=your_fashnai_key
KLINGAI_API_KEY=your_klingai_key
REPLICATE_API_TOKEN=your_replicate_token
ALPHABAKE_API_KEY=your_alphabake_key

Sample Response

{
  "urls": ["https:/..."],  // Generated image URLs
  "local_paths": ["path/to/downloaded/image.jpg"],  // Downloaded file paths
  "timing": {
    "time_taken": datetime.timedelta  // Total processing time
  }
}

Parameters

  • model_image: Path to the person/model image
  • garment_image: Path to the garment image
  • model_name: Service provider ("fashnai", "klingai", "replicate", "alphabake")
  • auto_download: Automatically download generated images
  • download_dir: Directory for downloaded images
  • polling_interval: Time between status checks (seconds)`
  • show_polling_progress: Show progressbar during generation
  • category: Garment category ("tops", "dresses", etc.)
  • mode: Generation mode ("quality" or "speed" for most APIs, "fast"/"balanced"/"quality" for alphabake)
  • adjust_hands: Adjust hand positions in output
  • restore_background: Preserve original image background

Response Format

  • URLs! for generated images
  • Local paths! to downloaded images
  • *Timing! information (time taken for processing)

License

MIT License

Contributing

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

Metadata

Release files for tryon-tray 0.2.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tryon-tray 0.2.4.1
File Size Uploaded Provenance Actions
tryon_tray-0.2.4.1.tar.gz 21.8 kB Without provenance Details for tryon_tray-0.2.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tryon-tray 0.2.4.1
File Interpreter ABI Platform Actions
tryon_tray-0.2.4.1-py3-none-any.whl Python 3 none any Details for tryon_tray-0.2.4.1-py3-none-any.whl

Total release size: 54.0 kB

Release files / tryon_tray-0.2.4.1.tar.gz

Download URL tryon_tray-0.2.4.1.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8c1bc55c9dc596fde0ad229820ba5433afa08f2f418b15c4aee3255ad016a7a7
BLAKE2b-256 checksum
How to use checksums
c2320115dc3459e331e18399bc330bd10578d7ba4554a9ead84975991f238040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.6

Release files / tryon_tray-0.2.4.1-py3-none-any.whl

Download URL tryon_tray-0.2.4.1-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
491c62c5fec482a33131328a25e4c66e7dac06159ac3814d47968461159f7730
BLAKE2b-256 checksum
How to use checksums
f29b2965330237c1ab243c95876a96804367ae5ddd61bfe64cf2b163ac368a0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.6

Security for tryon-tray 0.2.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page