Skip to content

Commit c6ec05f

Browse files
author
yiyixuxu
committed
add valueerror for algorithems that does not support denoise_to_zero
1 parent 1b2a428 commit c6ec05f

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/diffusers/schedulers/scheduling_dpmsolver_multistep.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ def __init__(
208208
else:
209209
raise NotImplementedError(f"{solver_type} does is not implemented for {self.__class__}")
210210

211+
if algorithm_type not in ["dpmsolver++", "sde-dpmsolver++"] and final_sigmas_type == "denoise_to_zero":
212+
raise ValueError(
213+
f"`final_sigmas_type` {final_sigmas_type} is not supported for `algorithem_type` {algorithm_type}."
214+
)
215+
211216
# setable values
212217
self.num_inference_steps = None
213218
timesteps = np.linspace(0, num_train_timesteps - 1, num_train_timesteps, dtype=np.float32)[::-1].copy()

src/diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ def __init__(
203203
else:
204204
raise NotImplementedError(f"{solver_type} does is not implemented for {self.__class__}")
205205

206+
if algorithm_type not in ["dpmsolver++", "sde-dpmsolver++"] and final_sigmas_type == "denoise_to_zero":
207+
raise ValueError(
208+
f"`final_sigmas_type` {final_sigmas_type} is not supported for `algorithem_type` {algorithm_type}."
209+
)
210+
206211
# setable values
207212
self.num_inference_steps = None
208213
timesteps = np.linspace(0, num_train_timesteps - 1, num_train_timesteps, dtype=np.float32).copy()

src/diffusers/schedulers/scheduling_dpmsolver_singlestep.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ def __init__(
190190
else:
191191
raise NotImplementedError(f"{solver_type} does is not implemented for {self.__class__}")
192192

193+
if algorithm_type != "dpmsolver++" and final_sigmas_type == "denoise_to_zero":
194+
raise ValueError(
195+
f"`final_sigmas_type` {final_sigmas_type} is not supported for `algorithem_type` {algorithm_type}."
196+
)
197+
193198
# setable values
194199
self.num_inference_steps = None
195200
timesteps = np.linspace(0, num_train_timesteps - 1, num_train_timesteps, dtype=np.float32)[::-1].copy()

0 commit comments

Comments
 (0)