Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
5f60ee24
Commit
5f60ee24
authored
Mar 07, 2024
by
comfyanonymous
Browse files
Support loading the sr cascade controlnet.
parent
03e6e816
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
comfy/controlnet.py
comfy/controlnet.py
+4
-0
comfy/ldm/cascade/controlnet.py
comfy/ldm/cascade/controlnet.py
+1
-1
No files found.
comfy/controlnet.py
View file @
5f60ee24
...
@@ -527,6 +527,10 @@ def load_t2i_adapter(t2i_data):
...
@@ -527,6 +527,10 @@ def load_t2i_adapter(t2i_data):
model_ad
=
comfy
.
ldm
.
cascade
.
controlnet
.
ControlNet
(
c_in
=
t2i_data
[
'backbone.0.0.weight'
].
shape
[
1
],
proj_blocks
=
[
0
,
4
,
8
,
12
,
51
,
55
,
59
,
63
])
model_ad
=
comfy
.
ldm
.
cascade
.
controlnet
.
ControlNet
(
c_in
=
t2i_data
[
'backbone.0.0.weight'
].
shape
[
1
],
proj_blocks
=
[
0
,
4
,
8
,
12
,
51
,
55
,
59
,
63
])
compression_ratio
=
32
compression_ratio
=
32
upscale_algorithm
=
'bilinear'
upscale_algorithm
=
'bilinear'
elif
"backbone.10.blocks.0.weight"
in
keys
:
model_ad
=
comfy
.
ldm
.
cascade
.
controlnet
.
ControlNet
(
c_in
=
t2i_data
[
'backbone.0.weight'
].
shape
[
1
],
bottleneck_mode
=
"large"
,
proj_blocks
=
[
0
,
4
,
8
,
12
,
51
,
55
,
59
,
63
])
compression_ratio
=
1
upscale_algorithm
=
'nearest-exact'
else
:
else
:
return
None
return
None
...
...
comfy/ldm/cascade/controlnet.py
View file @
5f60ee24
...
@@ -67,7 +67,7 @@ class ControlNet(nn.Module):
...
@@ -67,7 +67,7 @@ class ControlNet(nn.Module):
operations
.
Conv2d
(
c_in
,
4096
*
4
,
kernel_size
=
1
,
dtype
=
dtype
,
device
=
device
),
operations
.
Conv2d
(
c_in
,
4096
*
4
,
kernel_size
=
1
,
dtype
=
dtype
,
device
=
device
),
nn
.
LeakyReLU
(
0.2
,
inplace
=
True
),
nn
.
LeakyReLU
(
0.2
,
inplace
=
True
),
operations
.
Conv2d
(
4096
*
4
,
1024
,
kernel_size
=
1
,
dtype
=
dtype
,
device
=
device
),
operations
.
Conv2d
(
4096
*
4
,
1024
,
kernel_size
=
1
,
dtype
=
dtype
,
device
=
device
),
*
[
CNetResBlock
(
1024
)
for
_
in
range
(
8
)],
*
[
CNetResBlock
(
1024
,
dtype
=
dtype
,
device
=
device
,
operations
=
operations
)
for
_
in
range
(
8
)],
operations
.
Conv2d
(
1024
,
1280
,
kernel_size
=
1
,
dtype
=
dtype
,
device
=
device
),
operations
.
Conv2d
(
1024
,
1280
,
kernel_size
=
1
,
dtype
=
dtype
,
device
=
device
),
)
)
embd_channels
=
1280
embd_channels
=
1280
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment