Fixed an issue where Flux.2 model VAE can be left offloaded to CPU when encoding control images while caching latents

This commit is contained in:
Jaret Burkett
2026-03-29 09:49:10 -06:00
parent 6a1fc54779
commit affa411edc

View File

@@ -391,6 +391,8 @@ class Flux2Model(BaseModel):
control_img = control_img * 2 - 1
controls.append(control_img)
if self.vae.device == torch.device("cpu"):
self.vae.to(self.device_torch)
img_cond_seq_item, img_cond_seq_ids_item = encode_image_refs(
self.vae, controls, limit_pixels=control_image_max_res
)