Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
7fa5ee54
Commit
7fa5ee54
authored
Aug 13, 2023
by
catboxanon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support search and display of hashes for all extra network items
parent
da80d649
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
4 deletions
+13
-4
extensions-builtin/Lora/ui_extra_networks_lora.py
extensions-builtin/Lora/ui_extra_networks_lora.py
+2
-1
modules/ui_extra_networks_checkpoints.py
modules/ui_extra_networks_checkpoints.py
+1
-0
modules/ui_extra_networks_hypernets.py
modules/ui_extra_networks_hypernets.py
+5
-1
modules/ui_extra_networks_textual_inversion.py
modules/ui_extra_networks_textual_inversion.py
+2
-1
modules/ui_extra_networks_user_metadata.py
modules/ui_extra_networks_user_metadata.py
+3
-1
No files found.
extensions-builtin/Lora/ui_extra_networks_lora.py
View file @
7fa5ee54
...
...
@@ -25,9 +25,10 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
item
=
{
"name"
:
name
,
"filename"
:
lora_on_disk
.
filename
,
"shorthash"
:
lora_on_disk
.
shorthash
,
"preview"
:
self
.
find_preview
(
path
),
"description"
:
self
.
find_description
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
lora_on_disk
.
filename
),
"search_term"
:
self
.
search_terms_from_path
(
lora_on_disk
.
filename
)
+
" "
+
(
lora_on_disk
.
hash
or
""
)
,
"local_preview"
:
f
"{path}.{shared.opts.samples_format}"
,
"metadata"
:
lora_on_disk
.
metadata
,
"sort_keys"
:
{
'default'
:
index
,
**
self
.
get_sort_keys
(
lora_on_disk
.
filename
)},
...
...
modules/ui_extra_networks_checkpoints.py
View file @
7fa5ee54
...
...
@@ -19,6 +19,7 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
return
{
"name"
:
checkpoint
.
name_for_extra
,
"filename"
:
checkpoint
.
filename
,
"shorthash"
:
checkpoint
.
shorthash
,
"preview"
:
self
.
find_preview
(
path
),
"description"
:
self
.
find_description
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
checkpoint
.
filename
)
+
" "
+
(
checkpoint
.
sha256
or
""
),
...
...
modules/ui_extra_networks_hypernets.py
View file @
7fa5ee54
...
...
@@ -2,6 +2,7 @@ import os
from
modules
import
shared
,
ui_extra_networks
from
modules.ui_extra_networks
import
quote_js
from
modules.hashes
import
sha256_from_cache
class
ExtraNetworksPageHypernetworks
(
ui_extra_networks
.
ExtraNetworksPage
):
...
...
@@ -14,13 +15,16 @@ class ExtraNetworksPageHypernetworks(ui_extra_networks.ExtraNetworksPage):
def
create_item
(
self
,
name
,
index
=
None
,
enable_filter
=
True
):
full_path
=
shared
.
hypernetworks
[
name
]
path
,
ext
=
os
.
path
.
splitext
(
full_path
)
sha256
=
sha256_from_cache
(
full_path
,
f
'hypernet/{name}'
)
shorthash
=
sha256
[
0
:
10
]
if
sha256
else
None
return
{
"name"
:
name
,
"filename"
:
full_path
,
"shorthash"
:
shorthash
,
"preview"
:
self
.
find_preview
(
path
),
"description"
:
self
.
find_description
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
path
)
+
" "
+
(
sha256
or
""
)
,
"prompt"
:
quote_js
(
f
"<hypernet:{name}:"
)
+
" + opts.extra_networks_default_multiplier + "
+
quote_js
(
">"
),
"local_preview"
:
f
"{path}.preview.{shared.opts.samples_format}"
,
"sort_keys"
:
{
'default'
:
index
,
**
self
.
get_sort_keys
(
path
+
ext
)},
...
...
modules/ui_extra_networks_textual_inversion.py
View file @
7fa5ee54
...
...
@@ -19,9 +19,10 @@ class ExtraNetworksPageTextualInversion(ui_extra_networks.ExtraNetworksPage):
return
{
"name"
:
name
,
"filename"
:
embedding
.
filename
,
"shorthash"
:
embedding
.
shorthash
,
"preview"
:
self
.
find_preview
(
path
),
"description"
:
self
.
find_description
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
embedding
.
filename
),
"search_term"
:
self
.
search_terms_from_path
(
embedding
.
filename
)
+
" "
+
(
embedding
.
hash
or
""
)
,
"prompt"
:
quote_js
(
embedding
.
name
),
"local_preview"
:
f
"{path}.preview.{shared.opts.samples_format}"
,
"sort_keys"
:
{
'default'
:
index
,
**
self
.
get_sort_keys
(
embedding
.
filename
)},
...
...
modules/ui_extra_networks_user_metadata.py
View file @
7fa5ee54
...
...
@@ -93,11 +93,13 @@ class UserMetadataEditor:
item
=
self
.
page
.
items
.
get
(
name
,
{})
try
:
filename
=
item
[
"filename"
]
shorthash
=
item
.
get
(
"shorthash"
,
None
)
stats
=
os
.
stat
(
filename
)
params
=
[
(
'Filename: '
,
os
.
path
.
basename
(
filename
)),
(
'File size: '
,
sysinfo
.
pretty_bytes
(
stats
.
st_size
)),
(
'Hash: '
,
shorthash
),
(
'Modified: '
,
datetime
.
datetime
.
fromtimestamp
(
stats
.
st_mtime
)
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M'
)),
]
...
...
@@ -115,7 +117,7 @@ class UserMetadataEditor:
errors
.
display
(
e
,
f
"reading metadata info for {name}"
)
params
=
[]
table
=
'<table class="file-metadata">'
+
""
.
join
(
f
"<tr><th>{name}</th><td>{value}</td></tr>"
for
name
,
value
in
params
)
+
'</table>'
table
=
'<table class="file-metadata">'
+
""
.
join
(
f
"<tr><th>{name}</th><td>{value}</td></tr>"
for
name
,
value
in
params
if
value
is
not
None
)
+
'</table>'
return
html
.
escape
(
name
),
user_metadata
.
get
(
'description'
,
''
),
table
,
self
.
get_card_html
(
name
),
user_metadata
.
get
(
'notes'
,
''
)
...
...
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