Skip to content

Commit 59f668c

Browse files
committed
RFInversionFluxPipeline.encode_image, device fix
Use self._execution_device instead of self.device when selecting a device for the input image tensor. This allows for compatibility with enable_model_cpu_offload & enable_sequential_cpu_offload
1 parent f1e0c7c commit 59f668c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/community/pipeline_flux_rf_inversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def encode_image(self, image, dtype=None, height=None, width=None, resize_mode="
419419
)
420420
image = image.to(dtype)
421421

422-
x0 = self.vae.encode(image.to(self.device)).latent_dist.sample()
422+
x0 = self.vae.encode(image.to(self._execution_device)).latent_dist.sample()
423423
x0 = (x0 - self.vae.config.shift_factor) * self.vae.config.scaling_factor
424424
x0 = x0.to(dtype)
425425
return x0, resized

0 commit comments

Comments
 (0)