Revert "ui"

This reverts commit fab6fb7a44.
This commit is contained in:
lllyasviel
2024-01-30 22:17:57 -08:00
parent fab6fb7a44
commit 5d0ddde772
2 changed files with 89 additions and 83 deletions

View File

@@ -315,6 +315,8 @@ class ControlNetUiGroup(object):
with gr.Group(visible=not self.is_img2img) as self.image_upload_panel:
self.save_detected_map = gr.Checkbox(value=True, visible=False)
with gr.Tabs():
with gr.Tab(label="Single Image") as self.upload_tab:
with gr.Row(elem_classes=["cnet-image-row"], equal_height=True):
with gr.Group(elem_classes=["cnet-input-image-group"]):
self.image = gr.Image(
@@ -373,11 +375,6 @@ class ControlNetUiGroup(object):
interactive=True,
)
with gr.Row(visible=False):
with gr.Tabs():
with gr.Tab(label="Single Image") as self.upload_tab:
pass
with gr.Tab(label="Batch") as self.batch_tab:
self.batch_image_dir = gr.Textbox(
label="Input Directory",

View File

@@ -88,11 +88,20 @@ class ControlNetForForgeOfficial(scripts.Script):
with gr.Group(elem_id=elem_id_tabname):
with gr.Accordion(f"ControlNet Integrated", open=False, elem_id="controlnet"):
photopea = Photopea() if not shared.opts.data.get("controlnet_disable_photopea_edit", False) else None
if max_models > 1:
with gr.Tabs(elem_id=f"{elem_id_tabname}_tabs"):
for i in range(max_models):
with gr.Accordion(f"ControlNet Unit {i}", elem_classes=['cnet-unit-tab'], open=i == 0):
with gr.Tab(f"ControlNet Unit {i}",
elem_classes=['cnet-unit-tab']):
group, state = self.uigroup(f"ControlNet-{i}", is_img2img, elem_id_tabname, photopea)
ui_groups.append(group)
controls.append(state)
else:
with gr.Column():
group, state = self.uigroup(f"ControlNet", is_img2img, elem_id_tabname, photopea)
ui_groups.append(group)
controls.append(state)
for i, ui_group in enumerate(ui_groups):
infotext.register_unit(i, ui_group)
if shared.opts.data.get("control_net_sync_field_args", True):