diff --git a/modules/sd_models.py b/modules/sd_models.py index 134a6c5c4..8d9adfca4 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -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)