Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
435fd211
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
11 个月 前同步成功
通知
1754
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
435fd211
编写于
9月 29, 2022
作者:
D
d8ahazard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes, cleanup.
上级
d7374179
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
17 deletion
+5
-17
modules/ldsr_model_arch.py
modules/ldsr_model_arch.py
+4
-2
modules/modelloader.py
modules/modelloader.py
+0
-14
modules/swinir_model.py
modules/swinir_model.py
+1
-1
未找到文件。
modules/ldsr_model_arch.py
浏览文件 @
435fd211
...
@@ -101,8 +101,10 @@ class LDSR:
...
@@ -101,8 +101,10 @@ class LDSR:
print
(
"Foo"
)
print
(
"Foo"
)
down_sample_rate
=
target_scale
/
4
down_sample_rate
=
target_scale
/
4
print
(
f
"Downsample rate is
{
down_sample_rate
}
"
)
print
(
f
"Downsample rate is
{
down_sample_rate
}
"
)
width_downsampled_pre
=
width_og
*
down_sample_rate
wd
=
width_og
*
down_sample_rate
height_downsampled_pre
=
height_og
*
down_sample_method
hd
=
height_og
*
down_sample_rate
width_downsampled_pre
=
int
(
wd
)
height_downsampled_pre
=
int
(
hd
)
if
down_sample_rate
!=
1
:
if
down_sample_rate
!=
1
:
print
(
print
(
...
...
modules/modelloader.py
浏览文件 @
435fd211
...
@@ -118,11 +118,9 @@ def load_upscalers():
...
@@ -118,11 +118,9 @@ def load_upscalers():
for
cls
in
Upscaler
.
__subclasses__
():
for
cls
in
Upscaler
.
__subclasses__
():
name
=
cls
.
__name__
name
=
cls
.
__name__
module_name
=
cls
.
__module__
module_name
=
cls
.
__module__
print
(
f
"Class:
{
name
}
and
{
module_name
}
"
)
module
=
importlib
.
import_module
(
module_name
)
module
=
importlib
.
import_module
(
module_name
)
class_
=
getattr
(
module
,
name
)
class_
=
getattr
(
module
,
name
)
cmd_name
=
f
"
{
name
.
lower
().
replace
(
'upscaler'
,
''
)
}
-models-path"
cmd_name
=
f
"
{
name
.
lower
().
replace
(
'upscaler'
,
''
)
}
-models-path"
print
(
f
"CMD Name:
{
cmd_name
}
"
)
opt_string
=
None
opt_string
=
None
try
:
try
:
opt_string
=
shared
.
opts
.
__getattr__
(
cmd_name
)
opt_string
=
shared
.
opts
.
__getattr__
(
cmd_name
)
...
@@ -130,18 +128,6 @@ def load_upscalers():
...
@@ -130,18 +128,6 @@ def load_upscalers():
pass
pass
scaler
=
class_
(
opt_string
)
scaler
=
class_
(
opt_string
)
for
child
in
scaler
.
scalers
:
for
child
in
scaler
.
scalers
:
print
(
f
"Appending
{
child
.
name
}
"
)
datas
.
append
(
child
)
datas
.
append
(
child
)
shared
.
sd_upscalers
=
datas
shared
.
sd_upscalers
=
datas
# for scaler in subclasses:
# print(f"Found scaler: {type(scaler).__name__}")
# try:
# scaler = scaler()
# for child in scaler.scalers:
# print(f"Appending {child.name}")
# datas.append[child]
# except:
# pass
# shared.sd_upscalers = datas
modules/swinir_model.py
浏览文件 @
435fd211
...
@@ -52,7 +52,7 @@ class UpscalerSwinIR(Upscaler):
...
@@ -52,7 +52,7 @@ class UpscalerSwinIR(Upscaler):
def
load_model
(
self
,
path
,
scale
=
4
):
def
load_model
(
self
,
path
,
scale
=
4
):
if
"http"
in
path
:
if
"http"
in
path
:
dl_name
=
"%s%s"
%
(
self
.
name
.
replace
(
" "
,
"_"
),
".pth"
)
dl_name
=
"%s%s"
%
(
self
.
model_
name
.
replace
(
" "
,
"_"
),
".pth"
)
filename
=
load_file_from_url
(
url
=
path
,
model_dir
=
self
.
model_path
,
file_name
=
dl_name
,
progress
=
True
)
filename
=
load_file_from_url
(
url
=
path
,
model_dir
=
self
.
model_path
,
file_name
=
dl_name
,
progress
=
True
)
else
:
else
:
filename
=
path
filename
=
path
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录