Skip to content

Commit

Permalink
fix device
Browse files Browse the repository at this point in the history
  • Loading branch information
continue-revolution committed Mar 4, 2024
1 parent 72139b0 commit d72347e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ldm_patched/modules/model_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def sigma_max(self):
return self.sigmas[-1]

def timestep(self, sigma):
log_sigma = sigma.log()
dists = log_sigma.to(self.log_sigmas.device) - self.log_sigmas[:, None]
log_sigma = sigma.log().to(self.log_sigmas.device)
dists = log_sigma - self.log_sigmas[:, None]
low_idx = dists.ge(0).cumsum(dim=0).argmax(dim=0).clamp(max=self.log_sigmas.shape[0] - 2)
high_idx = low_idx + 1
low, high = self.log_sigmas[low_idx], self.log_sigmas[high_idx]
Expand Down

0 comments on commit d72347e

Please sign in to comment.