This commit is contained in:
Jack Wooldridge
2023-07-14 15:34:14 -04:00
parent 53dc92d46c
commit 7fdda2c8b3
+2 -2
View File
@@ -558,7 +558,7 @@ class PriorPipeline:
def __call__(self, *args, **kwargs):
unclip_outputs = self.prior(prompt=kwargs.get("prompt"), negative_prompt=kwargs.get("negative_prompt"))
if self.prior.device.type == "cuda" or self.prior.device.type == "xpu":
if self.prior.device.type == "cuda" or self.prior.device.type == "xpu" or self.prior.device.type == "mps":
prior_device = self.prior.device
self.prior.to("cpu")
self.main.to(prior_device)
@@ -566,7 +566,7 @@ class PriorPipeline:
kwargs = {**kwargs, **unclip_outputs}
result = self.main(*args, **kwargs)
if self.main.device.type == "cuda" or self.main.device.type == "xpu":
if self.main.device.type == "cuda" or self.main.device.type == "xpu" or self.prior.device.type == "mps":
main_device = self.main.device
self.main.to("cpu")
self.prior.to(main_device)