Skip to content

Commit 03bcf5a

Browse files
Terikslinoytsaban
andauthored
RFInversionFluxPipeline, small fix for enable_model_cpu_offload & enable_sequential_cpu_offload compatibility (#10480)
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 Co-authored-by: Teriks <[email protected]> Co-authored-by: Linoy Tsaban <[email protected]>
1 parent e0b96ba commit 03bcf5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: examples/community/pipeline_flux_rf_inversion.py

+1-1
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)