File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
diffsynth_engine/pipelines Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ def enable_cpu_offload(self, offload_mode: str):
258258 valid_offload_mode = ("cpu_offload" , "sequential_cpu_offload" )
259259 if offload_mode not in valid_offload_mode :
260260 raise ValueError (f"offload_mode must be one of { valid_offload_mode } , but got { offload_mode } " )
261- if self .device == "cpu" :
261+ if self .device == "cpu" or self . device == "mps" :
262262 logger .warning ("must set an non cpu device for pipeline before calling enable_cpu_offload" )
263263 return
264264 if offload_mode == "cpu_offload" :
@@ -274,6 +274,9 @@ def enable_model_cpu_offload(self):
274274 self .offload_mode = "cpu_offload"
275275
276276 def enable_sequential_cpu_offload (self ):
277+ if self .device == "cpu" or self .device == "mps" :
278+ logger .warning ("must set an non cpu device for pipeline before calling enable_sequential_cpu_offload" )
279+ return
277280 for model_name in self .model_names :
278281 model = getattr (self , model_name )
279282 if model is not None :
You can’t perform that action at this time.
0 commit comments