Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
66eef11c
Commit
66eef11c
authored
Jan 21, 2023
by
Guillermo Moreno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(extra-networks): add default view setting
parent
985c0b8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
shared.py
modules/shared.py
+4
-0
ui_extra_networks.py
modules/ui_extra_networks.py
+4
-4
No files found.
modules/shared.py
View file @
66eef11c
...
...
@@ -430,6 +430,10 @@ options_templates.update(options_section(('interrogate', "Interrogate Options"),
"deepbooru_filter_tags"
:
OptionInfo
(
""
,
"filter out those tags from deepbooru output (separated by comma)"
),
}))
options_templates
.
update
(
options_section
((
'extra_networks'
,
"Extra Networks"
),
{
"extra_networks_default_view"
:
OptionInfo
(
"cards"
,
"Default view for Extra Networks"
,
gr
.
Dropdown
,
{
"choices"
:
[
"cards"
,
"thumbs"
]
}),
}))
options_templates
.
update
(
options_section
((
'ui'
,
"User interface"
),
{
"return_grid"
:
OptionInfo
(
True
,
"Show grid in results for web"
),
"do_not_show_images"
:
OptionInfo
(
False
,
"Do not show any images in results for web"
),
...
...
modules/ui_extra_networks.py
View file @
66eef11c
...
...
@@ -25,7 +25,7 @@ class ExtraNetworksPage:
def
refresh
(
self
):
pass
def
create_html
(
self
,
tabname
,
view
=
'cards'
):
def
create_html
(
self
,
tabname
,
view
=
shared
.
opts
.
extra_networks_default_view
):
items_html
=
''
for
item
in
self
.
list_items
():
...
...
@@ -111,7 +111,7 @@ def create_ui(container, button, tabname):
filter
=
gr
.
Textbox
(
''
,
show_label
=
False
,
elem_id
=
tabname
+
"_extra_search"
,
placeholder
=
"Search..."
,
visible
=
False
)
button_refresh
=
gr
.
Button
(
'Refresh'
,
elem_id
=
tabname
+
"_extra_refresh"
)
button_close
=
gr
.
Button
(
'Close'
,
elem_id
=
tabname
+
"_extra_close"
)
ui
.
view_dropdown
=
gr
.
Dropdown
([
'cards'
,
'thumbs'
],
elem_id
=
tabname
+
"_extra_view"
,
label
=
"View as"
,
value
=
'cards'
)
ui
.
view_dropdown
=
gr
.
Dropdown
([
'cards'
,
'thumbs'
],
elem_id
=
tabname
+
"_extra_view"
,
label
=
"View as"
,
value
=
lambda
:
shared
.
opts
.
extra_networks_default_view
)
ui
.
button_save_preview
=
gr
.
Button
(
'Save preview'
,
elem_id
=
tabname
+
"_save_preview"
,
visible
=
False
)
ui
.
preview_target_filename
=
gr
.
Textbox
(
'Preview save filename'
,
elem_id
=
tabname
+
"_preview_filename"
,
visible
=
False
)
...
...
@@ -119,7 +119,7 @@ def create_ui(container, button, tabname):
button
.
click
(
fn
=
lambda
:
gr
.
update
(
visible
=
True
),
inputs
=
[],
outputs
=
[
container
])
button_close
.
click
(
fn
=
lambda
:
gr
.
update
(
visible
=
False
),
inputs
=
[],
outputs
=
[
container
])
def
refresh
(
view
=
'cards'
):
def
refresh
(
view
):
res
=
[]
for
pg
in
ui
.
stored_extra_pages
:
...
...
@@ -142,7 +142,7 @@ def path_is_parent(parent_path, child_path):
def
setup_ui
(
ui
,
gallery
):
def
save_preview
(
index
,
images
,
filename
,
view
=
'cards'
):
def
save_preview
(
index
,
images
,
filename
,
view
):
if
len
(
images
)
==
0
:
print
(
"There is no image in gallery to save as a preview."
)
return
[
page
.
create_html
(
ui
.
tabname
)
for
page
in
ui
.
stored_extra_pages
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment