mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
MPS fix
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user