Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
7b052eb7
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
12 个月 前同步成功
通知
1771
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
7b052eb7
编写于
7月 16, 2023
作者:
A
AUTOMATIC1111
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add resolution calculation from buckets for lora user metadata page
上级
ccd97886
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
7 deletion
+22
-7
extensions-builtin/Lora/lora.py
extensions-builtin/Lora/lora.py
+0
-1
extensions-builtin/Lora/ui_edit_user_metadata.py
extensions-builtin/Lora/ui_edit_user_metadata.py
+22
-6
未找到文件。
extensions-builtin/Lora/lora.py
浏览文件 @
7b052eb7
...
...
@@ -86,7 +86,6 @@ class LoraOnDisk:
if
self
.
is_safetensors
:
try
:
#self.metadata = sd_models.read_metadata_from_safetensors(filename)
self
.
metadata
=
cache
.
cached_data_for_file
(
'safetensors-metadata'
,
"lora/"
+
self
.
name
,
filename
,
read_metadata
)
except
Exception
as
e
:
errors
.
display
(
e
,
f
"reading lora
{
filename
}
"
)
...
...
extensions-builtin/Lora/ui_edit_user_metadata.py
浏览文件 @
7b052eb7
...
...
@@ -65,17 +65,33 @@ class LoraUserMetadataEditor(ui_extra_networks_user_metadata.UserMetadataEditor)
item
=
self
.
page
.
items
.
get
(
name
,
{})
metadata
=
item
.
get
(
"metadata"
)
or
{}
keys
=
[
(
'ss_sd_model_name'
,
"Model:"
),
(
'ss_resolution'
,
"Resolution:"
),
(
'ss_clip_skip'
,
"Clip skip:"
),
]
keys
=
{
'ss_sd_model_name'
:
"Model:"
,
'ss_clip_skip'
:
"Clip skip:"
,
}
for
key
,
label
in
keys
:
for
key
,
label
in
keys
.
items
()
:
value
=
metadata
.
get
(
key
,
None
)
if
value
is
not
None
and
str
(
value
)
!=
"None"
:
table
.
append
((
label
,
html
.
escape
(
value
)))
ss_bucket_info
=
metadata
.
get
(
"ss_bucket_info"
)
if
ss_bucket_info
and
"buckets"
in
ss_bucket_info
:
resolutions
=
{}
for
_
,
bucket
in
ss_bucket_info
[
"buckets"
].
items
():
resolution
=
bucket
[
"resolution"
]
resolution
=
f
'
{
resolution
[
1
]
}
x
{
resolution
[
0
]
}
'
resolutions
[
resolution
]
=
resolutions
.
get
(
resolution
,
0
)
+
int
(
bucket
[
"count"
])
resolutions_list
=
sorted
(
resolutions
.
keys
(),
key
=
resolutions
.
get
,
reverse
=
True
)
resolutions_text
=
html
.
escape
(
", "
.
join
(
resolutions_list
[
0
:
4
]))
if
len
(
resolutions
)
>
4
:
resolutions_text
+=
", ..."
resolutions_text
=
f
"<span title='
{
html
.
escape
(
', '
.
join
(
resolutions_list
))
}
'>
{
resolutions_text
}
</span>"
table
.
append
((
'Resolutions:'
if
len
(
resolutions_list
)
>
1
else
'Resolution:'
,
resolutions_text
))
image_count
=
0
for
_
,
params
in
metadata
.
get
(
"ss_dataset_dirs"
,
{}).
items
():
image_count
+=
int
(
params
.
get
(
"img_count"
,
0
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录