huggingface / huggingface/diffusers
VaeImageProcessorLDM3D ignores constructor configuration arguments
- Vorherrschende Sprache
- Python
- Sterne
- 34.5k
- Forks
- 7.3k
- Ø Merge
- 3 T. 3 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
## 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.
Beitragsleitfaden
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- machine-learning
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 74/100