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
renzhc
diffusers_dcu
Commits
6398fbc3
Unverified
Commit
6398fbc3
authored
Jul 15, 2025
by
Hengyue-Bi
Committed by
GitHub
Jul 14, 2025
Browse files
Fix: Align VAE processing in ControlNet SD3 training with inference (#11909)
Fix: Apply vae_shift_factor in ControlNet SD3 training
parent
3c8b67b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/controlnet/train_controlnet_sd3.py
examples/controlnet/train_controlnet_sd3.py
+1
-1
No files found.
examples/controlnet/train_controlnet_sd3.py
View file @
6398fbc3
...
@@ -1330,7 +1330,7 @@ def main(args):
...
@@ -1330,7 +1330,7 @@ def main(args):
# controlnet(s) inference
# controlnet(s) inference
controlnet_image
=
batch
[
"conditioning_pixel_values"
].
to
(
dtype
=
weight_dtype
)
controlnet_image
=
batch
[
"conditioning_pixel_values"
].
to
(
dtype
=
weight_dtype
)
controlnet_image
=
vae
.
encode
(
controlnet_image
).
latent_dist
.
sample
()
controlnet_image
=
vae
.
encode
(
controlnet_image
).
latent_dist
.
sample
()
controlnet_image
=
controlnet_image
*
vae
.
config
.
scaling_factor
controlnet_image
=
(
controlnet_image
-
vae
.
config
.
shift_factor
)
*
vae
.
config
.
scaling_factor
control_block_res_samples
=
controlnet
(
control_block_res_samples
=
controlnet
(
hidden_states
=
noisy_model_input
,
hidden_states
=
noisy_model_input
,
...
...
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