From 6a9b33c848281cb02f38764e4f91ef767f5e3edd Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 7 Sep 2022 12:32:28 +0300 Subject: codeformer support --- modules/ui.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'modules/ui.py') diff --git a/modules/ui.py b/modules/ui.py index 92d8bcdd..05161b00 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -206,7 +206,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): sampler_index = gr.Radio(label='Sampling method', elem_id="txt2img_sampling", choices=[x.name for x in samplers], value=samplers[0].name, type="index") with gr.Row(): - use_gfpgan = gr.Checkbox(label='GFPGAN', value=False, visible=gfpgan.have_gfpgan) + restore_faces = gr.Checkbox(label='Restore faces', value=False, visible=len(shared.face_restorers) > 1) tiling = gr.Checkbox(label='Tiling', value=False) with gr.Row(): @@ -253,7 +253,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): negative_prompt, steps, sampler_index, - use_gfpgan, + restore_faces, tiling, batch_count, batch_size, @@ -335,7 +335,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): inpainting_mask_invert = gr.Radio(label='Masking mode', choices=['Inpaint masked', 'Inpaint not masked'], value='Inpaint masked', type="index", visible=False) with gr.Row(): - use_gfpgan = gr.Checkbox(label='GFPGAN', value=False, visible=gfpgan.have_gfpgan) + restore_faces = gr.Checkbox(label='Restore faces', value=False, visible=len(shared.face_restorers) > 1) tiling = gr.Checkbox(label='Tiling', value=False) sd_upscale_overlap = gr.Slider(minimum=0, maximum=256, step=16, label='Tile overlap', value=64, visible=False) @@ -425,7 +425,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): sampler_index, mask_blur, inpainting_fill, - use_gfpgan, + restore_faces, tiling, switch_mode, batch_count, @@ -521,7 +521,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): extras_upscaler_2_visibility = gr.Slider(minimum=0.0, maximum=1.0, step=0.001, label="Upscaler 2 visibility", value=1) with gr.Group(): - gfpgan_strength = gr.Slider(minimum=0.0, maximum=1.0, step=0.001, label="GFPGAN strength", value=0, interactive=gfpgan.have_gfpgan) + face_restoration_blending = gr.Slider(minimum=0.0, maximum=1.0, step=0.001, label="Faces restoration visibility", value=0, interactive=len(shared.face_restorers) > 1) submit = gr.Button('Generate', elem_id="extras_generate", variant='primary') @@ -534,7 +534,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): fn=run_extras, inputs=[ image, - gfpgan_strength, + face_restoration_blending, upscaling_resize, extras_upscaler_1, extras_upscaler_2, @@ -585,7 +585,8 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): t = type(info.default) if info.component is not None: - item = info.component(label=info.label, value=fun, **(info.component_args or {})) + args = info.component_args() if callable(info.component_args) else info.component_args + item = info.component(label=info.label, value=fun, **(args or {})) elif t == str: item = gr.Textbox(label=info.label, value=fun, lines=1) elif t == int: -- cgit v1.2.3