File size: 533 Bytes
40ceace
5fb68aa
 
 
b6fdc8e
4181bd4
0394122
 
5fb68aa
0394122
4181bd4
5fb68aa
40ceace
1e1446c
5fb68aa
4181bd4
 
b6fdc8e
 
40ceace
 
1e1446c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()