Spaces:
Runtime error
Runtime error
Download app.py from drgraf/sd3.5-large-api: direct link, hf CLI and curl.
- Browser
- Download file 493 Bytes
-
https://huggingface.co/spaces/drgraf/sd3.5-large-api/resolve/main/app.py
- Command line
-
hf download hf://spaces/drgraf/sd3.5-large-api/app.py
-
curl -L -o app.py https://huggingface.co/spaces/drgraf/sd3.5-large-api/resolve/main/app.py
493 Bytes
| import torch | |
| from diffusers import StableDiffusionPipeline | |
| import gradio as gr | |
| # Modeli yükləyirik | |
| model_id = "stabilityai/stable-diffusion-3.5" | |
| pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32) | |
| pipe.to("cpu") # CPU ilə işləməsi üçün | |
| # Generasiya funksiyası | |
| def generate_image(prompt): | |
| image = pipe(prompt).images[0] | |
| return image | |
| # Gradio interfeysi | |
| demo = gr.Interface(fn=generate_image, inputs="text", outputs="image") | |
| demo.launch() | |