Skip to content

Fix multi-prompt inference - #7208

Closed
nikitabalabin wants to merge 0 commit into
huggingface:mainfrom
nikitabalabin:main
Closed

Fix multi-prompt inference#7208
nikitabalabin wants to merge 0 commit into
huggingface:mainfrom
nikitabalabin:main

Conversation

@nikitabalabin

@nikitabalabinnikitabalabin commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

Fix generation of multiple images with multiple prompts, e.g len(prompts)>1, num_images_per_prompt>1

What does this PR do?

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@sayakpaul

Copy link
Copy Markdown
Member

Can you show an example of where the current code (without the changes in this PR) fails?

@nikitabalabin

Copy link
Copy Markdown
ContributorAuthor
from diffusers import PixArtAlphaPipeline, Transformer2DModel
import torch
pipe = PixArtAlphaPipeline.from_pretrained("PixArt-alpha/PixArt-XL-2-1024-MS", torch_dtype=torch.float16).to('cuda')
prompts = ["a man", "cat riding a bike in the forest, watercolor style"] images = pipe(prompt=prompts, num_images_per_prompt=2).images

images[1] and images[2] will be generated with wrong prompt_attention_mask.

@sayakpaul

Copy link
Copy Markdown
Member

Thanks! Could we add a fast test for this as well?

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions

Copy link
Copy Markdown
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actionsgithub-actionsBot added the stale Issues that haven't received updates label Apr 3, 2024
@yiyixuxu

Copy link
Copy Markdown
Collaborator

hi @nikitabalabin
thanks for the PR! let us know if you're still interested in finishing it:)

@yiyixuxu

Copy link
Copy Markdown
Collaborator

can we run make style too?

@github-actionsgithub-actionsBot removed the stale Issues that haven't received updates label Dec 3, 2024
@hlkyhlky closed this Dec 3, 2024
@sayakpaul

Copy link
Copy Markdown
Member

@hlky was the close expected?

@hlky

hlky commented Dec 3, 2024

Copy link
Copy Markdown
Contributor

Rebase to fix conflict went wrong 😅

@hlkyhlky mentioned this pull request Dec 3, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@nikitabalabin@sayakpaul@HuggingFaceDocBuilderDev@yiyixuxu@hlky