Skip to content

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

@Akash504-ai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions