Skip to content

DDIMPipeline does not validate eta range despite documented constraint [0, 1] #13362

Closed

Description

@Akash504-ai

Describe the bug

In DDIMPipeline, the eta parameter is documented to be within the range [0, 1], but there is currently no validation enforcing this constraint.

From the docstring:

"eta corresponds to η in paper and should be between [0, 1]"

However, users can pass arbitrary values (e.g., negative or >1) without any warning or error, which may lead to undefined or unintended behavior during inference.

This creates a mismatch between:

  • documented API contract
  • actual implementation behavior

I’d be happy to submit a PR to add validation if this is considered appropriate.

Reproduction

from diffusers import DDIMPipeline

pipe = DDIMPipeline.from_pretrained("google/ddpm-cifar10-32")

# Invalid eta values (should ideally raise error or warning)
image = pipe(eta=-1.0)
image = pipe(eta=2.0)

Both calls execute without validation or error.

Logs

Either:

- Raise ValueError if eta is outside [0, 1]
- Or explicitly document that values outside the range are allowed (if intentional)

System Info

  • diffusers: local dev version (from source)
  • Python: 3.13
  • OS: Windows
  • PyTorch: 2.11.0

Who can help?

No response

Activity

  1. Akash504-ai commented on Mar 29, 2026

    @Akash504-ai
    ContributorAuthor

    Hi! Could any maintainer or core contributor confirm whether this behavior is intended? If not, I’d be happy to work on a fix and submit a PR.

  2. added a commit that references this issue on Mar 30, 2026
    1b3a4e7
  3. added a commit that references this issue on Apr 3, 2026
    8070f6e
  4. added a commit that references this issue on Apr 30, 2026
    0ce11ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions