This is a ChatGPT based prompt generation model for MidJorney. The purpose of this model is to simplify the creation of images and increase their creativity. By introducing a partial hint, ChatGPT creates a follow-up that can be used to stimulate creativity and provide new ideas.
17.03.2023
Added V5 support (beta). Features like V4 later, no time now.
Clone this repository to your local machine:
git clone https://github.com/awekrx/ChatGPT-MidJourney-prompt.git
Then install the required packages:
pip install -r requirements.txt
Open config.ini
and add email
and password
there if you are not using OAuth authorization.
Otherwise open ChatGPT and get the __Secure-next-auth.session-token
cookieand write it to the session-token
.
py main.py
To use this model, you can input the following commands in the console:
- Select the prompt model;
- The short model creates prompts in the format:
Planet::5, rings::4, crater::3, star clusters::5, atmosphere::4, reflection::3, space::5
- The art model creates in the format:
A Victorian-style chair with chrome and ornate decorations reflects a distorted image in the water on the ground. The intricate patterns on the chair add an air of sophistication and elegance to any room. Lighting: Candle Light. Style: Victorian. Details: Cell Shading, atmosphere, ray tracing.
- The short model creates prompts in the format:
- Select the mid-journey model;
- V4 - MidJourney default model;
- Niji - MidJourney test model for anime;
- Realistic(testp) - MidJourney test model for maximum realism;
- Add image description and description count;
- Anything you wish;
- You can specify at the beginning of the url the image to generate based on it;
- Choose advanced settings;
If you choose advanced settings:
- Select image type;
- Adds the selected style to the image;
- Anime - anime cartoon style;
- Photorealistic - maximum quality details;
- Avatar - focus on the center of the image;
- Couple avatar - Especially for creating avatars that you can share with your soulmate ♡;
- Choose aspect ratio;
- I think everything is clear here;
- Choose rendering:
- Changes the generation style. Object details. You'll understand better if you test it;
- Choose content refinement;
- Specifies what exactly we want to see in the image;
- Combining the character description and, for example, the particle mode, you can get very interesting images;
- Choose color change;
- Choose dominant colors separated by commas;
You can also use this as a function in python.
from modules.prompt import Prompt
import configparser
config = configparser.ConfigParser()
config.read("config.ini")
auth = {
"email": config["ChatGPT"]["email"],
"password": config["ChatGPT"]["password"],
"session_token": config["ChatGPT"]["session_token"]
}
prompter = Prompt(auth)
prompter.ask()
With prompter.ask()
you can create a prompt.
Parameters:
text
: A string representing the prompt for generating text.
count_words
: An optional integer representing the number of words to generate in response to the prompt. The default value is 25.
type
: An optional integer representing the type of content to generate. This can be one of several values defined in the Settings module. The default value is 0.
resolution
: An optional integer representing the resolution of the generated content. This can be one of several values defined in the Settings module. The default value is 0.
renderer
: An optional integer representing the renderer to use for the generated content. This can be one of several values defined in the Settings module. The default value is 0.
content
: An optional integer representing the type of content to generate. This can be one of several values defined in the Settings module. The default value is 0.
prompt_model
: An optional integer representing the type of prompt model to use for generating text. This can be one of several values defined in the Settings module. The default value is 0.
mj_model
: An optional integer representing the type of mid-journey model to use for generating text. This can be one of several values defined in the Settings module. The default value is 0.
colors
: An optional list of integers representing the colors to use for the generated content. This can be one or more values defined in the Settings module. The default value is an empty list.
Return
: A string representing the generated text. If the text parameter starts with "http", the function will attempt to extract a URL from the beginning of the string and return the URL along with the generated text.
disclaimer
: at the moment the bot does not have the possibility of all parameters as through the CLI.
-
In addition to the token from ChatGPT. You will also need your bot token, you can create a bot and get a token here. Add the token to the
bot_token
field inconfig.ini
. -
Install
requirements
anddiscord.py
pip install -r requirements.txt pip install discord
-
Run bot
py bot.py
See more examples in my gallery
prompt:
Sakura blossoms::5, pink flowers::4, Licorice plant::3, Japanese landscape::5, octane render::4, landscape desing::4, red::10, purple::10, , high quality photo::5, soft light::2, sharp-focus::3, hyper realism::4 --v 4 --s 1000 --q 5 --ar 16:9
prompt:
Stars::5, galaxy::4, space::5, , , , --v 4 --ar 3:2 --s 1000 --q 5 --ar 1:2
prompt:
Elven assassin with a masked face and intricate runes. Highly detailed photorealism showcases the intricate details of the mask and runic markings. Focused on the assassin's face, with a blurred background. The lighting is a blend of candlelight and twilight, adding a sense of mystery to the character. The style is a mix of ancient and fantasy. Resolution: --ar 16:9 --s 1000 --q 2 --upbeta --v 4
prompt:
An elven warrior girl wielding a sword, dressed in armor made of intricate metals and fabrics. She stands against a futuristic background with high-tech elements, rendered with the latest technologies. Focused, blurred background, full-body::5 soft light::1 high quality photo::1 --v 4 --ar 3:2 --s 1000 --q 5
prompt:
Stray dog::3, samurai::5, katana::5, dirt road::3, countryside::3, --niji --q 2
This project is licensed under the MIT License.
Thanks a lot to the development of AI and separately to СhatGPT for generating the Readme. And also acheong08 for creating ChatGPT.
More generation options:
- styles
- lighting
- artists style