Skip to content

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:

pool table
It will generate an image like this:

Pool table

Pool table

But what happens if instead we indicate the following?

pool :: table

The generated image is very different:

Pool :: table

Pool :: table

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:

pool ::3 table::1

That is, 'pool' has three times the weight of 'table'.

Pool::3 table::1

Pool::3 table::1

Or the other way around:

pool::1 table::3

Pool::1 table::3

Pool::1 table::3

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:

pool::1 table::3 wood::-1

Pool::1 table::3

Pool::1 table::3 wood::-1

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:

cyberpunk style hot dog

cyberpunk style hot dog

cyberpunk style hot dog

Assign weights using :: to achieve this image:

Assign weights

Assign weights

And finally, add a negative token to remove the glasses from our lovely dog!

Use negative weight

Use negative weight

Possible Solution:

Solution

For the first image, we can separate the prompt with weights in the following way:

cyberpunk style :: hot :: dog

For the second image, we can include specific weights and remove the glasses with a negative weight as follows:

cyberpunk style::1 hot::1 dog::1 glasses::-1

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.

support

#PromptingForArtists Support

Resources

References

To cite this content, please use:

@article{promptingforartists,
    author       = {Luis Riancho and Mihail Eric},
    title        = { Prompting for Artists - Weight},
    howpublished = {\url{https://promptingforartists.storia.ai/params/weight}},
    year         = {2023}
}