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
48b2dc3c
Commit
48b2dc3c
authored
Apr 19, 2025
by
Hyunsung Lee
Committed by
muyangli
Apr 20, 2025
Browse files
Merge pull request #85 from mit-han-lab/ita9naiwa/controlnet-fix
parent
16979769
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
nunchaku/models/transformers/transformer_flux.py
nunchaku/models/transformers/transformer_flux.py
+10
-9
No files found.
nunchaku/models/transformers/transformer_flux.py
View file @
48b2dc3c
...
@@ -82,15 +82,16 @@ class NunchakuFluxTransformerBlocks(nn.Module):
...
@@ -82,15 +82,16 @@ class NunchakuFluxTransformerBlocks(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
=
(
if
len
(
controlnet_block_samples
)
>
0
:
torch
.
stack
(
controlnet_block_samples
).
to
(
self
.
device
)
if
len
(
controlnet_block_samples
)
>
0
else
None
controlnet_block_samples
=
torch
.
stack
(
controlnet_block_samples
).
to
(
self
.
device
)
)
else
:
if
controlnet_single_block_samples
is
not
None
and
len
(
controlnet_single_block_samples
)
>
0
:
controlnet_block_samples
=
None
controlnet_single_block_samples
=
(
torch
.
stack
(
controlnet_single_block_samples
).
to
(
self
.
device
)
if
controlnet_single_block_samples
is
not
None
:
if
len
(
controlnet_single_block_samples
)
>
0
if
len
(
controlnet_single_block_samples
)
>
0
:
else
None
controlnet_single_block_samples
=
torch
.
stack
(
controlnet_single_block_samples
).
to
(
self
.
device
)
)
else
:
controlnet_single_block_samples
=
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