-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Currently WAN I2V fails with offloaded model since image_processor
returns image tensors on cpu while image_encoder
gets moved to gpu by accelerate hook according to execution_device.
This simple patch fixes it by setting device explicitly
in pipelines/wan/pipeline_wan_i2v.py
:
def encode_image(
self,
image: PipelineImageInput,
device: Optional[torch.device] = None,
):
device = device or self._execution_device
image = self.image_processor(images=image, return_tensors="pt").to(device)
image_embeds = self.image_encoder(**image, output_hidden_states=True)
return image_embeds.hidden_states[-2]
Reproduction
N/A
Logs
System Info
diffusers==main
Who can help?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working