-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix positive / negative prompts #1002
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
Conversation
I tested a few different combinations: - Lists are supplied for both. - Lists + num_images_per_prompt. - Single positive, single negative, num_images_per_prompt > 1 - Same without negative prompts. It works, but it'd be nice to come up with a unit test.
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just posted one question in the comments. Also for tests ,maybe we could test each combination with dummy model
- single prompt
- list of prompts
- single prompt with
num_images_per_prompt
- list of prompts with
num_images_per_prompt
and the same including the negative prompt. This will add a lot of tests but I think it should be fine.
@@ -283,7 +283,7 @@ def __call__( | |||
|
|||
# duplicate unconditional embeddings for each generation per prompt, using mps friendly method | |||
seq_len = uncond_embeddings.shape[1] | |||
uncond_embeddings = uncond_embeddings.repeat(batch_size, num_images_per_prompt, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me, but I'm surprised that this doesn't work, what was the issue with it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have three prompts and three negative prompts, batch_size would be three and we would be creating uncond_embeddings
with shape (9, 77, 768)
in this step. But text_embeddings
is still (3, 77, 768)
, and latents_shape
in line 299 would be wrong.
I think we should merge this soon as more people are finding the problem (it used to be a silent error, but it now fails). See for example #1035. @patrickvonplaten @anton-l can one of you please review on Monday? Meanwhile I'll prepare a couple of tests. |
Superseded by #1035. |
I tested a few different combinations:
It seems to work, but it'd be nice to come up with a unit test somehow. Not easy to do because the code to be tested is inside the pipeline function.
Fixes #779.