Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -270,7 +270,7 @@ def preprocess_openpose(image):
|
|
270 |
image = openpose_processor(image, hand_and_face=False, output_type='cv2')
|
271 |
height, width = image.shape[:2]
|
272 |
ratio = np.sqrt(1024. * 1024. / (width * height))
|
273 |
-
new_width, new_height = int(width * ratio), int
|
274 |
image = cv2.resize(image, (new_width, new_height))
|
275 |
return Image.fromarray(image)
|
276 |
|
@@ -450,6 +450,7 @@ with gr.Blocks() as demo:
|
|
450 |
height=235,
|
451 |
allow_preview=False
|
452 |
)
|
|
|
453 |
gallery = gr.Gallery(label="Generated Images", show_label=False, elem_id="gallery", height=820)
|
454 |
|
455 |
selected_style = gr.State(value="Anime Studio Dance")
|
@@ -506,7 +507,6 @@ with gr.Blocks() as demo:
|
|
506 |
selected_images = selected_images * batch_count
|
507 |
return generate_images_with_progress(prompt, negative_prompt, batch_count, use_controlnet, controlnet_type, mode, selected_images, num_inference_steps, progress)
|
508 |
|
509 |
-
generate_button = gr.Button("Generate Images")
|
510 |
generate_button.click(
|
511 |
generate_images_with_folder_images,
|
512 |
inputs=[prompt, negative_prompt, batch_count, use_controlnet, controlnet_type, mode, use_control_folder, selected_folder_images, batch_images_input, num_inference_steps, control_image],
|
@@ -541,7 +541,6 @@ with gr.Blocks() as demo:
|
|
541 |
)
|
542 |
|
543 |
with gr.Row():
|
544 |
-
generate_button
|
545 |
refresh_button
|
546 |
|
547 |
# At the end of your script:
|
@@ -549,4 +548,3 @@ if __name__ == "__main__":
|
|
549 |
# Your Gradio interface setup here
|
550 |
demo.launch(auth=("roland", "roland"), debug=True)
|
551 |
clear_memory()
|
552 |
-
|
|
|
270 |
image = openpose_processor(image, hand_and_face=False, output_type='cv2')
|
271 |
height, width = image.shape[:2]
|
272 |
ratio = np.sqrt(1024. * 1024. / (width * height))
|
273 |
+
new_width, new_height = int(width * ratio), int height * ratio)
|
274 |
image = cv2.resize(image, (new_width, new_height))
|
275 |
return Image.fromarray(image)
|
276 |
|
|
|
450 |
height=235,
|
451 |
allow_preview=False
|
452 |
)
|
453 |
+
generate_button = gr.Button("Generate Images")
|
454 |
gallery = gr.Gallery(label="Generated Images", show_label=False, elem_id="gallery", height=820)
|
455 |
|
456 |
selected_style = gr.State(value="Anime Studio Dance")
|
|
|
507 |
selected_images = selected_images * batch_count
|
508 |
return generate_images_with_progress(prompt, negative_prompt, batch_count, use_controlnet, controlnet_type, mode, selected_images, num_inference_steps, progress)
|
509 |
|
|
|
510 |
generate_button.click(
|
511 |
generate_images_with_folder_images,
|
512 |
inputs=[prompt, negative_prompt, batch_count, use_controlnet, controlnet_type, mode, use_control_folder, selected_folder_images, batch_images_input, num_inference_steps, control_image],
|
|
|
541 |
)
|
542 |
|
543 |
with gr.Row():
|
|
|
544 |
refresh_button
|
545 |
|
546 |
# At the end of your script:
|
|
|
548 |
# Your Gradio interface setup here
|
549 |
demo.launch(auth=("roland", "roland"), debug=True)
|
550 |
clear_memory()
|
|