Spaces:
Runtime error
Runtime error
Download app.py from nyrt/docker_python: direct link, hf CLI and curl.
- Browser
- Download file 398 Bytes
-
https://huggingface.co/spaces/nyrt/docker_python/resolve/590bfd9f21ba2a8e7d46e33eacd64fadbd2b8ba6/app.py
- Command line
-
hf download hf://spaces/nyrt/docker_python@590bfd9f21ba2a8e7d46e33eacd64fadbd2b8ba6/app.py
-
curl -L -o app.py https://huggingface.co/spaces/nyrt/docker_python/resolve/590bfd9f21ba2a8e7d46e33eacd64fadbd2b8ba6/app.py
398 Bytes
| !pip install transformers datasets diffusers scipy torch | |
| !pip install accelerate | |
| import torch | |
| from diffusers import StableDiffusionPipeline | |
| model_id = "CompVis/stable-diffusion-v1-4" | |
| device = "cuda" | |
| pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) | |
| pipe = pipe.to(device) | |
| prompt = "a photo of an astronaut riding a horse on mars" | |
| image = pipe(prompt).images[0] |