Spaces:
Sleeping
Sleeping
AlekseyCalvin
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -130,10 +130,9 @@ def run_lora(prompt, cfg_scale, steps, selected_index, randomize_seed, seed, wid
|
|
130 |
for image in image_generator:
|
131 |
step_counter+=1
|
132 |
final_image = image
|
133 |
-
|
134 |
-
yield image, seed, gr.update(value=progress_bar, visible=True)
|
135 |
|
136 |
-
yield final_image, seed, gr.update(value=
|
137 |
|
138 |
|
139 |
run_lora.zerogpu = True
|
@@ -151,7 +150,6 @@ css = '''
|
|
151 |
#progress{height:30px}
|
152 |
#progress .generating{display:none}
|
153 |
.progress-container {width: 100%;height: 30px;background-color: #f0f0f0;border-radius: 15px;overflow: hidden;margin-bottom: 20px}
|
154 |
-
.progress-bar {height: 100%;background-color: #4f46e5;width: calc(var(--current) / var(--total) * 100%);transition: width 0.5s ease-in-out}
|
155 |
'''
|
156 |
with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
|
157 |
title = gr.HTML(
|
@@ -185,7 +183,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
|
|
185 |
)
|
186 |
|
187 |
with gr.Column(scale=4):
|
188 |
-
progress_bar = gr.Markdown(elem_id="progress",visible=False)
|
189 |
result = gr.Image(label="Generated Image")
|
190 |
|
191 |
with gr.Row():
|
@@ -215,7 +212,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
|
|
215 |
triggers=[generate_button.click, prompt.submit],
|
216 |
fn=run_lora,
|
217 |
inputs=[prompt, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale],
|
218 |
-
outputs=[result, seed
|
219 |
)
|
220 |
|
221 |
app.queue(default_concurrency_limit=2).launch(show_error=True)
|
|
|
130 |
for image in image_generator:
|
131 |
step_counter+=1
|
132 |
final_image = image
|
133 |
+
yield image, seed, gr.update(value=progress, visible=True)
|
|
|
134 |
|
135 |
+
yield final_image, seed, gr.update(value=progress, visible=False)
|
136 |
|
137 |
|
138 |
run_lora.zerogpu = True
|
|
|
150 |
#progress{height:30px}
|
151 |
#progress .generating{display:none}
|
152 |
.progress-container {width: 100%;height: 30px;background-color: #f0f0f0;border-radius: 15px;overflow: hidden;margin-bottom: 20px}
|
|
|
153 |
'''
|
154 |
with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
|
155 |
title = gr.HTML(
|
|
|
183 |
)
|
184 |
|
185 |
with gr.Column(scale=4):
|
|
|
186 |
result = gr.Image(label="Generated Image")
|
187 |
|
188 |
with gr.Row():
|
|
|
212 |
triggers=[generate_button.click, prompt.submit],
|
213 |
fn=run_lora,
|
214 |
inputs=[prompt, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale],
|
215 |
+
outputs=[result, seed]
|
216 |
)
|
217 |
|
218 |
app.queue(default_concurrency_limit=2).launch(show_error=True)
|