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
ce68ab8d
Commit
ce68ab8d
authored
Mar 11, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove underscores from function names in #8366
remove LRU from #8366 because I don't know why it's there
parent
c239b3d7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
13 deletions
+11
-13
extensions-builtin/Lora/ui_extra_networks_lora.py
extensions-builtin/Lora/ui_extra_networks_lora.py
+2
-2
modules/ui_extra_networks.py
modules/ui_extra_networks.py
+3
-5
modules/ui_extra_networks_checkpoints.py
modules/ui_extra_networks_checkpoints.py
+2
-2
modules/ui_extra_networks_hypernets.py
modules/ui_extra_networks_hypernets.py
+2
-2
modules/ui_extra_networks_textual_inversion.py
modules/ui_extra_networks_textual_inversion.py
+2
-2
No files found.
extensions-builtin/Lora/ui_extra_networks_lora.py
View file @
ce68ab8d
...
...
@@ -18,8 +18,8 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
yield
{
"name"
:
name
,
"filename"
:
path
,
"preview"
:
self
.
_
find_preview
(
path
),
"description"
:
self
.
_
find_description
(
path
),
"preview"
:
self
.
find_preview
(
path
),
"description"
:
self
.
find_description
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
lora_on_disk
.
filename
),
"prompt"
:
json
.
dumps
(
f
"<lora:{name}:"
)
+
" + opts.extra_networks_default_multiplier + "
+
json
.
dumps
(
">"
),
"local_preview"
:
path
+
".png"
,
...
...
modules/ui_extra_networks.py
View file @
ce68ab8d
import
glob
import
os.path
import
urllib.parse
from
functools
import
lru_cache
from
pathlib
import
Path
from
typing
import
Optional
from
modules
import
shared
import
gradio
as
gr
...
...
@@ -140,17 +138,17 @@ class ExtraNetworksPage:
return
self
.
card_page
.
format
(
**
args
)
def
_find_preview
(
self
,
path
:
str
)
->
Optional
[
str
]
:
def
find_preview
(
self
,
path
)
:
"""
Find a preview PNG for a given path (without extension) and call link_preview on it.
"""
for
file
in
[
path
+
".png"
,
path
+
".preview.png"
]:
if
os
.
path
.
isfile
(
file
):
return
self
.
link_preview
(
file
)
return
None
@
lru_cache
(
maxsize
=
512
)
def
_find_description
(
self
,
path
:
str
)
->
Optional
[
str
]:
def
find_description
(
self
,
path
):
"""
Find and read a description file for a given path (without extension).
"""
...
...
modules/ui_extra_networks_checkpoints.py
View file @
ce68ab8d
...
...
@@ -19,8 +19,8 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
yield
{
"name"
:
checkpoint
.
name_for_extra
,
"filename"
:
path
,
"preview"
:
self
.
_
find_preview
(
path
),
"description"
:
self
.
_
find_description
(
path
),
"preview"
:
self
.
find_preview
(
path
),
"description"
:
self
.
find_description
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
checkpoint
.
filename
)
+
" "
+
(
checkpoint
.
sha256
or
""
),
"onclick"
:
'"'
+
html
.
escape
(
f
"""return selectCheckpoint({json.dumps(name)})"""
)
+
'"'
,
"local_preview"
:
path
+
".png"
,
...
...
modules/ui_extra_networks_hypernets.py
View file @
ce68ab8d
...
...
@@ -18,8 +18,8 @@ class ExtraNetworksPageHypernetworks(ui_extra_networks.ExtraNetworksPage):
yield
{
"name"
:
name
,
"filename"
:
path
,
"preview"
:
self
.
_
find_preview
(
path
),
"description"
:
self
.
_
find_description
(
path
),
"preview"
:
self
.
find_preview
(
path
),
"description"
:
self
.
find_description
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
path
),
"prompt"
:
json
.
dumps
(
f
"<hypernet:{name}:"
)
+
" + opts.extra_networks_default_multiplier + "
+
json
.
dumps
(
">"
),
"local_preview"
:
path
+
".png"
,
...
...
modules/ui_extra_networks_textual_inversion.py
View file @
ce68ab8d
...
...
@@ -18,8 +18,8 @@ class ExtraNetworksPageTextualInversion(ui_extra_networks.ExtraNetworksPage):
yield
{
"name"
:
embedding
.
name
,
"filename"
:
embedding
.
filename
,
"preview"
:
self
.
_
find_preview
(
path
),
"description"
:
self
.
_
find_description
(
path
),
"preview"
:
self
.
find_preview
(
path
),
"description"
:
self
.
find_description
(
path
),
"search_term"
:
self
.
search_terms_from_path
(
embedding
.
filename
),
"prompt"
:
json
.
dumps
(
embedding
.
name
),
"local_preview"
:
path
+
".preview.png"
,
...
...
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