mirror of
https://github.com/Stability-AI/stablediffusion.git
synced 2024-12-22 23:55:00 +00:00
Separate mps and other processes
This commit is contained in:
parent
19697bbf07
commit
a101942e8a
1 changed files with 4 additions and 1 deletions
|
@ -18,7 +18,10 @@ class DDIMSampler(object):
|
|||
def register_buffer(self, name, attr):
|
||||
if type(attr) == torch.Tensor:
|
||||
if attr.device != self.device:
|
||||
attr = attr.to(self.device, torch.float32)
|
||||
if str(self.device) == 'mps':
|
||||
attr = attr.to(self.device, torch.float32)
|
||||
else:
|
||||
attr = attr.to(self.device)
|
||||
setattr(self, name, attr)
|
||||
|
||||
def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddim_eta=0., verbose=True):
|
||||
|
|
Loading…
Reference in a new issue