diffusers
8070f6ec - fix(ddim): validate eta is in [0, 1] in DDIMPipeline (#13367)

Commit
19 days ago
fix(ddim): validate eta is in [0, 1] in DDIMPipeline (#13367) * fix(ddim): validate eta is in [0, 1] in DDIMPipeline.__call__ The DDIM paper defines η (eta) as a value that must lie in [0, 1]: η=0 corresponds to deterministic DDIM, η=1 corresponds to DDPM. The docstring already documented this constraint, but no runtime validation was in place, so users could silently pass out-of-range values (e.g. negative or >1) without any error. Add an explicit ValueError check before the denoising loop so that invalid eta values are caught early with a clear message. Fixes #13362 Signed-off-by: NIK-TIGER-BILL <nik.tiger.bill@github.com> * fix(ddim): downgrade eta out-of-range from error to warning Per maintainer feedback from @yiyixuxu — the documentation is sufficient; a hard ValueError is too strict. Replace with a UserWarning so callers are informed without breaking existing code that passes eta outside [0, 1]. Signed-off-by: NIK-TIGER-BILL <nik.tiger.bill@github.com> * fix(ddim): use logger.warning instead of warnings.warn for eta validation Address review request from @yiyixuxu: switch from warnings.warn() to logger.warning() to be consistent with all other diffusers pipelines. The eta validation check itself (0.0 <= eta <= 1.0) is unchanged. Signed-off-by: NIK-TIGER-BILL <nik.tiger.bill@github.com> --------- Signed-off-by: NIK-TIGER-BILL <nik.tiger.bill@github.com> Co-authored-by: NIK-TIGER-BILL <nik.tiger.bill@github.com> Co-authored-by: YiYi Xu <yixu310@gmail.com>
Parents
Loading