Improve clarity of comments regarded when 'noise' and 'latents' are expected to be set.

This commit is contained in:
Ryan Dick
2024-06-13 10:19:43 -04:00
committed by Kent Keirsey
parent 1e41949a02
commit 60ac937698
2 changed files with 13 additions and 2 deletions

View File

@ -298,8 +298,7 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline):
batch_size = latents.shape[0]
batched_t = init_timestep.expand(batch_size)
# NOTE(ryand): noise will be None if we are running the SDXL refiner. I can't think of any other reason that
# we'd want noise to be None, but I didn't write this logic, so there might be a reason I haven't thought of.
# noise can be None if the latents have already been noised (e.g. when running the SDXL refiner).
if noise is not None:
# latents = noise * self.scheduler.init_noise_sigma # it's like in t2l according to diffusers
latents = self.scheduler.add_noise(latents, noise, batched_t)