huggingface / huggingface/diffusers

VaeImageProcessorLDM3D ignores constructor configuration arguments

Aperta Adatta ai principianti
#14,429 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug pipelines
Lingua principale
Python
Stelle
34.5k
Fork
7.3k
Merge medio
3g 3h
PR unite (30g)
91

Descrizione

## 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
machine-learning
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
74/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.