mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-02-20 04:13:57 +00:00
Move transformer back to device on aggresive wan 2.2 pipeline after generation.
This commit is contained in:
@@ -256,6 +256,14 @@ class Wan22Pipeline(WanPipeline):
|
||||
|
||||
# Offload all models
|
||||
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:
|
||||
return (video,)
|
||||
|
||||
Reference in New Issue
Block a user