r/StableDiffusionInfo • u/PM_ME_UR_TWINTAILS • Apr 17 '23
Question Exmaples for AND, BREAK, NOT syntax in automatic1111?
I've seen a lot of prompts using BREAK and I would like to know what it does specifically with examples, the same goes for AND and NOT although i don't see many people using those. Also if there are any other special keywords that I don't know about. Can anyone point me to a tutorial or give me some examples of how these would be used and what they would do?
31
Upvotes
1
u/ecker00 Apr 17 '23
Never heard of these, found any documentation on it?
3
u/flasticpeet Jun 19 '23 edited Jun 20 '23
I know this is kind of old, but since no one actually answered the question, I thought I would give my take.
In the past there was actually a 75 token limit on prompts and it would just not process anything after 75 tokens. At some point they expanded this by separating longer prompts into 75 token chunks. So now when your prompt goes over 75 tokens it will start a new chunk, process each chunk separately, then add all the chunks together.
BREAK serves as a way you can tell it to manually break the prompt so you can control how your prompt gets processed.
For instance, your prompt goes over 75 tokens, at which point it would automatically break it at the 75th token and start a new chunk, but perhaps it's in the middle of a string of tokens that you want processed together, so you would use BREAK to manually break the prompt where you want it.
Fun Fact: Midjourney works similarly, and you can do the same by using ":: " to define BREAKS/chunks.
2
u/Gekijou1 Sep 09 '23
I actually came across a video that explained and displayed how the BREAK command actually works. It is meant to contain and maintain certain ideas together. Not the best way to phrase it but I'll give you an example below. It really is meant for stuff like preventing color bleeding into other objects that you didn't want to have that specific color. Let's say you want a woman with red hair, a blue dress, and green eyes. You might typically write it like this: "A red haired woman with a Blue dress, and green eyes, looking at the camera".
You'll notice that a lot of the times when you generate that prompt one of the three colors will blend into other objects in the scene. She might end up with parts of her dress colored red, or her eyes be blue, or if there's a wall behind her maybe the wall is green. To prevent that from happening you used to break command like this: "A red-haired woman BREAK with a Blue dress BREAK and green eyes BREAK, looking at the camera"
Give it a try and see for yourselves! I'm on my phone right now so I can't link to the video right this minute, but I'll come back in a couple of minutes to post it by editing my comment.
EDIT: here's the video. https://youtu.be/z-AoELaJfn0?si=roUpfQBvf6EjbSaD
1
u/Hungwy-Kitten Nov 14 '24
Are these keywords just limited to Automatic1111? When I tried using the huggingface model and passed the prompts with the BREAK keyword, it doesn't seem to do anything.
1
u/vsemecky Apr 18 '23
I use BREAK normally, but only for clear formatting. I never thought it would affect the result ;-)
0
u/[deleted] Jul 07 '23
[deleted] — view deleted comment
0
u/[deleted] Apr 17 '23
[deleted] — view deleted comment