huggingface / huggingface/diffusers

VaeImageProcessorLDM3D ignores constructor configuration arguments

Open Beginner friendly
#14,429 3 comments 0 reactions 0 assignees View on GitHub
bug pipelines
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

## Describe the bug

`VaeImageProcessorLDM3D` documents four constructor options, but any non-default values are silently replaced by `VaeImageProcessor` defaults.

The subclass constructor is decorated with `@register_to_config`, but it calls `super().__init__()` without forwarding its arguments. The decorated parent constructor then registers its own default values on the same config object, overwriting the values already registered by the subclass.

Relevant source: https://github.com/huggingface/diffusers/blob/d6726f38a0c5ca6c06a8f227fb7bade3486ed98d/src/diffusers/image_processor.py#L984-L992

This affects behavior as well as serialization: for example, `do_normalize=False` still normalizes inputs and `do_resize=False` still leaves resizing enabled.

I would like to contribute the focused constructor correction and a regression test once a maintainer confirms the scope, following the repository's AI-assisted contribution policy.

## Reproduction

```python
from diffusers import VaeImageProcessorLDM3D

processor = VaeImageProcessorLDM3D(
do_resize=False,
vae_scale_factor=4,
resample="nearest",
do_normalize=False,
)

print(processor.config.do_resize)
print(processor.config.vae_scale_factor)
print(processor.config.resample)
print(processor.config.do_normalize)
```

Expected:

```text
False
4
nearest
False
```

Actual:

```text
True
8
lanczos
True
```

The same reproduction fails on Diffusers 0.39.0 and current `main` at `d6726f38`.

## System Info

- Diffusers version: 0.39.0; also reproduced on 0.40.0.dev0 at `d6726f38`
- Platform: Windows-10-10.0.26200-SP0
- Python version: 3.10.11
- PyTorch version: 2.13.0+cpu
- GPU used in script: No
- Distributed or parallel setup: No

## Who can help?

@sayakpaul @DN6

AI disclosure: I used Codex to help identify and reproduce the behavior, verify it on the latest release and current main, search existing issues and PRs, and draft this report. I reviewed the reproduction and diagnosis and will personally handle any follow-up.

Contributor guide

Open the contributing guide

Research direction

Start at src/diffusers/image_processor.py around lines 984-992 and run the provided VaeImageProcessorLDM3D reproduction. Add a regression test covering the four non-default constructor options; done means the configuration retains the expected values and the reported normalization and resizing behavior no longer reverts to defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.