Día: 31 de diciembre de 2024

  • Creating consistent AI characters in Midjourney

    Creating consistent AI characters in Midjourney

    Introduction

    We’ve all experimented with using AI tools to create images. When we want inspiration, we get excellent ideas and results from tools like Midjourney to Dall-e, Stable Diffusion, and others. All AI tools are capable of generating beautiful imagery, sometimes beyond what we expected. But what happens if we have a clear idea in mind and we want the same character in different scenes and scenarios? In this article, I’ll show you how to get consistant AI images in Midjourney.

    Hands on tutorial

    To better illustrated this, let’s start with an example. Let’s say you need “a woman eating a banana in a brown sweater inside a bus, looking upset and unfriendly while staring at the window”. When you input the same exact prompt in Midjourney, you might get a similar result to this image:

    AI generated image depicting  a young woman sitting inside a bus holding a banana to her mouth.
    Midjourney AI generated image

    Then you might want the same woman standing on the street, at the bus stop. How do you achieve that?

    Using –cref

    Now, that you have your chracter, you could try describing her as best as possible to get the same character in a different scenario:

    Prompt: imagine a woman with dark hair, shoulder lenght, caucasian, thick eyebrows, wearing a brown sweater, standing at a bus stop. 

    No matter how much you dive into the specifics of describing our selected character, you might get something else:

    AI generated image depicting a young woman with a brown sweater.
    Midjourney AI generated image

    This is a completely different woman. So how do you generate the same character in a different scenario?

    You might have actually been aiming for something like the following image -almost the same woman:

    AI generated image showing a young woman standing at a bus stop
    Midjourney AI generated image

    Midjourney has a very good option called --cref. You can find the official tutorial to using Midjourney’s –cref setting here.

    This option allows you reference a character. Here are the summarized steps to use it:

    1. Generate your character on Midjourney. Right-click on this image and get the option Copy Link.
    Midjourney image showing a woman at a bus stop. The screenshot shows the options to copy the link of the image.
    1. Write your prompt describing the new scene or situation. You don’t need to describe the woman anymore.
    2. Add to your prompt the –cref <LINK> using the link you copied form the image.

    You will get a prompt similar to this one:

    The --s50 which refers to the stylization is automatically added by my Midjourney settings. You don’t need to add that.

    Voilá! you’ll get images that are similar to your initial character:

    Midjourney screenshot in Discord showing the for results of a prompt.

    Using –sref

    Now, let’s say that this isn’t exactly what you wanted. You wanted the woman at the bus stop, but in a half-turned pose, looking back, and in a bus stop that has a more of a nighttime ambiance. Something inspired by this Pixabay stock image:

    Image showing an asian woman at a bus stop at night time.
    Image by Ly Huynh from Pixabay

    But no matter how much you try to describe that the woman should be portrayed with her body turned back and looking toward the camera, you don’t get exactly what you envisioned. You could lose hours using Midjourney credits by trying to generate a scene that is similar to the one you want. So, how do you achieve the following image?

    Midjourney AI image showing a young woman at night time at a bus stop, holding some bananas.
    AI generated image

    To generate the same character in the scene you want, use the advantage of the Pixabay image that already features the pose and ambiance that you want. While it won’t be 100% accurate, it will resemble more closely than you expected it.

    To achieve this, you can use –sref command which let you use images as style references to influence the style or aesthetic. You can find more information about Midjourney’s –sref setting here.

    But in short, follow these simple steps:

    1. Upload the image from Pixabay by clicking + and selecting Upload a File. Check the following article for more information on how to upload images to the Discord server.
    screenshot of Midjourney in Discord showing the options to upload a file.
    1. Grab the link from this uploaded image in the same way you grabbed the link from your character.
    2. Write your prompt using --sref <LINK> and replace with the Pixabay link retrieved from previous step.
    3. Include again in your prompt the --cref with a link to your character. You can always scroll up to find your character’s image link.
    a screenshot of a Midjourney prompt

    Conclusion

    These are a couple of tips that should make your journey easier with Midjourney (pun intended). I hope they can help you achieve your goals and get consistent images for the story that you’re trying to tell.

    If you’re creating images with the purpose to animate them and apply them into a short film or book trailer, and you prefer someone else to battle with all the quirks from AI generation, don’t forget that I offer this book trailer service in Fiverr.