Skip to content

Commit

Permalink
Merge pull request AUTOMATIC1111#8569 from missionfloyd/extra-network…
Browse files Browse the repository at this point in the history
…s-toggle

Make extra networks button togglable
  • Loading branch information
AUTOMATIC1111 authored Mar 27, 2023
2 parents c5e1efb + 254ad09 commit a7d6fc3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions javascript/hints.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ titles = {
"\u{1f5d1}\ufe0f": "Clear prompt",
"\u{1f4cb}": "Apply selected styles to current prompt",
"\u{1f4d2}": "Paste available values into the field",
"\u{1f3b4}": "Show extra networks",

"\u{1f3b4}": "Show/hide extra networks",

"Inpaint a part of image": "Draw a mask over an image, and the script will regenerate the masked area with content according to prompt",
"SD upscale": "Upscale image normally, split result into tiles, improve each tile using img2img, merge whole image back",
Expand Down
4 changes: 2 additions & 2 deletions modules/ui_extra_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ def create_ui(container, button, tabname):

def toggle_visibility(is_visible):
is_visible = not is_visible
return is_visible, gr.update(visible=is_visible)
return is_visible, gr.update(visible=is_visible), gr.update(variant=("primary" if is_visible else "tool"))

state_visible = gr.State(value=False)
button.click(fn=toggle_visibility, inputs=[state_visible], outputs=[state_visible, container])
button.click(fn=toggle_visibility, inputs=[state_visible], outputs=[state_visible, container, button])

def refresh():
res = []
Expand Down
7 changes: 7 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -810,3 +810,10 @@ footer {
.extra-network-cards .card ul a:hover{
color: red;
}

button[id$='_extra_networks'] {
max-width: 2.2em;
min-width: 2.2em !important;
height: 2.4em;
line-height: 1em !important;
}

0 comments on commit a7d6fc3

Please sign in to comment.