Spaces:
Configuration error
Configuration error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,14 +1,22 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from diffusers import StableDiffusionPipeline
|
| 3 |
+
import torch
|
| 4 |
+
|
| 5 |
+
MODEL_ID = "hakurei/waifu-diffusion-v1-4"
|
| 6 |
+
|
| 7 |
+
pipe = StableDiffusionPipeline.from_pretrained(MODEL_ID)
|
| 8 |
+
pipe = pipe.to("cpu")
|
| 9 |
+
|
| 10 |
+
def generate(prompt):
|
| 11 |
+
image = pipe(prompt, num_inference_steps=15).images[0]
|
| 12 |
+
return image
|
| 13 |
+
|
| 14 |
+
demo = gr.Interface(
|
| 15 |
+
fn=generate,
|
| 16 |
+
inputs=gr.Textbox(label="Prompt"),
|
| 17 |
+
outputs=gr.Image(label="Image"),
|
| 18 |
+
title="Dave AI - Anime Image Generator",
|
| 19 |
+
description="Fast CPU anime generation (no token)."
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
demo.launch()
|