Support diffusers CPU offloading

pull/205/head
apolinário 2024-04-02 08:29:05 -05:00 committed by GitHub
parent e6b1f21b6e
commit 337389559c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -534,8 +534,8 @@ class StableDiffusionXLInstantIDImg2ImgPipeline(StableDiffusionXLControlNetImg2I
prompt_image_emb = torch.cat([torch.zeros_like(prompt_image_emb), prompt_image_emb], dim=0)
else:
prompt_image_emb = torch.cat([prompt_image_emb], dim=0)
prompt_image_emb = self.image_proj_model(prompt_image_emb)
image_proj_model_device = self.image_proj_model.to(device)
prompt_image_emb = image_proj_model_device(prompt_image_emb)
return prompt_image_emb
@torch.no_grad()