Download app.py from Shamkumar/clothing: direct link, hf CLI and curl.
- Browser
- Download file 355 Bytes
-
https://huggingface.co/spaces/Shamkumar/clothing/resolve/main/app.py
- Command line
-
hf download hf://spaces/Shamkumar/clothing/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Shamkumar/clothing/resolve/main/app.py
355 Bytes
| import torch | |
| from diffusers import DiffusionPipeline | |
| # Change device_map="cuda" to "cpu" or auto-detect device | |
| device = "cuda" if torch.cuda.is_available() else "cpu" | |
| torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32 | |
| pipe = DiffusionPipeline.from_pretrained( | |
| "yisol/IDM-VTON", | |
| dtype=torch_dtype, | |
| device_map=device | |
| ) |