Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
S
Stable Diffusion Webui
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
Show more breadcrumbs
Hunter0726
Stable Diffusion Webui
提交
7c13ffdb
未验证
提交
7c13ffdb
编辑于
1年前
作者:
AUTOMATIC1111
提交者:
GitHub
1年前
浏览文件
操作
下载
差异文件
Merge pull request #14472 from akx/drop-move-code
Remove `cleanup_models` code
上级
a86f4411
5fbb13e0
No related branches found
No related tags found
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
modules/initialize.py
+0
-3
0 个添加, 3 个删除
modules/initialize.py
modules/modelloader.py
+0
-50
0 个添加, 50 个删除
modules/modelloader.py
有
0 个添加
和
53 个删除
modules/initialize.py
+
0
−
3
浏览文件 @
7c13ffdb
...
...
@@ -54,9 +54,6 @@ def initialize():
initialize_util
.
configure_sigint_handler
()
initialize_util
.
configure_opts_onchange
()
from
modules
import
modelloader
modelloader
.
cleanup_models
()
from
modules
import
sd_models
sd_models
.
setup_model
()
startup_timer
.
record
(
"
setup SD model
"
)
...
...
This diff is collapsed.
点击以展开。
modules/modelloader.py
+
0
−
50
浏览文件 @
7c13ffdb
...
...
@@ -2,7 +2,6 @@ from __future__ import annotations
import
logging
import
os
import
shutil
import
importlib
from
urllib.parse
import
urlparse
...
...
@@ -10,7 +9,6 @@ import torch
from
modules
import
shared
from
modules.upscaler
import
Upscaler
,
UpscalerLanczos
,
UpscalerNearest
,
UpscalerNone
from
modules.paths
import
script_path
,
models_path
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -96,54 +94,6 @@ def friendly_name(file: str):
return
model_name
def
cleanup_models
():
# This code could probably be more efficient if we used a tuple list or something to store the src/destinations
# and then enumerate that, but this works for now. In the future, it'd be nice to just have every "model" scaler
# somehow auto-register and just do these things...
root_path
=
script_path
src_path
=
models_path
dest_path
=
os
.
path
.
join
(
models_path
,
"
Stable-diffusion
"
)
move_files
(
src_path
,
dest_path
,
"
.ckpt
"
)
move_files
(
src_path
,
dest_path
,
"
.safetensors
"
)
src_path
=
os
.
path
.
join
(
root_path
,
"
ESRGAN
"
)
dest_path
=
os
.
path
.
join
(
models_path
,
"
ESRGAN
"
)
move_files
(
src_path
,
dest_path
)
src_path
=
os
.
path
.
join
(
models_path
,
"
BSRGAN
"
)
dest_path
=
os
.
path
.
join
(
models_path
,
"
ESRGAN
"
)
move_files
(
src_path
,
dest_path
,
"
.pth
"
)
src_path
=
os
.
path
.
join
(
root_path
,
"
gfpgan
"
)
dest_path
=
os
.
path
.
join
(
models_path
,
"
GFPGAN
"
)
move_files
(
src_path
,
dest_path
)
src_path
=
os
.
path
.
join
(
root_path
,
"
SwinIR
"
)
dest_path
=
os
.
path
.
join
(
models_path
,
"
SwinIR
"
)
move_files
(
src_path
,
dest_path
)
src_path
=
os
.
path
.
join
(
root_path
,
"
repositories/latent-diffusion/experiments/pretrained_models/
"
)
dest_path
=
os
.
path
.
join
(
models_path
,
"
LDSR
"
)
move_files
(
src_path
,
dest_path
)
def
move_files
(
src_path
:
str
,
dest_path
:
str
,
ext_filter
:
str
=
None
):
try
:
os
.
makedirs
(
dest_path
,
exist_ok
=
True
)
if
os
.
path
.
exists
(
src_path
):
for
file
in
os
.
listdir
(
src_path
):
fullpath
=
os
.
path
.
join
(
src_path
,
file
)
if
os
.
path
.
isfile
(
fullpath
):
if
ext_filter
is
not
None
:
if
ext_filter
not
in
file
:
continue
print
(
f
"
Moving
{
file
}
from
{
src_path
}
to
{
dest_path
}
.
"
)
try
:
shutil
.
move
(
fullpath
,
dest_path
)
except
Exception
:
pass
if
len
(
os
.
listdir
(
src_path
))
==
0
:
print
(
f
"
Removing empty folder:
{
src_path
}
"
)
shutil
.
rmtree
(
src_path
,
True
)
except
Exception
:
pass
def
load_upscalers
():
# We can only do this 'magic' method to dynamically load upscalers if they are referenced,
# so we'll try to import any _model.py files before looking in __subclasses__
...
...
This diff is collapsed.
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录