Spaces:
Runtime error
Runtime error
Update kugelaudio_open/schedule/dpm_solver.py
Browse files
kugelaudio_open/schedule/dpm_solver.py
CHANGED
|
@@ -294,6 +294,9 @@ class DPMSolverMultistepScheduler(SchedulerMixin, ConfigMixin):
|
|
| 294 |
self._begin_index = None
|
| 295 |
if not self.sigmas.is_meta:
|
| 296 |
self.sigmas = self.sigmas.to("cpu") # to avoid too much CPU/GPU communication
|
|
|
|
|
|
|
|
|
|
| 297 |
"""
|
| 298 |
The index counter for current timestep. It will increase 1 after each scheduler step.
|
| 299 |
"""
|
|
@@ -420,6 +423,8 @@ class DPMSolverMultistepScheduler(SchedulerMixin, ConfigMixin):
|
|
| 420 |
self._begin_index = None
|
| 421 |
if not self.sigmas.is_meta:
|
| 422 |
self.sigmas = self.sigmas.to("cpu") # to avoid too much CPU/GPU communication
|
|
|
|
|
|
|
| 423 |
def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor:
|
| 424 |
"""
|
| 425 |
"Dynamic thresholding: At each sampling step we set s to a certain percentile absolute pixel value in xt0 (the
|
|
|
|
| 294 |
self._begin_index = None
|
| 295 |
if not self.sigmas.is_meta:
|
| 296 |
self.sigmas = self.sigmas.to("cpu") # to avoid too much CPU/GPU communication
|
| 297 |
+
|
| 298 |
+
@property
|
| 299 |
+
def step_index(self):
|
| 300 |
"""
|
| 301 |
The index counter for current timestep. It will increase 1 after each scheduler step.
|
| 302 |
"""
|
|
|
|
| 423 |
self._begin_index = None
|
| 424 |
if not self.sigmas.is_meta:
|
| 425 |
self.sigmas = self.sigmas.to("cpu") # to avoid too much CPU/GPU communication
|
| 426 |
+
|
| 427 |
+
# Copied from diffusers.schedulers.scheduling_ddpm.DDPMScheduler._threshold_sample
|
| 428 |
def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor:
|
| 429 |
"""
|
| 430 |
"Dynamic thresholding: At each sampling step we set s to a certain percentile absolute pixel value in xt0 (the
|