diff --git a/src/refiners/foundationals/latent_diffusion/solvers/ddim.py b/src/refiners/foundationals/latent_diffusion/solvers/ddim.py index 77423de64..5f6c576fc 100644 --- a/src/refiners/foundationals/latent_diffusion/solvers/ddim.py +++ b/src/refiners/foundationals/latent_diffusion/solvers/ddim.py @@ -65,7 +65,7 @@ def __call__(self, x: Tensor, predicted_noise: Tensor, step: int, generator: Gen Returns: 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 = ( self.timesteps[step], diff --git a/src/refiners/foundationals/latent_diffusion/solvers/dpm.py b/src/refiners/foundationals/latent_diffusion/solvers/dpm.py index b2296dc51..01caf3dff 100644 --- a/src/refiners/foundationals/latent_diffusion/solvers/dpm.py +++ b/src/refiners/foundationals/latent_diffusion/solvers/dpm.py @@ -308,7 +308,7 @@ def __call__( Returns: 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] noise_ratio = self.noise_std[step] diff --git a/src/refiners/foundationals/latent_diffusion/solvers/euler.py b/src/refiners/foundationals/latent_diffusion/solvers/euler.py index 1f2aa7cf4..4945a225e 100644 --- a/src/refiners/foundationals/latent_diffusion/solvers/euler.py +++ b/src/refiners/foundationals/latent_diffusion/solvers/euler.py @@ -89,7 +89,7 @@ def __call__(self, x: Tensor, predicted_noise: Tensor, step: int, generator: Gen Returns: 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: x0 = predicted_noise # the model does not actually predict the noise but x0