Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
fe2f0e17
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,发现更多精彩内容 >>
提交
fe2f0e17
编写于
9月 28, 2022
作者:
B
Bernard Maltais
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adding support for inverse sigmoid interpolation
上级
c3bcc7e9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
1 deletion
+8
-1
modules/extras.py
modules/extras.py
+7
-0
modules/ui.py
modules/ui.py
+1
-1
未找到文件。
modules/extras.py
浏览文件 @
fe2f0e17
...
...
@@ -150,6 +150,12 @@ def run_modelmerger(primary_model_name, secondary_model_name, interp_method, int
alpha
=
alpha
*
alpha
*
(
3
-
(
2
*
alpha
))
return
theta0
+
((
theta1
-
theta0
)
*
alpha
)
# Inverse Smoothstep (https://en.wikipedia.org/wiki/Smoothstep)
def
inv_sigmoid
(
theta0
,
theta1
,
alpha
):
import
math
alpha
=
0.5
-
math
.
sin
(
math
.
asin
(
1.0
-
2.0
*
alpha
)
/
3.0
)
return
theta0
+
((
theta1
-
theta0
)
*
alpha
)
if
os
.
path
.
exists
(
primary_model_name
):
primary_model_filename
=
primary_model_name
primary_model_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
primary_model_name
))[
0
]
...
...
@@ -174,6 +180,7 @@ def run_modelmerger(primary_model_name, secondary_model_name, interp_method, int
theta_funcs
=
{
"Weighted Sum"
:
weighted_sum
,
"Sigmoid"
:
sigmoid
,
"Inverse Sigmoid"
:
inv_sigmoid
}
theta_func
=
theta_funcs
[
interp_method
]
...
...
modules/ui.py
浏览文件 @
fe2f0e17
...
...
@@ -864,7 +864,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo, run_modelmerger):
primary_model_name
=
gr
.
Dropdown
(
ckpt_name_list
,
elem_id
=
"modelmerger_primary_model_name"
,
label
=
"Primary Model Name"
)
secondary_model_name
=
gr
.
Dropdown
(
ckpt_name_list
,
elem_id
=
"modelmerger_secondary_model_name"
,
label
=
"Secondary Model Name"
)
interp_amount
=
gr
.
Slider
(
minimum
=
0.0
,
maximum
=
1.0
,
step
=
0.05
,
label
=
'Interpolation Amount'
,
value
=
0.3
)
interp_method
=
gr
.
Radio
(
choices
=
[
"Weighted Sum"
,
"Sigmoid"
],
value
=
"Weighted Sum"
,
label
=
"Interpolation Method"
)
interp_method
=
gr
.
Radio
(
choices
=
[
"Weighted Sum"
,
"Sigmoid"
,
"Inverse Sigmoid"
],
value
=
"Weighted Sum"
,
label
=
"Interpolation Method"
)
submit
=
gr
.
Button
(
elem_id
=
"modelmerger_merge"
,
label
=
"Merge"
,
variant
=
'primary'
)
with
gr
.
Column
(
variant
=
'panel'
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录