Remove unnecessary params and change default params
parent
81636a081b
commit
2ed87c1eff
|
|
@ -179,11 +179,8 @@ def create_zoom(
|
||||||
video_zoom_mode,
|
video_zoom_mode,
|
||||||
video_start_frame_dupe_amount,
|
video_start_frame_dupe_amount,
|
||||||
video_last_frame_dupe_amount,
|
video_last_frame_dupe_amount,
|
||||||
inpainting_denoising_strength,
|
|
||||||
inpainting_mask_blur,
|
inpainting_mask_blur,
|
||||||
inpainting_fill_mode,
|
inpainting_fill_mode,
|
||||||
inpainting_full_res,
|
|
||||||
inpainting_padding,
|
|
||||||
zoom_speed,
|
zoom_speed,
|
||||||
seed,
|
seed,
|
||||||
outputsizeW,
|
outputsizeW,
|
||||||
|
|
@ -193,6 +190,9 @@ def create_zoom(
|
||||||
upscale_do,
|
upscale_do,
|
||||||
upscaler_name,
|
upscaler_name,
|
||||||
upscale_by,
|
upscale_by,
|
||||||
|
inpainting_denoising_strength=1,
|
||||||
|
inpainting_full_res=False,
|
||||||
|
inpainting_padding=0,
|
||||||
progress=None,
|
progress=None,
|
||||||
):
|
):
|
||||||
for i in range(batchcount):
|
for i in range(batchcount):
|
||||||
|
|
@ -302,11 +302,8 @@ def create_zoom_single(
|
||||||
video_zoom_mode,
|
video_zoom_mode,
|
||||||
video_start_frame_dupe_amount,
|
video_start_frame_dupe_amount,
|
||||||
video_last_frame_dupe_amount,
|
video_last_frame_dupe_amount,
|
||||||
inpainting_denoising_strength,
|
|
||||||
inpainting_mask_blur,
|
inpainting_mask_blur,
|
||||||
inpainting_fill_mode,
|
inpainting_fill_mode,
|
||||||
inpainting_full_res,
|
|
||||||
inpainting_padding,
|
|
||||||
zoom_speed,
|
zoom_speed,
|
||||||
seed,
|
seed,
|
||||||
outputsizeW,
|
outputsizeW,
|
||||||
|
|
@ -315,6 +312,9 @@ def create_zoom_single(
|
||||||
upscale_do,
|
upscale_do,
|
||||||
upscaler_name,
|
upscaler_name,
|
||||||
upscale_by,
|
upscale_by,
|
||||||
|
inpainting_denoising_strength=1,
|
||||||
|
inpainting_full_res=False,
|
||||||
|
inpainting_padding=0,
|
||||||
progress=None,
|
progress=None,
|
||||||
):
|
):
|
||||||
# try:
|
# try:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,12 @@ import os
|
||||||
from modules import scripts
|
from modules import scripts
|
||||||
import modules.sd_samplers
|
import modules.sd_samplers
|
||||||
|
|
||||||
promptTableHeaders=["Start at second [0,1,...]","Prompt"]
|
default_sampling_steps = 35
|
||||||
|
default_sampler = "DDIM"
|
||||||
|
default_cfg_scale = "DDIM"
|
||||||
|
default_mask_blur = 48
|
||||||
|
default_total_outpaints = 5
|
||||||
|
promptTableHeaders = ["Start at second [0,1,...]", "Prompt"]
|
||||||
|
|
||||||
default_prompt = """
|
default_prompt = """
|
||||||
{
|
{
|
||||||
|
|
@ -28,7 +33,7 @@ invalid_prompt = {
|
||||||
},
|
},
|
||||||
"negPrompt": "Invalid prompt-json",
|
"negPrompt": "Invalid prompt-json",
|
||||||
"prePromp": "Invalid prompt",
|
"prePromp": "Invalid prompt",
|
||||||
"postPrompt": "Invalid prompt"
|
"postPrompt": "Invalid prompt",
|
||||||
}
|
}
|
||||||
|
|
||||||
available_samplers = [
|
available_samplers = [
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,15 @@ from .run import create_zoom
|
||||||
import modules.shared as shared
|
import modules.shared as shared
|
||||||
from webui import wrap_gradio_gpu_call
|
from webui import wrap_gradio_gpu_call
|
||||||
from modules.ui import create_output_panel
|
from modules.ui import create_output_panel
|
||||||
|
|
||||||
from .static_variables import (
|
from .static_variables import (
|
||||||
default_prompt,
|
default_prompt,
|
||||||
available_samplers,
|
available_samplers,
|
||||||
|
default_total_outpaints,
|
||||||
|
default_sampling_steps,
|
||||||
|
default_cfg_scale,
|
||||||
|
default_mask_blur,
|
||||||
|
default_sampler,
|
||||||
)
|
)
|
||||||
from .helpers import putPrompts, clearPrompts
|
from .helpers import putPrompts, clearPrompts
|
||||||
from .prompt_util import readJsonPrompt
|
from .prompt_util import readJsonPrompt
|
||||||
|
|
@ -37,13 +43,11 @@ def on_ui_tabs():
|
||||||
step=1,
|
step=1,
|
||||||
label="Batch Count",
|
label="Batch Count",
|
||||||
)
|
)
|
||||||
|
main_outpaint_steps = gr.Number(
|
||||||
main_outpaint_steps = gr.Slider(
|
|
||||||
minimum=1,
|
|
||||||
maximum=100,
|
|
||||||
step=1,
|
|
||||||
value=8,
|
|
||||||
label="Total video length [s]",
|
label="Total video length [s]",
|
||||||
|
value=default_total_outpaints,
|
||||||
|
precision=0,
|
||||||
|
interactive=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
# safe reading json prompt
|
# safe reading json prompt
|
||||||
|
|
@ -56,7 +60,7 @@ def on_ui_tabs():
|
||||||
|
|
||||||
main_prompts = gr.Dataframe(
|
main_prompts = gr.Dataframe(
|
||||||
type="array",
|
type="array",
|
||||||
headers= promptTableHeaders,
|
headers=promptTableHeaders,
|
||||||
datatype=["number", "str"],
|
datatype=["number", "str"],
|
||||||
row_count=1,
|
row_count=1,
|
||||||
col_count=(2, "fixed"),
|
col_count=(2, "fixed"),
|
||||||
|
|
@ -72,7 +76,7 @@ def on_ui_tabs():
|
||||||
value=jpr["negPrompt"], label="Negative Prompt"
|
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(
|
exportPrompts_button = gr.Button(
|
||||||
value="Export prompts",
|
value="Export prompts",
|
||||||
variant="secondary",
|
variant="secondary",
|
||||||
|
|
@ -132,7 +136,7 @@ def on_ui_tabs():
|
||||||
main_sampler = gr.Dropdown(
|
main_sampler = gr.Dropdown(
|
||||||
label="Sampler",
|
label="Sampler",
|
||||||
choices=available_samplers,
|
choices=available_samplers,
|
||||||
value="Euler a",
|
value=default_sampler,
|
||||||
type="value",
|
type="value",
|
||||||
)
|
)
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
|
|
@ -155,14 +159,14 @@ def on_ui_tabs():
|
||||||
minimum=0.1,
|
minimum=0.1,
|
||||||
maximum=15,
|
maximum=15,
|
||||||
step=0.1,
|
step=0.1,
|
||||||
value=7,
|
value=default_cfg_scale,
|
||||||
label="Guidance Scale",
|
label="Guidance Scale",
|
||||||
)
|
)
|
||||||
sampling_step = gr.Slider(
|
sampling_step = gr.Slider(
|
||||||
minimum=1,
|
minimum=1,
|
||||||
maximum=100,
|
maximum=150,
|
||||||
step=1,
|
step=1,
|
||||||
value=50,
|
value=default_sampling_steps,
|
||||||
label="Sampling Steps for each outpaint",
|
label="Sampling Steps for each outpaint",
|
||||||
)
|
)
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
|
|
@ -209,11 +213,11 @@ def on_ui_tabs():
|
||||||
)
|
)
|
||||||
|
|
||||||
with gr.Tab("Outpaint"):
|
with gr.Tab("Outpaint"):
|
||||||
inpainting_denoising_strength = gr.Slider(
|
|
||||||
label="Denoising Strength", minimum=0.75, maximum=1, value=1
|
|
||||||
)
|
|
||||||
inpainting_mask_blur = gr.Slider(
|
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(
|
inpainting_fill_mode = gr.Radio(
|
||||||
label="Masked content",
|
label="Masked content",
|
||||||
|
|
@ -221,10 +225,6 @@ def on_ui_tabs():
|
||||||
value="latent noise",
|
value="latent noise",
|
||||||
type="index",
|
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"):
|
with gr.Tab("Post proccess"):
|
||||||
upscale_do = gr.Checkbox(False, label="Enable Upscale")
|
upscale_do = gr.Checkbox(False, label="Enable Upscale")
|
||||||
|
|
@ -234,7 +234,6 @@ def on_ui_tabs():
|
||||||
choices=[x.name for x in shared.sd_upscalers],
|
choices=[x.name for x in shared.sd_upscalers],
|
||||||
value=shared.sd_upscalers[0].name,
|
value=shared.sd_upscalers[0].name,
|
||||||
)
|
)
|
||||||
|
|
||||||
upscale_by = gr.Slider(
|
upscale_by = gr.Slider(
|
||||||
label="Upscale by factor", minimum=1, maximum=8, value=1
|
label="Upscale by factor", minimum=1, maximum=8, value=1
|
||||||
)
|
)
|
||||||
|
|
@ -256,7 +255,7 @@ 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(create_zoom, extra_outputs=[None, "", ""]),
|
fn=wrap_gradio_gpu_call(create_zoom, extra_outputs=[None, "", ""]),
|
||||||
inputs=[
|
inputs=[
|
||||||
|
|
@ -273,11 +272,8 @@ Our best experience and trade-off is the R-ERSGAn4x upscaler.
|
||||||
video_zoom_mode,
|
video_zoom_mode,
|
||||||
video_start_frame_dupe_amount,
|
video_start_frame_dupe_amount,
|
||||||
video_last_frame_dupe_amount,
|
video_last_frame_dupe_amount,
|
||||||
inpainting_denoising_strength,
|
|
||||||
inpainting_mask_blur,
|
inpainting_mask_blur,
|
||||||
inpainting_fill_mode,
|
inpainting_fill_mode,
|
||||||
inpainting_full_res,
|
|
||||||
inpainting_padding,
|
|
||||||
video_zoom_speed,
|
video_zoom_speed,
|
||||||
seed,
|
seed,
|
||||||
main_width,
|
main_width,
|
||||||
|
|
@ -290,17 +286,18 @@ 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],
|
||||||
)
|
)
|
||||||
|
|
||||||
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=[])
|
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):
|
def checkPrompts(p):
|
||||||
return gr.Button.update(
|
return gr.Button.update(
|
||||||
interactive=
|
interactive=any(0 in sublist for sublist in p)
|
||||||
any(0 in sublist for sublist in p)
|
or any("0" in sublist for sublist in p)
|
||||||
or
|
)
|
||||||
any('0' in sublist for sublist in p)
|
|
||||||
)
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue