| """ |
| local_run.py β Run the Virtual Try-On app locally (no HuggingFace needed) |
| ---------------------------------------------------------------------- |
| Requirements: |
| pip install gradio diffusers transformers accelerate torch torchvision |
| pip install xformers # optional, speeds up GPU inference |
| |
| Usage: |
| python local_run.py |
| # Then open http://127.0.0.1:7860 in your browser |
| """ |
|
|
| import subprocess, sys |
|
|
| REQUIRED = [ |
| "gradio>=4.20.0", |
| "diffusers>=0.27.0", |
| "transformers>=4.38.0", |
| "accelerate>=0.27.0", |
| "torch", |
| "Pillow", |
| ] |
|
|
| print("Checking / installing dependencies β¦") |
| for pkg in REQUIRED: |
| subprocess.check_call([sys.executable, "-m", "pip", "install", pkg, "-q"]) |
|
|
| |
| import app |
|
|
| |
| if __name__ == "__main__": |
| app.demo.launch(share=True) |
|
|