-
Notifications
You must be signed in to change notification settings - Fork 47
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
Prompt still used with weight 0 (with .and() syntax) #39
Comments
does the same thing happen when you use |
With double quotes I get the "tensor not same size" error that's discussed in the other issue. It wasn't clear to me how to get around that, could you provide a full working code example, including the .and() syntax? |
sure, you need to do
|
Finally got it working, but I have the same issue - with the .and() syntax, weights of 0 don't ignore the corresponding prompt. I'll put the whole program so it's reproducible, see "Comment out this line" (I'm using mps, not sure if cuda/cpu give different results):
Am I right in assuming that giving one prompt with a weight of 1 should give the same results as that one prompt with a weight of 1 + two prompts each with a weight of 0, as in this example? |
that is indeed a reasonable assumption, but it mathematically doesn't work out, for the same reason that if you do run SD with a prompt of try this:
and also this:
i believe these should both give you the same output as
one solution for this is that compel could filter out the the decision i made here is for numerical stability when you're iterating over different weights, rather than for logical consistency at syntax-level. it's a similar kind of question as for how to handle regular upweight ( |
@jonahclarsen i'm going to close this, please re-open if you need |
When passing this as the prompt_embeds param to the StableDiffusionImg2ImgPipeline:
compel("('a man eating an apple', 'sitting on the roof of a car', 'high quality, trending on artstation, 8K UHD').and(1, 0.5, 0)")
gives a different result than
compel("('a man eating an apple', 'sitting on the roof of a car', 'a beautiful sunset').and(1, 0.5, 0)")
even though the third prompt should have a weight of 0 and therefore no effect on the output.
Am I misunderstanding something? Or is this a bug?
The text was updated successfully, but these errors were encountered: