Remove unnecessary params and change default params

exit_image
vahid K. nejad 2023-05-02 09:50:42 +04:00 committed by Charles Fettinger
parent 576259c7da
commit 26f247d84e
3 changed files with 35 additions and 36 deletions

View File

@ -169,11 +169,8 @@ def create_zoom(
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,
zoom_speed,
seed,
outputsizeW,
@ -183,6 +180,9 @@ def create_zoom(
upscale_do,
upscaler_name,
upscale_by,
inpainting_denoising_strength=1,
inpainting_full_res=False,
inpainting_padding=0,
progress=None,
):
for i in range(batchcount):
@ -305,11 +305,8 @@ def create_zoom_single(
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,
zoom_speed,
seed,
outputsizeW,
@ -318,6 +315,9 @@ def create_zoom_single(
upscale_do,
upscaler_name,
upscale_by,
inpainting_denoising_strength=1,
inpainting_full_res=False,
inpainting_padding=0,
progress=None,
):
# try:

View File

@ -32,7 +32,7 @@ invalid_prompt = {
},
"negPrompt": "Invalid prompt-json",
"prePromp": "Invalid prompt",
"postPrompt": "Invalid prompt"
"postPrompt": "Invalid prompt",
}
available_samplers = [

View File

@ -4,11 +4,17 @@ from .run import create_zoom
import modules.shared as shared
from webui import wrap_gradio_gpu_call
from modules.ui import create_output_panel
from .static_variables import (
default_prompt,
empty_prompt,
invalid_prompt,
available_samplers,
default_total_outpaints,
default_sampling_steps,
default_cfg_scale,
default_mask_blur,
default_sampler,
)
from .helpers import validatePromptJson_throws, putPrompts, clearPrompts
from .prompt_util import readJsonPrompt
@ -47,6 +53,9 @@ def on_ui_tabs():
step=1,
value=8,
label="Total video length [s]",
value=default_total_outpaints,
precision=0,
interactive=True,
)
# safe reading json prompt
@ -57,9 +66,7 @@ def on_ui_tabs():
value=jpr["prePrompt"], label="Common Prompt Prefix"
)
main_prompts = gr.Dataframe(
type="array",
headers=["outpaint step", "prompt", "image location", "blend mask", "is keyframe"],
datatype=["number", "str", "str", "str", "bool"],
type="array",
headers= promptTableHeaders,
datatype=["number", "str", "str", "str", "bool"],
row_count=1,
@ -76,7 +83,7 @@ def on_ui_tabs():
value=jpr["negPrompt"], label="Negative Prompt"
)
# these button will be moved using JS unde the dataframe view as small ones
# these button will be moved using JS under the dataframe view as small ones
exportPrompts_button = gr.Button(
value="Export prompts",
variant="secondary",
@ -136,7 +143,7 @@ def on_ui_tabs():
main_sampler = gr.Dropdown(
label="Sampler",
choices=available_samplers,
value="Euler a",
value=default_sampler,
type="value",
)
with gr.Row():
@ -159,14 +166,14 @@ def on_ui_tabs():
minimum=0.1,
maximum=15,
step=0.1,
value=7,
value=default_cfg_scale,
label="Guidance Scale",
)
sampling_step = gr.Slider(
minimum=1,
maximum=100,
maximum=150,
step=1,
value=50,
value=default_sampling_steps,
label="Sampling Steps for each outpaint",
)
with gr.Row():
@ -210,11 +217,11 @@ def on_ui_tabs():
)
with gr.Tab("Outpaint"):
inpainting_denoising_strength = gr.Slider(
label="Denoising Strength", minimum=0.75, maximum=1, value=1
)
inpainting_mask_blur = gr.Slider(
label="Mask Blur", minimum=0, maximum=64, value=0
label="Mask Blur",
minimum=0,
maximum=64,
value=default_mask_blur,
)
inpainting_fill_mode = gr.Radio(
label="Masked content",
@ -222,10 +229,6 @@ def on_ui_tabs():
value="latent noise",
type="index",
)
inpainting_full_res = gr.Checkbox(label="Inpaint Full Resolution")
inpainting_padding = gr.Slider(
label="masked padding", minimum=0, maximum=256, value=0
)
with gr.Tab("Post proccess"):
upscale_do = gr.Checkbox(False, label="Enable Upscale")
@ -235,7 +238,6 @@ def on_ui_tabs():
choices=[x.name for x in shared.sd_upscalers],
value=shared.sd_upscalers[0].name,
)
upscale_by = gr.Slider(
label="Upscale by factor", minimum=1, maximum=8, value=1
)
@ -257,7 +259,7 @@ Our best experience and trade-off is the R-ERSGAn4x upscaler.
) = create_output_panel(
"infinite-zoom", shared.opts.outdir_img2img_samples
)
generate_btn.click(
fn=wrap_gradio_gpu_call(create_zoom, extra_outputs=[None, "", ""]),
inputs=[
@ -274,11 +276,8 @@ Our best experience and trade-off is the R-ERSGAn4x upscaler.
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,
@ -291,9 +290,11 @@ Our best experience and trade-off is the R-ERSGAn4x upscaler.
],
outputs=[output_video, out_image, generation_info, html_info, html_log],
)
main_prompts.change(fn=checkPrompts,inputs=[main_prompts], outputs=[generate_btn])
main_prompts.change(
fn=checkPrompts, inputs=[main_prompts], outputs=[generate_btn]
)
interrupt.click(fn=shared.state.interrupt(), inputs=[], outputs=[])
infinite_zoom_interface.queue()
return [(infinite_zoom_interface, "Infinite Zoom", "iz_interface")]
@ -364,8 +365,6 @@ def check_create_zoom(
def checkPrompts(p):
return gr.Button.update(
interactive=
any(0 in sublist for sublist in p)
or
any('0' in sublist for sublist in p)
)
interactive=any(0 in sublist for sublist in p)
or any("0" in sublist for sublist in p)
)