changed wording to help users understand concept very easily. disabling generate button on invalid table

pull/75/head
GeorgLegato 2023-05-01 01:29:11 +02:00
parent 430b2d2310
commit 78d1e48856
2 changed files with 17 additions and 70 deletions

View File

@ -42,7 +42,7 @@ def on_ui_tabs():
maximum=100, maximum=100,
step=1, step=1,
value=8, value=8,
label="Total Outpaint Steps", label="Total video length [s]",
) )
# safe reading json prompt # safe reading json prompt
@ -55,7 +55,7 @@ def on_ui_tabs():
main_prompts = gr.Dataframe( main_prompts = gr.Dataframe(
type="array", type="array",
headers=["outpaint step", "prompt"], headers=["Start at second [0,1,...]", "Prompt"],
datatype=["number", "str"], datatype=["number", "str"],
row_count=1, row_count=1,
col_count=(2, "fixed"), col_count=(2, "fixed"),
@ -255,8 +255,9 @@ Our best experience and trade-off is the R-ERSGAn4x upscaler.
) = create_output_panel( ) = create_output_panel(
"infinite-zoom", shared.opts.outdir_img2img_samples "infinite-zoom", shared.opts.outdir_img2img_samples
) )
generate_btn.click( generate_btn.click(
fn=wrap_gradio_gpu_call(check_create_zoom, extra_outputs=[None, "", ""]), fn=wrap_gradio_gpu_call(create_zoom, extra_outputs=[None, "", ""]),
inputs=[ inputs=[
main_common_prompt_pre, main_common_prompt_pre,
main_prompts, main_prompts,
@ -288,70 +289,17 @@ Our best experience and trade-off is the R-ERSGAn4x upscaler.
], ],
outputs=[output_video, out_image, generation_info, html_info, html_log], outputs=[output_video, out_image, generation_info, html_info, html_log],
) )
interrupt.click(fn=lambda: shared.state.interrupt(), inputs=[], outputs=[])
main_prompts.change(fn=checkPrompts,inputs=[main_prompts], outputs=[generate_btn])
interrupt.click(fn=shared.state.interrupt(), inputs=[], outputs=[])
infinite_zoom_interface.queue() infinite_zoom_interface.queue()
return [(infinite_zoom_interface, "Infinite Zoom", "iz_interface")] return [(infinite_zoom_interface, "Infinite Zoom", "iz_interface")]
def checkPrompts(p):
return gr.Button.update(
def check_create_zoom( interactive=
main_common_prompt_pre, any(0 in sublist for sublist in p)
main_prompts, or
main_common_prompt_suf, any('0' in sublist for sublist in p)
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,
) )

View File

@ -2,7 +2,7 @@
infzoom_titles = { infzoom_titles = {
"Batch Count":"How many separate videos to create", "Batch Count":"How many separate videos to create",
"Total Outpaint Steps":"The more it is, the longer your videos will be. Each step generates frame for 1 second at your FPS, while cycling through your array of prompts", "Total video length [s]":"For each seconds frame (FPS) will be generated. Define prompts at which time they should start wihtin this duration.",
"Common Prompt Prefix":"Prompt inserted before each step", "Common Prompt Prefix":"Prompt inserted before each step",
"Common Prompt Suffix":"Prompt inserted after each step", "Common Prompt Suffix":"Prompt inserted after each step",
"Negative Prompt":"What your model shall avoid", "Negative Prompt":"What your model shall avoid",
@ -12,9 +12,8 @@ infzoom_titles = {
"Custom initial image":"An image at the end resp. begin of your movie, depending or ZoomIn or Out", "Custom initial image":"An image at the end resp. begin of your movie, depending or ZoomIn or Out",
"Custom exit image":"An image at the end resp. begin of your movie, depending or ZoomIn or Out", "Custom exit image":"An image at the end resp. begin of your movie, depending or ZoomIn or Out",
"Zoom Speed":"Varies additional frames per second", "Zoom Speed":"Varies additional frames per second",
"Start at second [0,1,...]": "At which time the prompt has to be occure. We need at least one prompt starting at time 0",
"Generate video": "Start rendering. If it´s disabled the prompt table is invalid, check we have a start prompt at time 0"
} }