Move transformer back to device on aggresive wan 2.2 pipeline after generation.
This commit is contained in:
@@ -257,6 +257,14 @@ class Wan22Pipeline(WanPipeline):
|
|||||||
# Offload all models
|
# Offload all models
|
||||||
self.maybe_free_model_hooks()
|
self.maybe_free_model_hooks()
|
||||||
|
|
||||||
|
# move transformer back to device
|
||||||
|
if self._aggressive_offload:
|
||||||
|
print("Moving transformer back to device")
|
||||||
|
self.transformer.to(self._execution_device)
|
||||||
|
if self.transformer_2 is not None:
|
||||||
|
self.transformer_2.to(self._execution_device)
|
||||||
|
flush()
|
||||||
|
|
||||||
if not return_dict:
|
if not return_dict:
|
||||||
return (video,)
|
return (video,)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user