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
fengzch-das
nunchaku
Commits
2eb3fe1e
Unverified
Commit
2eb3fe1e
authored
May 05, 2025
by
Hyunsung Lee
Committed by
GitHub
May 04, 2025
Browse files
fix: fix stack error to enable Controlnet-Pro-2 working (#349)
parent
57147358
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
nunchaku/caching/utils.py
nunchaku/caching/utils.py
+4
-7
No files found.
nunchaku/caching/utils.py
View file @
2eb3fe1e
...
@@ -396,16 +396,13 @@ class FluxCachedTransformerBlocks(nn.Module):
...
@@ -396,16 +396,13 @@ class FluxCachedTransformerBlocks(nn.Module):
image_rotary_emb
=
image_rotary_emb
.
to
(
self
.
device
)
image_rotary_emb
=
image_rotary_emb
.
to
(
self
.
device
)
if
controlnet_block_samples
is
not
None
:
if
controlnet_block_samples
is
not
None
:
controlnet_block_samples
=
(
controlnet_block_samples
=
(
torch
.
stack
(
controlnet_block_samples
).
to
(
self
.
device
)
if
len
(
controlnet_block_samples
)
>
0
else
None
torch
.
stack
(
controlnet_block_samples
).
to
(
self
.
device
)
if
len
(
controlnet_block_samples
)
>
0
else
None
)
)
if
controlnet_single_block_samples
is
not
None
and
len
(
controlnet_single_block_samples
)
>
0
:
if
controlnet_single_block_samples
:
controlnet_single_block_samples
=
(
controlnet_single_block_samples
=
torch
.
stack
(
controlnet_single_block_samples
).
to
(
self
.
device
)
torch
.
stack
(
controlnet_single_block_samples
).
to
(
self
.
device
)
else
:
if
len
(
controlnet_single_block_samples
)
>
0
controlnet_single_block_samples
=
None
else
None
)
assert
image_rotary_emb
.
ndim
==
6
assert
image_rotary_emb
.
ndim
==
6
assert
image_rotary_emb
.
shape
[
0
]
==
1
assert
image_rotary_emb
.
shape
[
0
]
==
1
...
...
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