Skip to content

Commit 95e8504

Browse files
1
1 parent 5d2e994 commit 95e8504

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/cogview4-control/train_control_cogview4.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from diffusers.optimization import get_scheduler
4242
from diffusers.training_utils import (
4343
compute_density_for_timestep_sampling,
44+
compute_loss_weighting_for_sd3,
4445
free_memory,
4546
)
4647
from diffusers.utils import check_min_version, is_wandb_available, load_image, make_image_grid
@@ -1096,7 +1097,7 @@ def load_model_hook(models, input_dir):
10961097

10971098
# these weighting schemes use a uniform timestep sampling
10981099
# and instead post-weight the loss
1099-
weighting = (sigmas**-2.0).float()
1100+
weighting = compute_loss_weighting_for_sd3(weighting_scheme=args.weighting_scheme, sigmas=sigmas)
11001101
# flow-matching loss
11011102
target = noise - pixel_latents
11021103

0 commit comments

Comments
 (0)