Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display effection region mask upload regardless of input mode #2873

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions scripts/controlnet_ui/controlnet_ui_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,17 +339,6 @@ def render(self, tabname: str, elem_id_tabname: str) -> None:
elem_classes=["cnet-close-preview"],
)

with gr.Group(
visible=False, elem_classes=["cnet-mask-image-group"]
) as self.mask_image_group:
self.effective_region_mask = gr.Image(
value=None,
label="Effective Region Mask",
elem_id=f"{elem_id_tabname}_{tabname}_mask_image",
elem_classes=["cnet-effective-region-mask-image"],
interactive=True,
)

with gr.Tab(label="Batch") as self.batch_tab:
self.batch_image_dir = gr.Textbox(
label="Input Directory",
Expand All @@ -369,6 +358,18 @@ def render(self, tabname: str, elem_id_tabname: str) -> None:
)
self.merge_clear_button = gr.Button("Clear Images")

# Note: effective region mask works with all 3 input types.
with gr.Group(
visible=False, elem_classes=["cnet-mask-image-group"]
) as self.mask_image_group:
self.effective_region_mask = gr.Image(
value=None,
label="Effective Region Mask",
elem_id=f"{elem_id_tabname}_{tabname}_mask_image",
elem_classes=["cnet-effective-region-mask-image"],
interactive=True,
)

if self.photopea:
self.photopea.attach_photopea_output(self.generated_image)

Expand Down
Loading