Skip to content

Commit

Permalink
backed out change from PR invoke-ai#44 that was causing ddim sampler …
Browse files Browse the repository at this point in the history
…to fail with the message 'sqrt _vml_cpu not implemented for 'Half'
  • Loading branch information
lstein committed Aug 24, 2022
1 parent 7ecd6fd commit ae7ee93
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ldm/models/diffusion/ddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def __init__(self, model, schedule="linear", **kwargs):
self.schedule = schedule

def register_buffer(self, name, attr):
if type(attr) == torch.Tensor:
if attr.device != torch.device("cuda"):
attr = attr.to(torch.device("cuda"))
setattr(self, name, attr)

def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddim_eta=0., verbose=True):
Expand Down

0 comments on commit ae7ee93

Please sign in to comment.