mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-21 07:30:02 +08:00
Add attributes to checkboxes for persisting
This commit is contained in:
parent
5194a58278
commit
714dcda068
@ -418,7 +418,9 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
|
|||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
restore_faces = gr.Checkbox(label='Restore faces', value=False, visible=len(shared.face_restorers) > 1)
|
restore_faces = gr.Checkbox(label='Restore faces', value=False, visible=len(shared.face_restorers) > 1)
|
||||||
|
restore_faces.add_to_ui_config = True
|
||||||
tiling = gr.Checkbox(label='Tiling', value=False)
|
tiling = gr.Checkbox(label='Tiling', value=False)
|
||||||
|
tiling.add_to_ui_config = True
|
||||||
enable_hr = gr.Checkbox(label='Highres. fix', value=False)
|
enable_hr = gr.Checkbox(label='Highres. fix', value=False)
|
||||||
|
|
||||||
with gr.Row(visible=False) as hr_options:
|
with gr.Row(visible=False) as hr_options:
|
||||||
@ -575,6 +577,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
|
|||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
inpaint_full_res = gr.Checkbox(label='Inpaint at full resolution', value=False)
|
inpaint_full_res = gr.Checkbox(label='Inpaint at full resolution', value=False)
|
||||||
|
inpaint_full_res.add_to_ui_config = True
|
||||||
inpaint_full_res_padding = gr.Slider(label='Inpaint at full resolution padding, pixels', minimum=0, maximum=256, step=4, value=32)
|
inpaint_full_res_padding = gr.Slider(label='Inpaint at full resolution padding, pixels', minimum=0, maximum=256, step=4, value=32)
|
||||||
|
|
||||||
with gr.TabItem('Batch img2img', id='batch'):
|
with gr.TabItem('Batch img2img', id='batch'):
|
||||||
@ -595,7 +598,9 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
|
|||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
restore_faces = gr.Checkbox(label='Restore faces', value=False, visible=len(shared.face_restorers) > 1)
|
restore_faces = gr.Checkbox(label='Restore faces', value=False, visible=len(shared.face_restorers) > 1)
|
||||||
|
restore_faces.add_to_ui_config = True
|
||||||
tiling = gr.Checkbox(label='Tiling', value=False)
|
tiling = gr.Checkbox(label='Tiling', value=False)
|
||||||
|
tiling.add_to_ui_config = True
|
||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
batch_count = gr.Slider(minimum=1, maximum=cmd_opts.max_batch_count, step=1, label='Batch count', value=1)
|
batch_count = gr.Slider(minimum=1, maximum=cmd_opts.max_batch_count, step=1, label='Batch count', value=1)
|
||||||
@ -1054,6 +1059,9 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
|
|||||||
if type(x) == gr.Radio:
|
if type(x) == gr.Radio:
|
||||||
apply_field(x, 'value', lambda val: val in x.choices)
|
apply_field(x, 'value', lambda val: val in x.choices)
|
||||||
|
|
||||||
|
if type(x) == gr.Checkbox and getattr(x,'add_to_ui_config',False):
|
||||||
|
apply_field(x, 'value')
|
||||||
|
|
||||||
visit(txt2img_interface, loadsave, "txt2img")
|
visit(txt2img_interface, loadsave, "txt2img")
|
||||||
visit(img2img_interface, loadsave, "img2img")
|
visit(img2img_interface, loadsave, "img2img")
|
||||||
visit(extras_interface, loadsave, "extras")
|
visit(extras_interface, loadsave, "extras")
|
||||||
|
Loading…
Reference in New Issue
Block a user