Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -89,6 +89,8 @@ def generate(prompt,
|
|
89 |
return x_concept_1,x_concept_2, avg_diff_x, export_to_gif(images, "clip.gif", fps=5), canvas, images, images[scale_middle], post_generation_slider_update, seed
|
90 |
|
91 |
def update_pre_generated_images(slider_value, total_images):
|
|
|
|
|
92 |
number_images = len(total_images)
|
93 |
if(number_images > 0):
|
94 |
scale_tuple = convert_to_centered_scale(number_images)
|
@@ -173,20 +175,34 @@ with gr.Blocks(css=css) as demo:
|
|
173 |
seed = gr.Slider(minimum=0, maximum=MAX_SEED, step=1, label="Seed", interactive=True, randomize=True)
|
174 |
|
175 |
examples_gradio = gr.Examples(
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
)
|
182 |
|
183 |
-
submit.click(
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
if __name__ == "__main__":
|
192 |
demo.launch()
|
|
|
89 |
return x_concept_1,x_concept_2, avg_diff_x, export_to_gif(images, "clip.gif", fps=5), canvas, images, images[scale_middle], post_generation_slider_update, seed
|
90 |
|
91 |
def update_pre_generated_images(slider_value, total_images):
|
92 |
+
print(total_images)
|
93 |
+
print(slider_value)
|
94 |
number_images = len(total_images)
|
95 |
if(number_images > 0):
|
96 |
scale_tuple = convert_to_centered_scale(number_images)
|
|
|
175 |
seed = gr.Slider(minimum=0, maximum=MAX_SEED, step=1, label="Seed", interactive=True, randomize=True)
|
176 |
|
177 |
examples_gradio = gr.Examples(
|
178 |
+
examples=examples,
|
179 |
+
inputs=[prompt, concept_1, concept_2, x],
|
180 |
+
fn=generate,
|
181 |
+
outputs=[x_concept_1, x_concept_2, avg_diff_x, output_image, image_seq, total_images, post_generation_image, post_generation_slider, seed],
|
182 |
+
cache_examples="lazy"
|
183 |
)
|
184 |
|
185 |
+
submit.click(
|
186 |
+
fn=generate,
|
187 |
+
inputs=[prompt, concept_1, concept_2, x, randomize_seed, seed, recalc_directions, iterations, steps, interm_steps, guidance_scale, x_concept_1, x_concept_2, avg_diff_x, total_images],
|
188 |
+
outputs=[x_concept_1, x_concept_2, avg_diff_x, output_image, image_seq, total_images, post_generation_image, post_generation_slider, seed]
|
189 |
+
)
|
190 |
+
iterations.change(
|
191 |
+
fn=reset_recalc_directions,
|
192 |
+
outputs=[recalc_directions]
|
193 |
+
)
|
194 |
+
seed.change(
|
195 |
+
fn=reset_recalc_directions,
|
196 |
+
outputs=[recalc_directions]
|
197 |
+
)
|
198 |
+
post_generation_slider.change(
|
199 |
+
fn=update_pre_generated_images,
|
200 |
+
inputs=[post_generation_slider, total_images],
|
201 |
+
outputs=[post_generation_image],
|
202 |
+
queue=False,
|
203 |
+
show_progress="hidden",
|
204 |
+
concurrency_limit=None
|
205 |
+
)
|
206 |
|
207 |
if __name__ == "__main__":
|
208 |
demo.launch()
|