Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,8 @@ def prepare_latents(
# if pure noise then scale the initial latents by the Scheduler's init sigma
latents = latents * self.scheduler.init_noise_sigma if is_strength_max else latents
else:
latents = latents.to(device)
latents = latents * self.scheduler.init_noise_sigma
noise = latents.to(device)
latents = noise * self.scheduler.init_noise_sigma
Comment on lines +871 to +872
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First the latents are being assigned as noise and then they're being assigned as latents. I find this exchange somewhat confusing. Could we change that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm ok for me since that's the first time latents is seen


outputs = (latents,)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,8 @@ def prepare_latents(
# if pure noise then scale the initial latents by the Scheduler's init sigma
latents = latents * self.scheduler.init_noise_sigma if is_strength_max else latents
else:
latents = latents.to(device)
latents = latents * self.scheduler.init_noise_sigma
noise = latents.to(device)
latents = noise * self.scheduler.init_noise_sigma

outputs = (latents,)

Expand Down