Spaces:
Runtime error
Runtime error
Download app.py from wirinweb/wirinweb_space: direct link, hf CLI and curl.
- Browser
- Download file 533 Bytes
-
https://huggingface.co/spaces/wirinweb/wirinweb_space/resolve/main/app.py
- Command line
-
hf download hf://spaces/wirinweb/wirinweb_space/app.py
-
curl -L -o app.py https://huggingface.co/spaces/wirinweb/wirinweb_space/resolve/main/app.py
533 Bytes
| import gradio as gr | |
| from diffusers import StableDiffusionPipeline | |
| import torch | |
| # Загрузка модели | |
| model_path = "models/sdxxxl/sdxxxl_v30.safetensors" | |
| pipe = StableDiffusionPipeline.from_pretrained(model_path, torch_dtype=torch.float16) | |
| pipe.to("cuda") | |
| # Функция для генерации изображений | |
| def generate_image(prompt): | |
| image = pipe(prompt).images[0] | |
| return image | |
| iface = gr.Interface(fn=generate_image, inputs="text", outputs="image", title="SDXXXL Image Generator") | |
| iface.launch() | |