Metadata-Version: 2.4
Name: opentryon
Version: 0.0.3
Summary: Open-source AI toolkit for fashion tech and virtual try-on
Home-page: https://github.com/tryonlabs/opentryon
Author: TryOn Labs
Author-email: contact@tryonlabs.ai
License: CC-BY-NC-4.0
Project-URL: Documentation, https://tryonlabs.github.io/opentryon/
Project-URL: Source, https://github.com/tryonlabs/opentryon
Project-URL: Bug Reports, https://github.com/tryonlabs/opentryon/issues
Project-URL: Discord, https://discord.gg/T5mPpZHxkY
Keywords: virtual try-on,fashion tech,diffusion models,garment segmentation,pose estimation,outfit generation,try-on diffusion,computer vision,deep learning,artificial intelligence,image generation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: Free for non-commercial use
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: Free For Home Use
Classifier: License :: Other/Proprietary License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy==1.26.4
Requires-Dist: pillow==10.1.0
Requires-Dist: tqdm==4.66.1
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: boto3==1.40.64
Requires-Dist: requests>=2.31.0
Requires-Dist: PyJWT>=2.10.1
Requires-Dist: google-genai>=1.52.0
Requires-Dist: openai>=2.9.0
Requires-Dist: fastapi==0.124.0
Requires-Dist: uvicorn[standard]==0.38.0
Requires-Dist: python-multipart==0.0.20
Requires-Dist: lumaai>=1.18.1
Requires-Dist: langchain>=1.0.0
Requires-Dist: langchain-openai>=0.2.0
Requires-Dist: langchain-anthropic>=0.2.0
Requires-Dist: langchain-google-genai>=2.0.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: local
Requires-Dist: torch==2.1.2; extra == "local"
Requires-Dist: torchvision==0.16.2; extra == "local"
Requires-Dist: opencv-python==4.8.1.78; extra == "local"
Requires-Dist: scikit-image==0.22.0; extra == "local"
Requires-Dist: transformers==4.42.4; extra == "local"
Requires-Dist: timm>=1.0.22; extra == "local"
Requires-Dist: einops>=0.8.1; extra == "local"
Requires-Dist: scipy>=1.15.0; extra == "local"
Requires-Dist: huggingface-hub>=0.36.0; extra == "local"
Requires-Dist: nest-asyncio>=1.5.0; extra == "local"
Requires-Dist: decord>=0.6.0; extra == "local"
Provides-Extra: demos
Requires-Dist: gradio>=6.0.0; extra == "demos"
Provides-Extra: training
Requires-Dist: torch==2.1.2; extra == "training"
Requires-Dist: torchvision==0.16.2; extra == "training"
Requires-Dist: opencv-python==4.8.1.78; extra == "training"
Requires-Dist: scikit-image==0.22.0; extra == "training"
Requires-Dist: transformers==4.42.4; extra == "training"
Requires-Dist: timm>=1.0.22; extra == "training"
Requires-Dist: einops>=0.8.1; extra == "training"
Requires-Dist: scipy>=1.15.0; extra == "training"
Requires-Dist: huggingface-hub>=0.36.0; extra == "training"
Requires-Dist: nest-asyncio>=1.5.0; extra == "training"
Requires-Dist: decord>=0.6.0; extra == "training"
Requires-Dist: diffusers>=0.21.0; extra == "training"
Requires-Dist: accelerate>=0.20.0; extra == "training"
Provides-Extra: all
Requires-Dist: torch==2.1.2; extra == "all"
Requires-Dist: torchvision==0.16.2; extra == "all"
Requires-Dist: opencv-python==4.8.1.78; extra == "all"
Requires-Dist: scikit-image==0.22.0; extra == "all"
Requires-Dist: transformers==4.42.4; extra == "all"
Requires-Dist: timm>=1.0.22; extra == "all"
Requires-Dist: einops>=0.8.1; extra == "all"
Requires-Dist: scipy>=1.15.0; extra == "all"
Requires-Dist: huggingface-hub>=0.36.0; extra == "all"
Requires-Dist: nest-asyncio>=1.5.0; extra == "all"
Requires-Dist: decord>=0.6.0; extra == "all"
Requires-Dist: gradio>=6.0.0; extra == "all"
Requires-Dist: diffusers>=0.21.0; extra == "all"
Requires-Dist: accelerate>=0.20.0; extra == "all"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# OpenTryOn

[![Documentation](https://img.shields.io/badge/Documentation-Read%20Docs-teal?style=flat-square)](https://tryonlabs.github.io/opentryon/)
[![Discord](https://img.shields.io/badge/Discord-Join%20Chat-blue?style=flat-square&logo=discord)](https://discord.gg/T5mPpZHxkY)
[![License](https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg?style=flat-square)](https://creativecommons.org/licenses/by-nc/4.0/)

Open-source AI toolkit for fashion technology: virtual try-on, image/video generation & editing, multimodal understanding, background removal, preprocessing, datasets, and TryOnDiffusion research code.

📚 **Full documentation:** [https://tryonlabs.github.io/opentryon/](https://tryonlabs.github.io/opentryon/)  
API tutorials, configuration, examples, and agent guides live there — not in this README.

## What you get

| Category | Highlights |
|---|---|
| **Virtual try-on** | FLUX VTO, Nova Canvas, Kling AI, Segmind, Pruna P-Image-Try-On, FASHN, Nano Banana 2 Lite |
| **Generate / edit** | Nano Banana family, FLUX.2, GPT Image, Luma Photon, Seedream 5.0 Pro, Ideogram 4.0, Grok Imagine Image, Pruna P-Image / Edit / Upscale; local FLUX.2-dev Turbo |
| **Understand** | Kimi K2.6 / K2.7 Code / K3 (API), Kimi-VL & LLaVA-NeXT (local) |
| **Video** | Veo, Sora, Luma Ray 2 + Ray 3.2, Seedance 2.5, Kling 3.0 / Omni / Turbo, Grok Imagine Video 1.5, Gemini Omni Flash, Pruna P-Video / Replace / Avatar / Animate |
| **Other** | BEN2 background removal, garment/human preprocessing, fashion datasets, LangChain agents |

## Three ways to use it

1. **CLI** — `opentryon <service> --model <model> [params...]`
2. **MCP server** — expose every registry model as tools for Claude, Cursor, or [tryon-studio](https://github.com/tryonlabs/tryon-studio)
3. **Python** — `from tryon.api import ...` (and `tryon.cli.runner.invoke_model`)

The unified Next.js + Tailwind web UI is **not** in this repo — it lives in [`tryon-studio`](https://github.com/tryonlabs/tryon-studio) and talks to OpenTryOn over MCP.

## Install

```bash
git clone https://github.com/tryonlabs/opentryon.git
cd opentryon
conda env create -f environment.yml
conda activate opentryon
pip install -e .
# Optional local/GPU models: pip install -e ".[local]"
```

Or with pip: `pip install -r requirements.txt && pip install -e .`

```bash
cp env.template .env   # add the API keys you need
```

Details: [Installation](https://tryonlabs.github.io/opentryon/docs/getting-started/installation) · [Configuration](https://tryonlabs.github.io/opentryon/docs/getting-started/configuration)

## Quick start

```bash
# Dry-run (no API call) — verifies CLI + registry wiring
opentryon vton --model flux-vto \
  --person-image data/model-1.jpg --garment-image data/garment.png --dry-run

# Real call (needs BFL_API_KEY in .env)
opentryon vton --model flux-vto \
  --person-image data/model-1.jpg --garment-image data/garment.png \
  --garment-description "olive green bomber jacket"

# Multimodal understanding (needs MOONSHOT_API_KEY)
opentryon understand --model kimi-k3 --image data/model-1.jpg \
  --prompt "Describe this outfit for a product listing." --reasoning-effort high
```

```python
from tryon.api import KimiUnderstandAdapter

adapter = KimiUnderstandAdapter(model="kimi-k3")
result = adapter.understand_image(
    "data/model-1.jpg",
    prompt="Describe this outfit.",
    reasoning_effort="high",
)
print(result["text"])
```

More examples: [Quickstart](https://tryonlabs.github.io/opentryon/docs/getting-started/quickstart) · [CLI](https://tryonlabs.github.io/opentryon/docs/getting-started/cli) · [API Reference](https://tryonlabs.github.io/opentryon/docs/api-reference/overview)

## CLI services

```bash
opentryon <service> --model <model> [params...]
opentryon understand --help                    # list models
opentryon understand --model kimi-k3 --help    # list that model's flags
```

| Service | Purpose | Example models |
|---|---|---|
| `vton` | Virtual try-on | `flux-vto`, `p-image-tryon`, `fashn-tryon-max`, … |
| `generate` | Text-to-image | `nano-banana-pro`, `flux2-pro`, `gpt-image`, … |
| `edit` | Image editing | `nano-banana-2`, `flux2-flex`, `gpt-image`, … |
| `understand` | Image/video understanding | `kimi-k2.6`, `kimi-k3`, `kimi-vl`, … |
| `video-generate` | Text/image-to-video | `veo`, `sora`, `gemini-omni`, … |
| `bg-remove` | Background removal | `ben2` |

Models marked local need `pip install opentryon[local]`. Full table and flags: [Unified CLI](https://tryonlabs.github.io/opentryon/docs/getting-started/cli).

## MCP server

```bash
cd mcp-server
pip install -r requirements.txt
python server.py                                    # stdio (Claude Desktop / Cursor)
python server.py --transport http --host 127.0.0.1 --port 8000
```

Tools are generated from `tryon/cli/registry.py` — the same registry as the CLI. See [`mcp-server/README.md`](mcp-server/README.md).

## Demos & notebooks

This package ships **Gradio** demos and **Jupyter** notebooks only:

```bash
python run_demo.py --name extract_garment   # also: model_swap, outfit_generator
```

Notebooks: [`notebooks/`](notebooks/). Web UI: [tryon-studio](https://github.com/tryonlabs/tryon-studio).

## Layout

```
opentryon/
├── tryon/           # Package: api/, cli/, models/, agents/, datasets/, preprocessing/
├── tryondiffusion/  # Research diffusion training / inference
├── mcp-server/      # FastMCP server (registry → tools)
├── demo/            # Gradio demos
├── notebooks/       # Jupyter examples
├── docs/            # Docusaurus documentation site
├── tests/           # CLI / adapter smoke checks
└── env.template     # API key template
```

## Documentation map

| Topic | Where |
|---|---|
| Install & config | [Getting Started](https://tryonlabs.github.io/opentryon/docs/getting-started/installation) |
| CLI | [CLI guide](https://tryonlabs.github.io/opentryon/docs/getting-started/cli) |
| Per-provider APIs | [API Reference](https://tryonlabs.github.io/opentryon/docs/api-reference/overview) |
| Local / GPU models | [Local Models](https://tryonlabs.github.io/opentryon/docs/local-models/overview) |
| Agents | [Agents](https://tryonlabs.github.io/opentryon/docs/agents/vton-agent) |
| Add a new model | [New model checklist](https://tryonlabs.github.io/opentryon/docs/advanced/new-model-checklist) |
| TryOnDiffusion | [Overview](https://tryonlabs.github.io/opentryon/docs/tryondiffusion/overview) · [paper](https://arxiv.org/abs/2306.08276) |

When contributing docs or APIs: put long tutorials in `docs/`, not this README. Keep README as the project front door only.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md). Open an issue before large changes; prefer PRs that update the registry, tests, and docs together.

## License

[Creative Commons BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/). Non-commercial use with attribution to [this repository](https://github.com/tryonlabs/opentryon); indicate any changes you make.

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=tryonlabs/opentryon&type=date&legend=top-left)](https://www.star-history.com/#tryonlabs/opentryon&type=date&legend=top-left)

---

Made with ❤️ by [TryOn Labs](https://www.tryonlabs.ai) · [Discord](https://discord.gg/T5mPpZHxkY)
