Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,7 @@ if SAFETY_CHECKER:
|
|
49 |
# Function
|
50 |
@spaces.GPU(enable_queue=True)
|
51 |
def generate_image(prompt, ckpt):
|
|
|
52 |
|
53 |
checkpoint = checkpoints[ckpt][0]
|
54 |
num_inference_steps = checkpoints[ckpt][1]
|
@@ -74,17 +75,13 @@ def generate_image(prompt, ckpt):
|
|
74 |
|
75 |
|
76 |
# Gradio Interface
|
77 |
-
description = """
|
78 |
-
This demo utilizes the SDXL-Lightning model by ByteDance, which is a lightning-fast text-to-image generative model capable of producing high-quality images in 4 steps.
|
79 |
-
As a community effort, this demo was put together by AngryPenguin. Link to model: https://huggingface.co/ByteDance/SDXL-Lightning
|
80 |
-
"""
|
81 |
|
82 |
with gr.Blocks(css="style.css") as demo:
|
83 |
-
gr.HTML("<h1><center>
|
84 |
-
gr.
|
85 |
with gr.Group():
|
86 |
with gr.Row():
|
87 |
-
prompt = gr.Textbox(label='Enter you image prompt
|
88 |
ckpt = gr.Dropdown(label='Select inference steps',choices=['1-Step', '2-Step', '4-Step', '8-Step'], value='4-Step', interactive=True)
|
89 |
submit = gr.Button(scale=1, variant='primary')
|
90 |
img = gr.Image(label='SDXL-Lightning Generated Image')
|
|
|
49 |
# Function
|
50 |
@spaces.GPU(enable_queue=True)
|
51 |
def generate_image(prompt, ckpt):
|
52 |
+
print(prompt, ckpt)
|
53 |
|
54 |
checkpoint = checkpoints[ckpt][0]
|
55 |
num_inference_steps = checkpoints[ckpt][1]
|
|
|
75 |
|
76 |
|
77 |
# Gradio Interface
|
|
|
|
|
|
|
|
|
78 |
|
79 |
with gr.Blocks(css="style.css") as demo:
|
80 |
+
gr.HTML("<h1><center>SDXL-Lightning ⚡</center></h1>")
|
81 |
+
gr.HTML("<p>Lightning-fast text-to-image generation</p><p><a href='https://huggingface.co/ByteDance/SDXL-Lightning'>https://huggingface.co/ByteDance/SDXL-Lightning</a></p>")
|
82 |
with gr.Group():
|
83 |
with gr.Row():
|
84 |
+
prompt = gr.Textbox(label='Enter you image prompt', scale=8)
|
85 |
ckpt = gr.Dropdown(label='Select inference steps',choices=['1-Step', '2-Step', '4-Step', '8-Step'], value='4-Step', interactive=True)
|
86 |
submit = gr.Button(scale=1, variant='primary')
|
87 |
img = gr.Image(label='SDXL-Lightning Generated Image')
|