oodtryon / local_run.py
fanboyd13's picture
Upload 5 files
22f3c7e verified
raw
history blame contribute delete
955 Bytes
"""
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 and launch the main app
import app # noqa: F401 – app.py launches demo on import via __main__ block
# If running directly:
if __name__ == "__main__":
app.demo.launch(share=True) # share=True gives a public ngrok URL