I wanted a safe and private way to see how clothes will fit with my existing wardrobe before buying them online, so I quickly put this together to run on my 3090.
Virtual try-on functionality powered by IDM-VTON.
# Standard (requires nvidia-container-runtime)
docker run --gpus all -p 8000:8000 ghcr.io/clairesrc/myfit:latest
# NixOS (uses CDI)
docker run --device nvidia.com/gpu=all -p 8000:8000 ghcr.io/clairesrc/myfit:latest
nix develop # Enter dev shell
python -m myfit.api.main --host 0.0.0.0
pip install -e ".[all]"
python -m myfit.api.main
The API is available at http://localhost:8000 with docs at /docs.
curl -X POST http://localhost:8000/tryon \
-F "person_image=@person.jpg" \
-F "garment_image=@garment.jpg" \
-F "seed=42"
Returns {"job_id": "...", "status": "pending"}.
curl http://localhost:8000/tryon/{job_id}
Status: pending → processing → completed | failed
curl -o result.png http://localhost:8000/result/{job_id}
| Endpoint | Purpose |
|---|---|
GET /health | Comprehensive status with GPU/disk info |
GET /health/ready | Readiness probe (models loaded?) |
GET /health/live | Liveness probe (process alive?) |
GET /metrics | Prometheus metrics |
All settings use the MYFIT_ prefix:
| Variable | Default | Description |
|---|---|---|
MYFIT_HOST | 127.0.0.1 | Bind address |
MYFIT_PORT | 8000 | Server port |
MYFIT_DEVICE | cuda | cuda or cpu |
MYFIT_PRECISION | float16 | float16 or float32 |
MYFIT_RESULT_PATH | /tmp/myfit-results | Result storage |
MYFIT_LOG_LEVEL | INFO | DEBUG, INFO, WARNING, ERROR |
MYFIT_LOG_FORMAT | text | text or json |
MYFIT_METRICS_ENABLED | true | Enable /metrics endpoint |
MYFIT_TRACING_ENABLED | false | Enable OpenTelemetry |
MYFIT_OTLP_ENDPOINT | — | OTLP exporter endpoint |
MYFIT_FRONTEND_ENABLED | true | Enable web UI |
kubectl apply -f k8s/
Includes Deployment with GPU resources, readiness/liveness probes, ConfigMap, Service, and Ingress.
{
inputs.myfit.url = "github:clairesrc/myfit";
outputs = { self, nixpkgs, myfit, ... }: {
nixosConfigurations.host = nixpkgs.lib.nixosSystem {
modules = [
myfit.nixosModules.default
{
services.myfit = {
enable = true;
host = "0.0.0.0";
openFirewall = true;
};
}
];
};
};
}
nix develop # Enter dev shell
pytest tests/ -v # Run tests
ruff check myfit/ # Lint
mypy myfit/ # Type check
pre-commit install # Setup git hooks
GitHub Actions runs on every push:
MIT. The IDM-VTON model weights are licensed under CC BY-NC-SA 4.0 and are downloaded separately at runtime.
Python
74.3%
Nix
14.6%
HTML
5.3%
CSS
3.6%
Dockerfile
2.1%
I wanted a safe and private way to see how clothes will fit with my existing wardrobe before buying them online, so I quickly put this together to run on my 3090.
Virtual try-on functionality powered by IDM-VTON.
# Standard (requires nvidia-container-runtime)
docker run --gpus all -p 8000:8000 ghcr.io/clairesrc/myfit:latest
# NixOS (uses CDI)
docker run --device nvidia.com/gpu=all -p 8000:8000 ghcr.io/clairesrc/myfit:latest
nix develop # Enter dev shell
python -m myfit.api.main --host 0.0.0.0
pip install -e ".[all]"
python -m myfit.api.main
The API is available at http://localhost:8000 with docs at /docs.
curl -X POST http://localhost:8000/tryon \
-F "person_image=@person.jpg" \
-F "garment_image=@garment.jpg" \
-F "seed=42"
Returns {"job_id": "...", "status": "pending"}.
curl http://localhost:8000/tryon/{job_id}
Status: pending → processing → completed | failed
curl -o result.png http://localhost:8000/result/{job_id}
| Endpoint | Purpose |
|---|---|
GET /health | Comprehensive status with GPU/disk info |
GET /health/ready | Readiness probe (models loaded?) |
GET /health/live | Liveness probe (process alive?) |
GET /metrics | Prometheus metrics |
All settings use the MYFIT_ prefix:
| Variable | Default | Description |
|---|---|---|
MYFIT_HOST | 127.0.0.1 | Bind address |
MYFIT_PORT | 8000 | Server port |
MYFIT_DEVICE | cuda | cuda or cpu |
MYFIT_PRECISION | float16 | float16 or float32 |
MYFIT_RESULT_PATH | /tmp/myfit-results | Result storage |
MYFIT_LOG_LEVEL | INFO | DEBUG, INFO, WARNING, ERROR |
MYFIT_LOG_FORMAT | text | text or json |
MYFIT_METRICS_ENABLED | true | Enable /metrics endpoint |
MYFIT_TRACING_ENABLED | false | Enable OpenTelemetry |
MYFIT_OTLP_ENDPOINT | — | OTLP exporter endpoint |
MYFIT_FRONTEND_ENABLED | true | Enable web UI |
kubectl apply -f k8s/
Includes Deployment with GPU resources, readiness/liveness probes, ConfigMap, Service, and Ingress.
{
inputs.myfit.url = "github:clairesrc/myfit";
outputs = { self, nixpkgs, myfit, ... }: {
nixosConfigurations.host = nixpkgs.lib.nixosSystem {
modules = [
myfit.nixosModules.default
{
services.myfit = {
enable = true;
host = "0.0.0.0";
openFirewall = true;
};
}
];
};
};
}
nix develop # Enter dev shell
pytest tests/ -v # Run tests
ruff check myfit/ # Lint
mypy myfit/ # Type check
pre-commit install # Setup git hooks
GitHub Actions runs on every push:
MIT. The IDM-VTON model weights are licensed under CC BY-NC-SA 4.0 and are downloaded separately at runtime.
Python
74.3%
Nix
14.6%
HTML
5.3%
CSS
3.6%
Dockerfile
2.1%