huggingface / huggingface/diffusers
Standardization of additional token identifiers across pipelines
- Vorherrschende Sprache
- Python
- Sterne
- 34.5k
- Forks
- 7.3k
- Ø Merge
- 3 T. 3 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
`FluxPipeline` has utilities that give us `img_ids` and `txt_ids`:
https://github.com/huggingface/diffusers/blob/ce1063acfa0cbc2168a7e9dddd4282ab8013b810/src/diffusers/pipelines/flux/pipeline_flux.py#L514
https://github.com/huggingface/diffusers/blob/ce1063acfa0cbc2168a7e9dddd4282ab8013b810/src/diffusers/pipelines/flux/pipeline_flux.py#L385
As such these are not created inside the `transformer` class.
Whereas in `HiDream`, we have something different.
`text_ids` are created inside the `transformer` class:
https://github.com/huggingface/diffusers/blob/ce1063acfa0cbc2168a7e9dddd4282ab8013b810/src/diffusers/models/transformers/transformer_hidream_image.py#L796
`img_ids` are overwritten:
https://github.com/huggingface/diffusers/blob/ce1063acfa0cbc2168a7e9dddd4282ab8013b810/src/diffusers/models/transformers/transformer_hidream_image.py#L771C13-L771C20 (probably intentional because it's conditioned)
Then the entire computation
https://github.com/huggingface/diffusers/blob/ce1063acfa0cbc2168a7e9dddd4282ab8013b810/src/diffusers/pipelines/hidream_image/pipeline_hidream_image.py#L726-L744
happens inside the pipeline `__call__()`. Maybe this could take place inside a method similar to the `FluxPipeline`?
In general, these could be standardized a bit.
Cc: @yiyixuxu @a-r-r-o-w
Beitragsleitfaden
Rechercherichtung
Vergleiche die verknüpften Implementierungen in src/diffusers/pipelines/flux/pipeline_flux.py, src/diffusers/models/transformers/transformer_hidream_image.py und src/diffusers/pipelines/hidream_image/pipeline_hidream_image.py. Bestimme zunächst die vorgesehene Zuständigkeit und Struktur von img_ids und text_ids in beiden Pipelines; als abgeschlossen gilt die Aufgabe, wenn der Standardisierungsansatz vereinbart ist und das Verhalten der betroffenen Pipeline konsistent bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, pytorch
- Bereich
- machine-learning
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 32/100