Download app.py from RAM0976/image.ai: direct link, hf CLI and curl.
- Browser
- Download file 403 Bytes
-
https://huggingface.co/spaces/RAM0976/image.ai/resolve/main/app.py
- Command line
-
hf download hf://spaces/RAM0976/image.ai/app.py
-
curl -L -o app.py https://huggingface.co/spaces/RAM0976/image.ai/resolve/main/app.py
403 Bytes
| import gradio as gr | |
| from diffusers import StableDiffusionPipeline | |
| import torch | |
| pipe = StableDiffusionPipeline.from_pretrained( | |
| "Lykon/dreamshaper-8", torch_dtype=torch.float16 | |
| ).to("cuda" if torch.cuda.is_available() else "cpu") | |
| def generate(prompt): | |
| image = pipe(prompt).images[0] | |
| return image | |
| gr.Interface(fn=generate, inputs="text", outputs="image", title="Nyra AI Generator").launch() |