clairesrc/myfit

virtual try-on web API

2

stars

0

commits

Python

primary language

Feb 7, 2026

updated

README

MyFit

CI Build

image

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.

Features

  • Async job queue for GPU inference
  • Prometheus metrics and OpenTelemetry tracing
  • Kubernetes-ready health probes
  • Request correlation IDs
  • Structured JSON logging
  • NixOS module and Docker deployment

Requirements

  • NVIDIA GPU with CUDA support
  • ~12GB VRAM (float16) or ~24GB VRAM (float32)
  • Python 3.11+ or Nix/Docker

Quick Start

Docker

# 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

nix develop  # Enter dev shell
python -m myfit.api.main --host 0.0.0.0

pip

pip install -e ".[all]"
python -m myfit.api.main

The API is available at http://localhost:8000 with docs at /docs.

API

Submit Try-On

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"}.

Check Status

curl http://localhost:8000/tryon/{job_id}

Status: pendingprocessingcompleted | failed

Download Result

curl -o result.png http://localhost:8000/result/{job_id}

Health Probes

EndpointPurpose
GET /healthComprehensive status with GPU/disk info
GET /health/readyReadiness probe (models loaded?)
GET /health/liveLiveness probe (process alive?)
GET /metricsPrometheus metrics

Configuration

All settings use the MYFIT_ prefix:

VariableDefaultDescription
MYFIT_HOST127.0.0.1Bind address
MYFIT_PORT8000Server port
MYFIT_DEVICEcudacuda or cpu
MYFIT_PRECISIONfloat16float16 or float32
MYFIT_RESULT_PATH/tmp/myfit-resultsResult storage
MYFIT_LOG_LEVELINFODEBUG, INFO, WARNING, ERROR
MYFIT_LOG_FORMATtexttext or json
MYFIT_METRICS_ENABLEDtrueEnable /metrics endpoint
MYFIT_TRACING_ENABLEDfalseEnable OpenTelemetry
MYFIT_OTLP_ENDPOINTOTLP exporter endpoint
MYFIT_FRONTEND_ENABLEDtrueEnable web UI

Deployment

Kubernetes

kubectl apply -f k8s/

Includes Deployment with GPU resources, readiness/liveness probes, ConfigMap, Service, and Ingress.

NixOS

{
  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;
          };
        }
      ];
    };
  };
}

Development

nix develop           # Enter dev shell
pytest tests/ -v      # Run tests
ruff check myfit/     # Lint
mypy myfit/           # Type check
pre-commit install    # Setup git hooks

CI/CD

GitHub Actions runs on every push:

  • Lint: ruff check + format
  • Type check: mypy
  • Test: pytest with coverage
  • Security: Trivy vulnerability scan
  • Build: Docker image to GHCR (main branch)

License

MIT. The IDM-VTON model weights are licensed under CC BY-NC-SA 4.0 and are downloaded separately at runtime.

clairesrc/myfit

virtual try-on web API

2

stars

0

commits

Python

primary language

Feb 7, 2026

updated

README

MyFit

CI Build

image

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.

Features

  • Async job queue for GPU inference
  • Prometheus metrics and OpenTelemetry tracing
  • Kubernetes-ready health probes
  • Request correlation IDs
  • Structured JSON logging
  • NixOS module and Docker deployment

Requirements

  • NVIDIA GPU with CUDA support
  • ~12GB VRAM (float16) or ~24GB VRAM (float32)
  • Python 3.11+ or Nix/Docker

Quick Start

Docker

# 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

nix develop  # Enter dev shell
python -m myfit.api.main --host 0.0.0.0

pip

pip install -e ".[all]"
python -m myfit.api.main

The API is available at http://localhost:8000 with docs at /docs.

API

Submit Try-On

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"}.

Check Status

curl http://localhost:8000/tryon/{job_id}

Status: pendingprocessingcompleted | failed

Download Result

curl -o result.png http://localhost:8000/result/{job_id}

Health Probes

EndpointPurpose
GET /healthComprehensive status with GPU/disk info
GET /health/readyReadiness probe (models loaded?)
GET /health/liveLiveness probe (process alive?)
GET /metricsPrometheus metrics

Configuration

All settings use the MYFIT_ prefix:

VariableDefaultDescription
MYFIT_HOST127.0.0.1Bind address
MYFIT_PORT8000Server port
MYFIT_DEVICEcudacuda or cpu
MYFIT_PRECISIONfloat16float16 or float32
MYFIT_RESULT_PATH/tmp/myfit-resultsResult storage
MYFIT_LOG_LEVELINFODEBUG, INFO, WARNING, ERROR
MYFIT_LOG_FORMATtexttext or json
MYFIT_METRICS_ENABLEDtrueEnable /metrics endpoint
MYFIT_TRACING_ENABLEDfalseEnable OpenTelemetry
MYFIT_OTLP_ENDPOINTOTLP exporter endpoint
MYFIT_FRONTEND_ENABLEDtrueEnable web UI

Deployment

Kubernetes

kubectl apply -f k8s/

Includes Deployment with GPU resources, readiness/liveness probes, ConfigMap, Service, and Ingress.

NixOS

{
  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;
          };
        }
      ];
    };
  };
}

Development

nix develop           # Enter dev shell
pytest tests/ -v      # Run tests
ruff check myfit/     # Lint
mypy myfit/           # Type check
pre-commit install    # Setup git hooks

CI/CD

GitHub Actions runs on every push:

  • Lint: ruff check + format
  • Type check: mypy
  • Test: pytest with coverage
  • Security: Trivy vulnerability scan
  • Build: Docker image to GHCR (main branch)

License

MIT. The IDM-VTON model weights are licensed under CC BY-NC-SA 4.0 and are downloaded separately at runtime.

Languages

Python

74.3%

Nix

14.6%

HTML

5.3%

CSS

3.6%

Dockerfile

2.1%