huggingface / huggingface/diffusers
PixArtAlphaPipeline does not handle negative_prompt list correctly
- 主要言語
- Python
- スター
- 34.5k
- フォーク
- 7.3k
- 平均マージ
- 3日 3時間
- マージ済み PR(30日)
- 91
説明
### Describe the bug
Passing negative_prompt as list to PixArtAlphaPipeline will eventually cause a "list object has no attribute lower" error.
The encode_prompt function documentation shows that it can be a list as well:
https://github.com/huggingface/diffusers/blob/7404f1e9dcdac286caf6ca3cfa43b294f61583bf/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py#L308
However the function type hints restrict it to a str instead:
https://github.com/huggingface/diffusers/blob/7404f1e9dcdac286caf6ca3cfa43b294f61583bf/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py#L291
These restrictions are completely arbitrary, since
a) prompt is correctly handled for the same case,
b) negative_prompt is only used in one place and there it just gets converted to a list anyway:
https://github.com/huggingface/diffusers/blob/7404f1e9dcdac286caf6ca3cfa43b294f61583bf/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py#L392
### Reproduction
Call Pixart-Sigma with negative_prompt as list instead of a single string.
### Logs
(sorry for images)


### System Info
Windows 11
PyTorch 2.2.2 with CUDA support
Diffusers 0.28.0.dev0 @ https://github.com/huggingface/diffusers/commit/7404f1e9dcdac286caf6ca3cfa43b294f61583bf
### Who can help?
@DN6 @sayakpaul @lawrence-cj
コントリビューションガイド
調査の方向性
src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py の、392 行目付近にある encode_prompt と negative_prompt の処理から始めます。negative_prompt をリストとして PixArt-Sigma を再現し、その後、pipeline が報告された下側のエラーなしにリストを受け入れ、prompt と一貫して処理することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python, pytorch
- 領域
- machine-learning
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 52/100