Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PixArtAlphaPipeline does not handle negative_prompt list correctly #7759

Open
Trojaner opened this issue Apr 24, 2024 · 5 comments
Open

PixArtAlphaPipeline does not handle negative_prompt list correctly #7759

Trojaner opened this issue Apr 24, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Trojaner
Copy link

Trojaner commented Apr 24, 2024

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:

negative_prompt (`str` or `List[str]`, *optional*):

However the function type hints restrict it to a str instead:

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:

uncond_tokens = [negative_prompt] * batch_size

Reproduction

Call Pixart-Sigma with negative_prompt as list instead of a single string.

Logs

(sorry for images)

image
image

System Info

Windows 11
PyTorch 2.2.2 with CUDA support
Diffusers 0.28.0.dev0 @ 7404f1e

Who can help?

@DN6 @sayakpaul @lawrence-cj

@Trojaner Trojaner added the bug Something isn't working label Apr 24, 2024
@Trojaner Trojaner changed the title PixartAlphaPipeline does not handle negative_prompt list correctly PixArtAlphaPipeline does not handle negative_prompt list correctly Apr 24, 2024
@sayakpaul
Copy link
Member

Feel free to drop a PR to fix it :)

@Trojaner
Copy link
Author

Trojaner commented Apr 24, 2024

Feel free to drop a PR to fix it :)

No.

What's the point of bug reports if we must fix it ourselves?
Then just remove the option to report bugs and only accept PRs at this point.

I already contributed here by pinpointing the issue to the point where fixing it is trivial.

@sayakpaul
Copy link
Member

I already contributed here by pinpointing the issue to the point where fixing it is trivial.

That is exactly why I asked you to submit a PR. Since you already have a thorough understanding of what's going on and know how to fix the issue. That way, your contributions stay within the repository, and that is very much appreciated.

If you don't prefer that, sure, I am just happy to open a PR on behalf of yourself. What is your commit email id so that I can add your as a co-author of the commit?

@Trojaner
Copy link
Author

That is exactly why I asked you to submit a PR.

Sadly your initial post is very open to misunderstandings. If you had included more explanation on why you want me to do it, it would have shown me that it wasn't a toxic comment. I will submit a PR in the next days.

@sayakpaul
Copy link
Member

Sorry for not being clear. Appreciate your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants