Spaces:
Configuration error
Configuration error
| import gradio as gr | |
| from diffusers import StableDiffusionPipeline | |
| import torch | |
| MODEL_ID = "hakurei/waifu-diffusion-v1-4" | |
| pipe = StableDiffusionPipeline.from_pretrained(MODEL_ID) | |
| pipe = pipe.to("cpu") | |
| def generate(prompt): | |
| image = pipe(prompt, num_inference_steps=15).images[0] | |
| return image | |
| demo = gr.Interface( | |
| fn=generate, | |
| inputs=gr.Textbox(label="Prompt"), | |
| outputs=gr.Image(label="Image"), | |
| title="Dave AI - Anime Image Generator", | |
| description="Fast CPU anime generation (no token)." | |
| ) | |
| demo.launch() |