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:
defencode_image(
self,
image: PipelineImageInput,
device: Optional[torch.device] =None,
):
device=deviceorself._execution_deviceimage=self.image_processor(images=image, return_tensors="pt").to(device)
image_embeds=self.image_encoder(**image, output_hidden_states=True)
returnimage_embeds.hidden_states[-2]
Reproduction
N/A
Logs
System Info
diffusers==main
Who can help?
@DN6@a-r-r-o-w@hlky
Describe the bug
Currently WAN I2V fails with offloaded model since
image_processorreturns image tensors on cpu whileimage_encodergets 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:Reproduction
N/A
Logs
System Info
diffusers==main
Who can help?
@DN6@a-r-r-o-w@hlky