Download script/download-weights from clone3/Material: direct link, hf CLI and curl.
- Browser
- Download file 357 Bytes
-
https://huggingface.co/spaces/clone3/Material/resolve/main/script/download-weights
- Command line
-
hf download hf://spaces/clone3/Material/script/download-weights
-
curl -L -o download-weights https://huggingface.co/spaces/clone3/Material/resolve/main/script/download-weights
357 Bytes
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import torch | |
| from diffusers import StableDiffusionPipeline | |
| os.makedirs("diffusers-cache", exist_ok=True) | |
| pipe = StableDiffusionPipeline.from_pretrained( | |
| "CompVis/stable-diffusion-v1-4", | |
| cache_dir="diffusers-cache", | |
| revision="fp16", | |
| torch_dtype=torch.float16, | |
| use_auth_token=sys.argv[1], | |
| ) | |