Using weights to tweak your Midjourney prompts
If you've tried generating images with Midjourney you've already noticed there's an element of surprise to it all. It's hard predicting what output you'll get in return for your prompt and even though it's easy to get beautiful images it can be quite challenging to get them to look the way you want. If you haven't tried Midjourney yet, make sure you start by having a look at my getting started article.
Fortunately there are multiple techniques you can use to tweak your prompts. We've previously covered using adjectives so this time around I want to show you how to use something else: weights.
Separating multiple prompts
Before we can get to weights we need to talk about multi-prompt queries. The Midjourney manual uses the prompt "hot dog" to explain these.
Here's "hot dog":
/imagine hot dog
It's not totally unexpected, but what if we actually wanted an image of a dog that was hot? This is why we introduce the use of the characters "::". Here's a different version.
/imagine hot:: dog
The :: characters tell Midjourney that one prompt ended and another one has begun, thus treating the two words in this prompt separately. We now get images back of dogs that in one way or another Midjourney thinks are "hot". ?? ??
Adding weights to our prompts
Now we have everything we need to start adding weights, because you see every part of our full prompt can have its own weight. We start with a new basic, non-weighted prompt.
/imagine chocolate ice cream
I'm already in the mood for an ice cream and we barely even started yet. Now let's separate this into two prompts.
/imagine chocolate:: ice cream::
领英推荐
Since these are now two prompts you can see how the result is less about chocolate than before, the prompts are separate and equal.
Let's continue to add weights to these two prompts to make them different from each other. We add a weight by adding a number after the :: characters. The default number is 1, and the numbers are normalized which means "hot::2 dog::1" and "hot::10 dog::5" mean the same thing.
/imagine chocolate::3 ice cream::1
/imagine chocolate::1 ice cream::3
Now neither of these are helping my sudden ice cream desire, but they do help me show how weights work so we are making some progress.
Using negative weights to remove details
Weights can also be negative and as such are excellent tools to remove unwanted details and artifacts from an image. The heavy-weighted chocolate image above was nice, but had a lot of mess in it. Let's try to remove that with a negative weight.
/imagine chocolate ice cream::3 messy::-1 melted::-1
The returned image is interesting to say the least. It is indeed much cleaner, but it also has a bunch of nonsense text. While proper text placement is a feature on the Midjourney roadmap, the model currently doesn't understand text, it only places pixels. Fortunately for us we know of a good technique now to remove artifacts, so let's give it another go.
/imagine chocolate ice cream::4 messy::-1 melted::-1 text::-1
At last we have arrived at a decent looking chocolate ice cream without the mess. I know what I'm treating myself to after writing this article. Note that I had to increase the weight from 3 to 4 on the primary prompt. This is because the sum of all weights must be positive, so having three -1 weights means I have to have a weight at least above 3 for the primary prompt.
Also note that weighting is not yet supported in version 5 of Midjourney, since that is still a beta, so for all of this to work you have to make sure that you're using version 4, which also currently is the default version.
Now that you know both how to tweak the importance of your prompts but also have another tool to remove unwanted details and artifacts, I hope you feel empowered to try some more image generation. Let me know how that goes and if you have any feedback for me.
IT Communications Specialist
1 年Not bad, lad.
Creative Director at Landor
1 年Thank you
Multimedia and Digital Imaging Expert. AI Image/Video Specialist.
1 年Thanks for the info!
Digital project manager p? Identitet
1 年Tack f?r bra artikel, John!
Strategy & Innovation Director at NPO
1 年Great explainer John!