Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -259,7 +259,7 @@ with gr.Blocks() as demo:
|
|
| 259 |
gr.Markdown(
|
| 260 |
"Generate a circular path in latent space and observe how the images vary along the path."
|
| 261 |
)
|
| 262 |
-
gr.HTML(read_html("html/circular.html"))
|
| 263 |
|
| 264 |
with gr.Row():
|
| 265 |
with gr.Column():
|
|
@@ -277,23 +277,31 @@ with gr.Blocks() as demo:
|
|
| 277 |
)
|
| 278 |
|
| 279 |
with gr.Row():
|
| 280 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 281 |
minimum=0,
|
| 282 |
maximum=360,
|
| 283 |
step=1,
|
| 284 |
value=360,
|
| 285 |
-
label="Proportion of Circle",
|
| 286 |
info="Enter the value in degrees",
|
| 287 |
)
|
| 288 |
step_size_circular = gr.Textbox(
|
| 289 |
-
label="Step Size", value=
|
| 290 |
)
|
| 291 |
|
| 292 |
num_inference_steps_circular = gr.Slider(
|
| 293 |
minimum=2,
|
| 294 |
maximum=100,
|
| 295 |
step=1,
|
| 296 |
-
value=
|
| 297 |
label="Number of Inference Steps per Image",
|
| 298 |
)
|
| 299 |
|
|
@@ -308,18 +316,23 @@ with gr.Blocks() as demo:
|
|
| 308 |
generate_images_button_circular = gr.Button("Generate Images")
|
| 309 |
|
| 310 |
with gr.Column():
|
| 311 |
-
images_output_circular = gr.Gallery(label="Image", selected_index=0
|
| 312 |
gif_circular = gr.Image(label="GIF")
|
| 313 |
zip_output_circular = gr.File(label="Download ZIP")
|
| 314 |
|
| 315 |
num_images_circular.change(
|
| 316 |
fn=calculate_step_size,
|
| 317 |
-
inputs=[num_images_circular,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
outputs=[step_size_circular],
|
| 319 |
)
|
| 320 |
-
|
| 321 |
fn=calculate_step_size,
|
| 322 |
-
inputs=[num_images_circular,
|
| 323 |
outputs=[step_size_circular],
|
| 324 |
)
|
| 325 |
generate_images_button_circular.click(
|
|
@@ -329,7 +342,8 @@ with gr.Blocks() as demo:
|
|
| 329 |
seed_circular,
|
| 330 |
num_inference_steps_circular,
|
| 331 |
num_images_circular,
|
| 332 |
-
|
|
|
|
| 333 |
],
|
| 334 |
outputs=[images_output_circular, gif_circular, zip_output_circular],
|
| 335 |
)
|
|
|
|
| 259 |
gr.Markdown(
|
| 260 |
"Generate a circular path in latent space and observe how the images vary along the path."
|
| 261 |
)
|
| 262 |
+
gr.HTML(read_html("DiffusionDemo/html/circular.html"))
|
| 263 |
|
| 264 |
with gr.Row():
|
| 265 |
with gr.Column():
|
|
|
|
| 277 |
)
|
| 278 |
|
| 279 |
with gr.Row():
|
| 280 |
+
start_degree_circular = gr.Slider(
|
| 281 |
+
minimum=0,
|
| 282 |
+
maximum=360,
|
| 283 |
+
step=1,
|
| 284 |
+
value=180,
|
| 285 |
+
label="Start Proportion of Circle",
|
| 286 |
+
info="Enter the value in degrees",
|
| 287 |
+
)
|
| 288 |
+
end_degree_circular = gr.Slider(
|
| 289 |
minimum=0,
|
| 290 |
maximum=360,
|
| 291 |
step=1,
|
| 292 |
value=360,
|
| 293 |
+
label="End Proportion of Circle",
|
| 294 |
info="Enter the value in degrees",
|
| 295 |
)
|
| 296 |
step_size_circular = gr.Textbox(
|
| 297 |
+
label="Step Size", value=180 / 4
|
| 298 |
)
|
| 299 |
|
| 300 |
num_inference_steps_circular = gr.Slider(
|
| 301 |
minimum=2,
|
| 302 |
maximum=100,
|
| 303 |
step=1,
|
| 304 |
+
value=8,
|
| 305 |
label="Number of Inference Steps per Image",
|
| 306 |
)
|
| 307 |
|
|
|
|
| 316 |
generate_images_button_circular = gr.Button("Generate Images")
|
| 317 |
|
| 318 |
with gr.Column():
|
| 319 |
+
images_output_circular = gr.Gallery(label="Image", selected_index=0)
|
| 320 |
gif_circular = gr.Image(label="GIF")
|
| 321 |
zip_output_circular = gr.File(label="Download ZIP")
|
| 322 |
|
| 323 |
num_images_circular.change(
|
| 324 |
fn=calculate_step_size,
|
| 325 |
+
inputs=[num_images_circular, start_degree_circular, end_degree_circular],
|
| 326 |
+
outputs=[step_size_circular],
|
| 327 |
+
)
|
| 328 |
+
start_degree_circular.change(
|
| 329 |
+
fn=calculate_step_size,
|
| 330 |
+
inputs=[num_images_circular, start_degree_circular, end_degree_circular],
|
| 331 |
outputs=[step_size_circular],
|
| 332 |
)
|
| 333 |
+
end_degree_circular.change(
|
| 334 |
fn=calculate_step_size,
|
| 335 |
+
inputs=[num_images_circular, start_degree_circular, end_degree_circular],
|
| 336 |
outputs=[step_size_circular],
|
| 337 |
)
|
| 338 |
generate_images_button_circular.click(
|
|
|
|
| 342 |
seed_circular,
|
| 343 |
num_inference_steps_circular,
|
| 344 |
num_images_circular,
|
| 345 |
+
start_degree_circular,
|
| 346 |
+
end_degree_circular,
|
| 347 |
],
|
| 348 |
outputs=[images_output_circular, gif_circular, zip_output_circular],
|
| 349 |
)
|