/ Posts / Mastering AI Image Generation: How to Craft Prompts for Neural Networks

Mastering AI Image Generation: How to Craft Prompts for Neural Networks

Arina

0
0

If you have already used neural networks, you know how difficult it is to get the right result. To achieve your goal, you should write the right prompt. The general principles are the same in any neural network. Let's learn how to correctly compose a prompt for generating AI images.

Creating a Simple Prompt

Learning how to write prompts is easy. A few words are enough to generate an image. You will be able to get a high-quality result with the minimum effort. But if you enter a few words without clarification, the neural network will complete the missing details by itself. Therefore, if you know exactly what result you want to get, you should compose the simplest possible query for the neural network and clarify it.

Object

The object is the basis of any query for a neural network. The object will be in the center of the whole image. It's logical that you should think about it first.

Neural networks are trained on a huge database of images from the Internet. So, they will easily produce a result for this prompt. But if you enter only one object in the command, the results will be monotonous. Therefore, for example, you can try to combine two objects.

To have several objects in the image, you need to specify the number. Instead of "cats in a cafe" write "three cats in a cafe". If you do not specify a value, the neural network will display a random number of cats.

The more specific objects there are in the image, the more complex the neural network becomes. In such cases, it's better to ask it to generate a "crowd of mages". But remember: the more objects, especially animals or people, there are, the higher the probability of error and the worse the detail.

Abstractions

Besides real objects, neural networks can generate abstract concepts. They do this in the way such concepts are portrayed in culture.

It's best not to get carried away and generate concepts that involve independent inference and thought. You will confuse the neural network that way. Choose concrete queries where objects replace abstract concepts.

It's important to avoid:

  • Negations. Avoid the words "not", "without", "exclude", "except", "except", etc. Neural networks understand everything literally and don't see negative particles.
    A large number of objects. There is a high probability that the neural network will make a mistake, especially if each object is detailed.
    A desire to accurately represent a real object.
    Try using archetypes. For example, instead of "a person who holds a bow and arrow," it's better to write "archer." If you still can't get it, you can find a similar image and give a description of it. This will make it easier for the AI to understand the idea because it has been trained on similar images.

Detailing the Object

Get more specific. For example, think of how objects will be arranged in the picture. Specify what is in the center of the picture and what is in the background.

You can add detail to the picture by using verbs, nouns, and adjectives. Write not just "magician", but "sad magician in a cap late at night working in the office at the computer." Remember that neural networks have a limit on the number of characters in a prompt. 

You can also add basic details to an object.

Actions

Phrase the action in a way that makes it clearly visible in the image. The verbs "walking" or "standing" help more than "worrying" or "dreaming". If you need an image with a non-obvious action, write the prompt not just "nostalgic" but "sitting, remembering childhood".

Colors

Set the color of the details or the entire color palette. For example, the dress on the girl should be red, and the vase on the table must be blue.

Descriptions

Adjectives help improve your images. They allow you to set the mood of a character or scene.

To enhance the effect, it's better not to use the word "very". Select synonyms. For example, "beautiful" instead of "very nice".

Platform References

AI learns from images from the Internet, so mentioning specific tools will help you achieve a similar result. For example, the wording trending on ArtStation styles the image in the spirit of art from the site.

Keep a balance. There is a sense that the more detailed and complete the prompt, the better the results will be. But excessive detail can overload the system, so the final image will be far from the idea.

Setting the Style

AI is trained on a huge number of works by specific people. You can specify stylistics in a prompt and get good results. For example, create an image of a parrot in the aesthetics of gothic, noir, modern art, manga, fantasy, surrealism, pixel art, or another style.

Mix Styles 

To get an unusual image, you can add two styles to the prompt at once. For example, pixel art and cyberpunk. The main thing is not to combine mutually exclusive parameters. In this case, the neural network will generate an image in either one or the other style.

Adding Examples

You can also add images as examples while creating your prompts. To do this, you need to upload a picture or add a link to it.

There are several other ways to use this feature.

Real Photo Stylization 

Along with the image, you can add any query in the form of text. For example, Midjourney allows you to upload your own photo and experiment with the styles from the previous step.

Blend Multiple Images

The neural network will automatically blend two pictures by taking half of the characteristics from each of them. You can't customize which features to borrow from each image.

Customizing the Parameters

Short commands in neural networks allow you to enhance stylization, quickly change the resolution of image sides, add abstraction, and so on. They differ for each neural network.

Putting the Right Prompt Together 

You should arrange the listed parameters correctly. The words in the first part of the prompt have more weight than those at the end. Try to adhere to this sequence in the query:

  • the main parameter of the image (photo, illustration, frame from the movie, reference picture);
  • object;
  • details of the object (action, description);
  • stylistics (color palette, aesthetics, author);
  • additional parameters (settings for lighting, camera, time of day, weather, graphics);
  • add-ons (image proportions, resolution, stylization).

That's not the only scheme. You need to experiment with the order of parameters and words.

Become a part of digital history

Create post

Comments . 0

No comments yet. Be the first to add a comment!