huggingface / huggingface/diffusers
Standardization of additional token identifiers across pipelines
- Dominant language
- Python
- Stars
- 34.5k
- Forks
- 7.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 91
Description
`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
Contributor guide
Assessment
This issue has not been assessed yet.