Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
3f417566
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,发现更多精彩内容 >>
提交
3f417566
编写于
10月 01, 2022
作者:
D
DepFA
提交者:
AUTOMATIC1111
10月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete alternate_sampler_noise_schedules.py
上级
bd4fc663
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
53 deletion
+0
-53
scripts/alternate_sampler_noise_schedules.py
scripts/alternate_sampler_noise_schedules.py
+0
-53
未找到文件。
scripts/alternate_sampler_noise_schedules.py
已删除
100644 → 0
浏览文件 @
bd4fc663
import
inspect
from
modules.processing
import
Processed
,
process_images
import
gradio
as
gr
import
modules.scripts
as
scripts
import
k_diffusion.sampling
import
torch
class
Script
(
scripts
.
Script
):
def
title
(
self
):
return
"Alternate Sampler Noise Schedules"
def
ui
(
self
,
is_img2img
):
noise_scheduler
=
gr
.
Dropdown
(
label
=
"Noise Scheduler"
,
choices
=
[
'Default'
,
'Karras'
,
'Exponential'
,
'Variance Preserving'
],
value
=
'Default'
,
type
=
"index"
)
sched_smin
=
gr
.
Slider
(
value
=
0.1
,
label
=
"Sigma min"
,
minimum
=
0.0
,
maximum
=
100.0
,
step
=
0.5
,)
sched_smax
=
gr
.
Slider
(
value
=
10.0
,
label
=
"Sigma max"
,
minimum
=
0.0
,
maximum
=
100.0
,
step
=
0.5
)
sched_rho
=
gr
.
Slider
(
value
=
7.0
,
label
=
"Sigma rho (Karras only)"
,
minimum
=
7.0
,
maximum
=
100.0
,
step
=
0.5
)
sched_beta_d
=
gr
.
Slider
(
value
=
19.9
,
label
=
"Beta distribution (VP only)"
,
minimum
=
0.0
,
maximum
=
40.0
,
step
=
0.5
)
sched_beta_min
=
gr
.
Slider
(
value
=
0.1
,
label
=
"Beta min (VP only)"
,
minimum
=
0.0
,
maximum
=
40.0
,
step
=
0.1
)
sched_eps_s
=
gr
.
Slider
(
value
=
0.001
,
label
=
"Epsilon (VP only)"
,
minimum
=
0.001
,
maximum
=
1.0
,
step
=
0.001
)
return
[
noise_scheduler
,
sched_smin
,
sched_smax
,
sched_rho
,
sched_beta_d
,
sched_beta_min
,
sched_eps_s
]
def
run
(
self
,
p
,
noise_scheduler
,
sched_smin
,
sched_smax
,
sched_rho
,
sched_beta_d
,
sched_beta_min
,
sched_eps_s
):
noise_scheduler_func_name
=
[
'-'
,
'get_sigmas_karras'
,
'get_sigmas_exponential'
,
'get_sigmas_vp'
][
noise_scheduler
]
base_params
=
{
"sigma_min"
:
sched_smin
,
"sigma_max"
:
sched_smax
,
"rho"
:
sched_rho
,
"beta_d"
:
sched_beta_d
,
"beta_min"
:
sched_beta_min
,
"eps_s"
:
sched_eps_s
,
"device"
:
"cuda"
if
torch
.
cuda
.
is_available
()
else
"cpu"
}
if
hasattr
(
k_diffusion
.
sampling
,
noise_scheduler_func_name
):
sigma_func
=
getattr
(
k_diffusion
.
sampling
,
noise_scheduler_func_name
)
sigma_func_kwargs
=
{}
for
k
,
v
in
base_params
.
items
():
if
k
in
inspect
.
signature
(
sigma_func
).
parameters
:
sigma_func_kwargs
[
k
]
=
v
def
substitute_noise_scheduler
(
n
):
return
sigma_func
(
n
,
**
sigma_func_kwargs
)
p
.
sampler_noise_scheduler_override
=
substitute_noise_scheduler
return
process_images
(
p
)
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录