Added UI elements to control blending parameters.

This commit is contained in:
CodeHatchling 2023-11-28 16:15:36 -07:00
parent a6e5846453
commit debf836fcc
7 changed files with 82 additions and 5 deletions

View file

@ -732,6 +732,9 @@ def create_ui():
with FormRow():
mask_blur = gr.Slider(label='Mask blur', minimum=0, maximum=64, step=1, value=4, elem_id="img2img_mask_blur")
mask_alpha = gr.Slider(label="Mask transparency", visible=False, elem_id="img2img_mask_alpha")
mask_blend_power = gr.Slider(label='Mask blend power', minimum=0, maximum=8, step=0.1, value=1, elem_id="img2img_mask_blend_power")
mask_blend_scale = gr.Slider(label='Mask blend scale', minimum=0, maximum=8, step=0.1, value=1, elem_id="img2img_mask_blend_scale")
mask_blend_offset = gr.Slider(label='Mask blend offset', minimum=-4, maximum=4, step=0.1, value=0, elem_id="img2img_mask_blend_offset")
with FormRow():
inpainting_mask_invert = gr.Radio(label='Mask mode', choices=['Inpaint masked', 'Inpaint not masked'], value='Inpaint masked', type="index", elem_id="img2img_mask_mode")
@ -781,6 +784,9 @@ def create_ui():
sampler_name,
mask_blur,
mask_alpha,
mask_blend_power,
mask_blend_scale,
mask_blend_offset,
inpainting_fill,
batch_count,
batch_size,
@ -879,6 +885,9 @@ def create_ui():
(toprow.ui_styles.dropdown, lambda d: d["Styles array"] if isinstance(d.get("Styles array"), list) else gr.update()),
(denoising_strength, "Denoising strength"),
(mask_blur, "Mask blur"),
(mask_blend_power, "Mask blend power"),
(mask_blend_scale, "Mask blend scale"),
(mask_blend_offset, "Mask blend offset"),
*scripts.scripts_img2img.infotext_fields
]
parameters_copypaste.add_paste_fields("img2img", init_img, img2img_paste_fields, override_settings)