-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
24 lines (21 loc) · 970 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
from stable_diffusion_xl_lightning import StableDiffusion
if __name__ == "__main__":
stable_diffusion = StableDiffusion(create_dirs=False)
gr_interface = gr.Interface(
fn=lambda prompt, step_choice: stable_diffusion.generate(prompt,
step_choice,
save=False,
show=False)[0],
inputs=[
gr.Textbox(lines=3,
placeholder="an image of a lion in Claude Monet style",
label="Prompt"),
gr.Dropdown(["1-step", "2-step", "4-step", "8-step"],
value="4-step",
label="Inference steps")
],
outputs=gr.Image(type="pil"),
title="Generate by Prompt using SDXL-lightning"
)
gr_interface.launch()