Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
ce68ab8d
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
10 个月 前同步成功
通知
1747
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ce68ab8d
编写于
3月 11, 2023
作者:
A
AUTOMATIC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove underscores from function names in #8366
remove LRU from #8366 because I don't know why it's there
上级
c239b3d7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
13 deletion
+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
未找到文件。
extensions-builtin/Lora/ui_extra_networks_lora.py
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录