sample & timestep device

This commit is contained in:
nullquant
2024-05-03 19:00:37 +03:00
parent a6baed2575
commit 30771f2695
2 changed files with 6 additions and 4 deletions
+2
View File
@@ -776,6 +776,8 @@ class BrushNetModel(ModelMixin, ConfigMixin):
# there might be better ways to encapsulate this.
t_emb = t_emb.to(dtype=sample.dtype)
print("BN t_emb.device =",t_emb.device)
emb = self.time_embedding(t_emb, timestep_cond)
aug_emb = None
+4 -4
View File
@@ -420,20 +420,20 @@ def brushnet_inference(x, timesteps, transformer_options):
cond_scale = brushnet_conditioning_scale * brushnet_keep[step]
if x.shape[0] == 2:
return brushnet(x,
return brushnet(x.to(brushnet.device),
encoder_hidden_states=prompt_embeds2,
brushnet_cond=conditioning_latents2,
timestep = timesteps,
timestep = timesteps.to(brushnet.device),
conditioning_scale=cond_scale,
guess_mode=False,
added_cond_kwargs=added_cond_kwargs2,
return_dict=False,
)
else:
return brushnet(x,
return brushnet(x.to(brushnet.device),
encoder_hidden_states=prompt_embeds,
brushnet_cond=conditioning_latents,
timestep = timesteps,
timestep = timesteps.to(brushnet.device),
conditioning_scale=cond_scale,
guess_mode=False,
added_cond_kwargs=added_cond_kwargs,