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
11a2ad51
Commit
11a2ad51
authored
May 19, 2024
by
comfyanonymous
Browse files
Fix controlnet not upcasting on models that have it enabled.
parent
4ae1515f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
comfy/cldm/cldm.py
comfy/cldm/cldm.py
+3
-2
No files found.
comfy/cldm/cldm.py
View file @
11a2ad51
...
...
@@ -52,6 +52,7 @@ class ControlNet(nn.Module):
adm_in_channels
=
None
,
transformer_depth_middle
=
None
,
transformer_depth_output
=
None
,
attn_precision
=
None
,
device
=
None
,
operations
=
comfy
.
ops
.
disable_weight_init
,
**
kwargs
,
...
...
@@ -202,7 +203,7 @@ class ControlNet(nn.Module):
SpatialTransformer
(
ch
,
num_heads
,
dim_head
,
depth
=
num_transformers
,
context_dim
=
context_dim
,
disable_self_attn
=
disabled_sa
,
use_linear
=
use_linear_in_transformer
,
use_checkpoint
=
use_checkpoint
,
dtype
=
self
.
dtype
,
device
=
device
,
operations
=
operations
use_checkpoint
=
use_checkpoint
,
attn_precision
=
attn_precision
,
dtype
=
self
.
dtype
,
device
=
device
,
operations
=
operations
)
)
self
.
input_blocks
.
append
(
TimestepEmbedSequential
(
*
layers
))
...
...
@@ -262,7 +263,7 @@ class ControlNet(nn.Module):
mid_block
+=
[
SpatialTransformer
(
# always uses a self-attn
ch
,
num_heads
,
dim_head
,
depth
=
transformer_depth_middle
,
context_dim
=
context_dim
,
disable_self_attn
=
disable_middle_self_attn
,
use_linear
=
use_linear_in_transformer
,
use_checkpoint
=
use_checkpoint
,
dtype
=
self
.
dtype
,
device
=
device
,
operations
=
operations
use_checkpoint
=
use_checkpoint
,
attn_precision
=
attn_precision
,
dtype
=
self
.
dtype
,
device
=
device
,
operations
=
operations
),
ResBlock
(
ch
,
...
...
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