stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Negation Prompts -- AND NOT operator

Open astrobleem opened this issue 2 years ago • 8 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

as a user when I enter the prompt a guitar AND NOT brown

I still get a brown guitar

if I put brown in the negative prompt, I do not get a brown guitar. the negative prompt is working.

Steps to reproduce the problem

enter the prompt a guitar AND NOT brown

I still get a brown guitar

if I put brown in the negative prompt, I do not get a brown guitar. the negative prompt is working.

What should have happened?

when I put AND NOT it does not work.

Commit where the problem happens

latest

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

No response

Command Line Arguments

No response

Additional information, context and logs

Another user pointing the same issue exists.

https://www.reddit.com/r/StableDiffusion/comments/ye7ajv/comment/itwgtnv/?context=3

astrobleem avatar Oct 26 '22 21:10 astrobleem

I think the NOT operator doesn't exist in this repos. Its function is taken care of by negative prompt as you saw yourself. Am I wrong ?

Ehplodor avatar Oct 26 '22 21:10 Ehplodor

You are correct, the negative prompt does work, however, the expectation would be that AND NOT would also function.

Consider the "read generation parameters from prompt button" parses things from the prompt, but not AND NOTs.

This should function, to be a complete implementation.

astrobleem avatar Oct 26 '22 21:10 astrobleem

The commit adding this: https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/c26732fbee2a57e621ac22bf70decf7496daa4cd

Auto's comment: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/1695

ClashSAN avatar Oct 26 '22 22:10 ClashSAN

I disagree with auto's assertion that it "seems" redundant because we have weights.

Yes, lets use weights instead of natural language, because it... checks notes adds to the complexity?

Leaving it as is causes a crash when DDIM sampler is selected.

astrobleem avatar Oct 26 '22 22:10 astrobleem

If you believe that negative prompts are the solution then convert the AND NOTs in the prompts to negative when you use the "read generation parameters from prompt button" is pressed.

should I open a feature request to get a crash report fixed?

astrobleem avatar Oct 26 '22 22:10 astrobleem

Leaving it as is causes a crash when DDIM sampler is selected.

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/c26732fbee2a57e621ac22bf70decf7496daa4cd In line 115 "composition via AND is not supported for DDIM/PLMS samplers"

negative prompts are the solution then convert the AND NOTs in the prompts to negative

I don't think these are the same. I think the only things from compositional diffusion paper is the AND operator, and weights

a photo of a mountain AND a photo of a tunnel

I believe you can combine multiples:

a photo of a mountain AND a photo of a tunnel AND a photo of a gym

You can also add weights, you might have seen some custom scripts (prompt morph, prompt interpolation) that use this.

a photo of a mountain:0.5 AND a photo of a tunnel:0.7 AND a photo of a gym:0.3

ClashSAN avatar Oct 26 '22 23:10 ClashSAN

image

astrobleem avatar Oct 27 '22 02:10 astrobleem

there is an entire section here (https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/2940) dedicated to composable diffusion, for a bit of context

Ehplodor avatar Oct 27 '22 12:10 Ehplodor