Skip to content

Commit

Permalink
Fix the bug of sd3 controlnet training when using gradient checkpoint…
Browse files Browse the repository at this point in the history
…ing. (#9498)

Fix the bug of sd3 controlnet training when using gradient_checkpointing. Refer to issue #9496
  • Loading branch information
pibbo88 authored Sep 23, 2024
1 parent 14f6464 commit 00f5b41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diffusers/models/controlnet_sd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def custom_forward(*inputs):
return custom_forward

ckpt_kwargs: Dict[str, Any] = {"use_reentrant": False} if is_torch_version(">=", "1.11.0") else {}
hidden_states = torch.utils.checkpoint.checkpoint(
encoder_hidden_states, hidden_states = torch.utils.checkpoint.checkpoint(
create_custom_forward(block),
hidden_states,
encoder_hidden_states,
Expand Down

0 comments on commit 00f5b41

Please sign in to comment.