Skip to content

Commit

Permalink
Support diffusers CPU offloading
Browse files Browse the repository at this point in the history
  • Loading branch information
apolinario authored Apr 2, 2024
1 parent e6b1f21 commit 3373895
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pipeline_stable_diffusion_xl_instantid_img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ def _encode_prompt_image_emb(self, prompt_image_emb, device, dtype, do_classifie
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()
Expand Down

0 comments on commit 3373895

Please sign in to comment.