Fix device casting for zimage in some instances
This commit is contained in:
1 parent
c6ecc03ccd
commit
644a6f9246
1 file changed
+2
-1
@@ -300,7 +300,7 @@ class ZImageModel(BaseModel):
|
||||
generator: torch.Generator,
|
||||
extra: dict,
|
||||
):
|
||||
self.model.to(self.device_torch, dtype=self.torch_dtype)
|
||||
if self.model.device == torch.device("cpu"):
|
||||
self.model.to(self.device_torch)
|
||||
|
||||
sc = self.get_bucket_divisibility()
|
||||
@@ -326,6 +326,7 @@ class ZImageModel(BaseModel):
|
||||
text_embeddings: PromptEmbeds,
|
||||
**kwargs,
|
||||
):
|
||||
if self.model.device == torch.device("cpu"):
|
||||
self.model.to(self.device_torch)
|
||||
|
||||
latent_model_input = latent_model_input.unsqueeze(2)
|
||||
|
||||
Reference in new issue
Block a user