Fixed issue with device placement in some scenereos when doing low vram on wan

This commit is contained in:
Jaret Burkett committed 2025-03-13 10:30:27 -06:00
1 parent d507b44a7b
commit 31e057d9a3
1 file changed
+3 -3
+3 -3
View File
@@ -116,9 +116,11 @@ class AggressiveWanUnloadPipeline(WanPipeline):
vae_device = self.vae.device vae_device = self.vae.device
transformer_device = self.transformer.device transformer_device = self.transformer.device
text_encoder_device = self.text_encoder.device text_encoder_device = self.text_encoder.device
device = self.transformer.device
print("Unloading vae") print("Unloading vae")
self.vae.to("cpu") self.vae.to("cpu")
self.text_encoder.to(self._execution_device) self.text_encoder.to(device)
# 1. Check inputs. Raise error if not correct # 1. Check inputs. Raise error if not correct
self.check_inputs( self.check_inputs(
@@ -136,8 +138,6 @@ class AggressiveWanUnloadPipeline(WanPipeline):
self._current_timestep = None self._current_timestep = None
self._interrupt = False self._interrupt = False
device = self._execution_device
# 2. Define call parameters # 2. Define call parameters
if prompt is not None and isinstance(prompt, str): if prompt is not None and isinstance(prompt, str):
batch_size = 1 batch_size = 1