"tests/vscode:/vscode.git/clone" did not exist on "c394d7d13ebd01f9e1eac2a1c18a79e8867b2a2d"
Unverified Commit 0a0ebc7c authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

[LCM] Better error message (#5788)

parent 81df9c85
...@@ -378,6 +378,12 @@ class LCMScheduler(SchedulerMixin, ConfigMixin): ...@@ -378,6 +378,12 @@ class LCMScheduler(SchedulerMixin, ConfigMixin):
# LCM Training Steps Schedule # LCM Training Steps Schedule
lcm_origin_timesteps = np.asarray(list(range(1, int(original_steps * strength) + 1))) * c - 1 lcm_origin_timesteps = np.asarray(list(range(1, int(original_steps * strength) + 1))) * c - 1
skipping_step = len(lcm_origin_timesteps) // num_inference_steps skipping_step = len(lcm_origin_timesteps) // num_inference_steps
if skipping_step < 1:
raise ValueError(
f"The combination of `original_steps x strength`: {original_steps} x {strength} is smaller than `num_inference_steps`: {num_inference_steps}. Make sure to either reduce `num_inference_steps` to a value smaller than {int(original_steps * strength)} or increase `strength` to a value higher than {float(num_inference_steps / original_steps)}."
)
# LCM Inference Steps Schedule # LCM Inference Steps Schedule
timesteps = lcm_origin_timesteps[::-skipping_step][:num_inference_steps] timesteps = lcm_origin_timesteps[::-skipping_step][:num_inference_steps]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment