Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
e309583f
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
大约 1 年 前同步成功
通知
1785
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e309583f
编写于
9月 30, 2023
作者:
A
AUTOMATIC1111
提交者:
GitHub
9月 30, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13276 from woweenie/patch-1
patch DDPM.register_betas so that users can put given_betas in model yaml
上级
7ce1f3a1
d9d94141
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
1 deletion
+14
-1
modules/sd_models.py
modules/sd_models.py
+14
-1
未找到文件。
modules/sd_models.py
浏览文件 @
e309583f
...
...
@@ -7,7 +7,7 @@ import threading
import
torch
import
re
import
safetensors.torch
from
omegaconf
import
OmegaConf
from
omegaconf
import
OmegaConf
,
ListConfig
from
os
import
mkdir
from
urllib
import
request
import
ldm.modules.midas
as
midas
...
...
@@ -17,6 +17,7 @@ from ldm.util import instantiate_from_config
from
modules
import
paths
,
shared
,
modelloader
,
devices
,
script_callbacks
,
sd_vae
,
sd_disable_initialization
,
errors
,
hashes
,
sd_models_config
,
sd_unet
,
sd_models_xl
,
cache
,
extra_networks
,
processing
,
lowvram
,
sd_hijack
from
modules.timer
import
Timer
import
tomesd
import
numpy
as
np
model_dir
=
"Stable-diffusion"
model_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
paths
.
models_path
,
model_dir
))
...
...
@@ -132,6 +133,7 @@ def setup_model():
os
.
makedirs
(
model_path
,
exist_ok
=
True
)
enable_midas_autodownload
()
patch_given_betas
()
def
checkpoint_tiles
(
use_short
=
False
):
...
...
@@ -455,6 +457,17 @@ def enable_midas_autodownload():
midas
.
api
.
load_model
=
load_model_wrapper
def
patch_given_betas
():
original_register_schedule
=
ldm
.
models
.
diffusion
.
ddpm
.
DDPM
.
register_schedule
def
patched_register_schedule
(
*
args
,
**
kwargs
):
if
args
[
1
]
is
not
None
and
isinstance
(
args
[
1
],
ListConfig
):
modified_args
=
list
(
args
)
# Convert args tuple to a list
modified_args
[
1
]
=
np
.
array
(
args
[
1
])
# Modify the desired element
args
=
tuple
(
modified_args
)
# Convert the list back to a tuple
original_register_schedule
(
*
args
,
**
kwargs
)
ldm
.
models
.
diffusion
.
ddpm
.
DDPM
.
register_schedule
=
patched_register_schedule
def
repair_config
(
sd_config
):
if
not
hasattr
(
sd_config
.
model
.
params
,
"use_ema"
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录