All About AI

Midjourney Video Game Prompt Generator | GPT3 + Python

I wanted to create a prompt generator to give me different ideas to create some cool AI art in Midjoruney. Since I like many other love video games, I decided to make it a video game themed generator.

How did this turn out? Read more to find out, or watch the YouTube video.

YouTube:

Midjourney Python Prompt Generator

My basic idea behind the prompt generator was to use GPT-3 and a Python script to generate the prompts. Since OpenAI`s API is very good and simple to use, it was an easy choice.

I wanted to make the Midjourney prompt generator as easy as possible, so the plan was to create a bunch of few shot examples for the GPT-3 engine to learn from. So it could easily create similar examples I could just copy paste into Midjoruney.

The Python script was so that I could write the results straight into a text file and save time by just running the script over and over again to get more creative results.

The Python Script

The design of the Python script was to create a txt file with examples for the GPT-3 to learn from, so i created this list of reference examples:

To take advantage of this list i constructed the GPT-3 prompt to read the content of the text file first, then it was instructed to create similar examples

GPT-3 prompt:

prompt = open_file(‘videogameex.txt’)+ ‘Inspired by the prompts above, create 5 similar prompts:

I tried a few different settings for the GPT-3 davinci-002 engine, but I ended up setting the temperature to 1 for max creativity. 

def gpt3 (prompt, engine=’text-davinci-002′, temp=1, top_p=1.0, tokens=100, freq_pen=0.0, pres_pen=0.0, stop=[‘<<END>>’]):

By doing this I noticed I got a lot more different results pulling other video games and graphic styles.

So that was basically the Python script done, just by taking advantage of the GPT-3`s ability to recreate examples the script was working as intended.

Midjourney Video Game Prompt Generator Results

I thought I’ll leave some of the results I got by using the prompt generator here. One thing I did to improve my results was to take my favorite graphical results and replace the “male/female character” with a character from the video game like:

male character, Call of Duty Style, Xbox 360 Graphics, –ar 4:3 = Ghillie Sniper, Call of Duty Style, Modern Warfare, full body, Game Boy Color Graphics, –ar 4:3

Ahri, League of Legends Style, Nintendo Switch Graphics, –ar 4:3

Ahri fro League of Legends is one of my favorite characters, so i was very happy with how this turned out.

Margot Robbie as Lara Croft, PS5 Graphics, –ar 4:3

WOW! This was very impressiv. How the Midjoruney AI engine combines Lara Croft with the actress Margot Robbie is kinda mindblowing. 10 / 10

Emma Watson as Princess Zelda, PS5 Graphics –ar 4:3 

Same as the Margot Robbie image, really impressed how Emma Watson is displayed as Princess Zelda here. Stunning.

Link, legend of zelda rogue, Yoji Shinkawa, –ar 4:3

I really think this was so cool. Love the art style and also the feel of this image. Would print!

Zendaya as Jill Valentine, Resident Evil rogue, PS5 Graphics –ar 4:3

Same as all the other was really happy with how this did turn out. Very impressing results for the hybrid of an video character and a famous actress.

Conclusion:

So the idea behind the prompt generator turned out as I planned. A prompt generator can give you a lot of different ideas, especially while using the GPT-3 engine, which is pretty creative.

But I did find myself always editing the prompts to improve them to get the results I wanted, but I don’t think that was a failure because of that. I rather say the prompt generator gave me a lot of good ideas to improve on. 

Using a combination of GPT-3 and Python worked very well, the only downside is that you will have to pay a small fee for every prompt you create, so i don’t know if this is worth the money.

But I still had fun making this, and I improved my Python skills.