Weight (::)
Overview
Each of the words we include in our prompts has a specific weight for Midjourney. But, what does this mean?
In natural language processing, "tokens" are fundamental units of text that the model processes, ranging from a single letter to an entire word. For instance, in the phrase "Prompting For Artists will help me improve my prompting exponentially," it's broken down into tokens like "Prompting," "For," "Artists," and so on. When we talk about the "weight" of words in a prompt, we refer to the significance each word or token holds in guiding the model's response. Key terms in a prompt can heavily steer the model's output. In essence, tokens help models like Midjourney understand and generate images, and their weight in a prompt can influence the modelโs results.
How is it controlled?
To indicate to Midjourney which tokens have specific weights, we will use ::. And here's where the first important term comes in, multi-prompt.
The best way to see it is through a simple example.
If we pass the following prompt to Midjourney:
It will generate an image like this:But what happens if instead we indicate the following?
The generated image is very different:
What happened? 'pool table' is interpreted by Midjourney as a single token. But by including the :: in between, we indicate to Midjourney to separate them into 2, with the same specific weight for each word.
In short, multi-prompt allows us to split our prompt into 2 (or more) parts to take control over the tokens and their influence on the outcome.
Assigning weights
But it doesn't end here. You can have even more control if you include a number after the ::. For example:
That is, 'pool' has three times the weight of 'table'.
Or the other way around:
Great! But that's not all, as there are a couple of considerations to keep in mind. The first is that the total weight of the tokens must be greater than or equal to 0.
Yes, negative weights can be included. Why? Imagine there's some element that constantly repeats in all your generations and you want to eliminate it. Indicate its weight separately.
For example, if we don't want the tables to be made of wood, we could do the following:
The sum is 3, so we have met the previous premise.
Practice: Assigning weights to complex prompts
We've seen how to assign weights for simple prompts, with a maximum of 3 tokens, but can it be done with more? Yes, as long as the sum of the weights is equal to or greater than zero.
Let's start with the following prompt:
Assign weights using :: to achieve this image:
And finally, add a negative token to remove the glasses from our lovely dog!
Possible Solution:
Solution
For the first image, we can separate the prompt with weights in the following way:
For the second image, we can include specific weights and remove the glasses with a negative weight as follows:
Conclusions
The weight assignment is crucial for gaining greater control over the final outcomes, as we can give more importance to certain elements or even eliminate some with negative weights.
Share Your Results
Join us at X, with the hashtag #PromptingForArtists to share your results, queries, or comments.
Resources
References
To cite this content, please use: