From d8703520ecda951a8060451e668cf51fd42d9ed1 Mon Sep 17 00:00:00 2001 From: GeorgLegato Date: Sun, 30 Apr 2023 22:39:31 +0200 Subject: [PATCH] added check --- iz_helpers/ui.py | 66 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/iz_helpers/ui.py b/iz_helpers/ui.py index 51ce9d2..f6db773 100644 --- a/iz_helpers/ui.py +++ b/iz_helpers/ui.py @@ -256,7 +256,7 @@ Our best experience and trade-off is the R-ERSGAn4x upscaler. "infinite-zoom", shared.opts.outdir_img2img_samples ) generate_btn.click( - fn=wrap_gradio_gpu_call(create_zoom, extra_outputs=[None, "", ""]), + fn=wrap_gradio_gpu_call(check_create_zoom, extra_outputs=[None, "", ""]), inputs=[ main_common_prompt_pre, main_prompts, @@ -291,3 +291,67 @@ Our best experience and trade-off is the R-ERSGAn4x upscaler. interrupt.click(fn=lambda: shared.state.interrupt(), inputs=[], outputs=[]) infinite_zoom_interface.queue() return [(infinite_zoom_interface, "Infinite Zoom", "iz_interface")] + + + +def check_create_zoom( + main_common_prompt_pre, + main_prompts, + main_common_prompt_suf, + main_negative_prompt, + main_outpaint_steps, + main_guidance_scale, + sampling_step, + init_image, + exit_image, + video_frame_rate, + video_zoom_mode, + video_start_frame_dupe_amount, + video_last_frame_dupe_amount, + inpainting_denoising_strength, + inpainting_mask_blur, + inpainting_fill_mode, + inpainting_full_res, + inpainting_padding, + video_zoom_speed, + seed, + main_width, + main_height, + batchcount_slider, + main_sampler, + upscale_do, + upscaler_name, + upscale_by, +): + keys = main_prompts.keys() + if 0 not in keys: + raise gr.Error("Ensure your prompt table has a step 9 (zero) prompt") + + return create_zoom( main_common_prompt_pre, + main_prompts, + main_common_prompt_suf, + main_negative_prompt, + main_outpaint_steps, + main_guidance_scale, + sampling_step, + init_image, + exit_image, + video_frame_rate, + video_zoom_mode, + video_start_frame_dupe_amount, + video_last_frame_dupe_amount, + inpainting_denoising_strength, + inpainting_mask_blur, + inpainting_fill_mode, + inpainting_full_res, + inpainting_padding, + video_zoom_speed, + seed, + main_width, + main_height, + batchcount_slider, + main_sampler, + upscale_do, + upscaler_name, + upscale_by, + ) \ No newline at end of file