mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-23 06:38:45 +00:00
latent_diffusion.solver: fix assert msg
This commit is contained in:
parent
3fdbc1e81a
commit
e148dded6f
|
@ -65,7 +65,7 @@ class DDIM(Solver):
|
||||||
Returns:
|
Returns:
|
||||||
The denoised version of the input data `x`.
|
The denoised version of the input data `x`.
|
||||||
"""
|
"""
|
||||||
assert self.first_inference_step <= step < self.num_inference_steps, "invalid step {step}"
|
assert self.first_inference_step <= step < self.num_inference_steps, f"invalid step {step}"
|
||||||
|
|
||||||
timestep, previous_timestep = (
|
timestep, previous_timestep = (
|
||||||
self.timesteps[step],
|
self.timesteps[step],
|
||||||
|
|
|
@ -308,7 +308,7 @@ class DPMSolver(Solver):
|
||||||
Returns:
|
Returns:
|
||||||
The denoised version of the input data `x`.
|
The denoised version of the input data `x`.
|
||||||
"""
|
"""
|
||||||
assert self.first_inference_step <= step < self.num_inference_steps, "invalid step {step}"
|
assert self.first_inference_step <= step < self.num_inference_steps, f"invalid step {step}"
|
||||||
|
|
||||||
scale_factor = self.cumulative_scale_factors[step]
|
scale_factor = self.cumulative_scale_factors[step]
|
||||||
noise_ratio = self.noise_std[step]
|
noise_ratio = self.noise_std[step]
|
||||||
|
|
|
@ -89,7 +89,7 @@ class Euler(Solver):
|
||||||
Returns:
|
Returns:
|
||||||
The denoised version of the input data `x`.
|
The denoised version of the input data `x`.
|
||||||
"""
|
"""
|
||||||
assert self.first_inference_step <= step < self.num_inference_steps, "invalid step {step}"
|
assert self.first_inference_step <= step < self.num_inference_steps, f"invalid step {step}"
|
||||||
|
|
||||||
if self.params.model_prediction_type == ModelPredictionType.SAMPLE:
|
if self.params.model_prediction_type == ModelPredictionType.SAMPLE:
|
||||||
x0 = predicted_noise # the model does not actually predict the noise but x0
|
x0 = predicted_noise # the model does not actually predict the noise but x0
|
||||||
|
|
Loading…
Reference in a new issue