Coder Social home page Coder Social logo

awekrx / chatgpt-midjourney-prompt Goto Github PK

View Code? Open in Web Editor NEW
330.0 10.0 51.0 11.93 MB

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.

License: MIT License

Python 100.00%
ai ai-art chatgpt midjourney prompt ai-painting prompt-engineering text-to-image text2img

chatgpt-midjourney-prompt's Introduction

ChatGPT-MidJourney-prompt

This is a ChatGPT based prompt generation model for MidJourney. 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.

What's new

24.03.2023

Create PyPi project. Update file structure, add api key authentication to ChatGPT. CLI-app and discord-bot will be available within a few days.

Installation

pip install chatGPTMidJourneyPrompt

Usage

   from chatGPTMidJourneyPrompt.mjPrompt import PromptGenerator

   # supported authorization methods: via email and password, via token, via api key
   config = {
      "email": "your_email",
      "password": "your_password",
      # or
      "session_token": "your_session_token",
      # or
      "api_key": "your_api_key",
   }

   promptGenerator = PromptGenerator(config)

   prompt = promptGenerator.V5("any text")
   prompt = promptGenerator.V4("any text")
   prompt = promptGenerator.niji("any text")
   prompt = promptGenerator.testp("any text")

   # or advanced usage if needed
   promptConfig = {
    "model": "artistic",
    "type": "anime",
    "renderer": "ray tracing",
    "content": "character",
    "aspect_ratio": "1:5",
    "color": "red",
    "url": "example image url",
}

   prompt = promptGenerator.V5("any text", config=promptConfig, words=50)

More about config

All config properties

model type renderer content aspect_ratio color url
weights, artistic anime, photorealistic, avatar, couple avatar octane, unreal engine, ray tracing, mixed character, landscape, object, light, particles depends on the model any any

Aspect ratios

V5 V4 niji testp
any 1:1, 1:2, 2:1, 2:3, 3:2, 4:5, 5:4, 4:7, 7:4, 16:9, 9:16 1:2, 2:1 2:3, 3:2

Model properties support

property V5 V4 niji testp
model + + + -
type + + - -
renderer + + + -
content + + + -
aspect_ratio + + + +
color + + + -
url + + + +

Results

See more examples in my gallery

Short-weights model

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

Artistic model

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

Niji

prompt: Stray dog::3, samurai::5, katana::5, dirt road::3, countryside::3, --niji --q 2

License

This project is licensed under the MIT License.

Acknowledgments

Thanks a lot to the development of AI and separately to ChatGPT for generating the Readme. And also acheong08 for creating ChatGPT.

Future

More advanced options for generating prompts

chatgpt-midjourney-prompt's People

Contributors

awekrx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-midjourney-prompt's Issues

[help wanted]

In config params can i use more then one property ?

like light + particles ...

weird prompt

I used the following code:

`
from chatGPTMidJourneyPrompt.mjPrompt import PromptGenerator

supported authorization methods: via email and password, via token, via api key

config = {
"email": "your_email",
"password": "your_password",

or

"session_token": "your_session_token",

or

"api_key": "api_here",
}

promptGenerator = PromptGenerator(config)

prompt = promptGenerator.V5("human hunting a dog")

print(prompt)
`

I got this response :
human::10, hunting::10, dog::10, weapon::8, forest::7, trees::6, fear::5, chase::4, danger::4, wild::4, action::4, adrenaline::4, survival::4, predator::4, prey::4, nature::3, animal::3, escape::3, attack::3, wilderness::3, aggressive::3, intense::3, pursuit::3, fear::3, courage::2, violence::2, harm::2, harmlessness::2, fearlessness::2, defenselessness::2, defense::2, brutality::2, cruelty::2, dominance::2, submission::2 --v 5 --s 1000 --q 2

Is this a normal prompt?

Getting SSL Error

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 411, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 428, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 472, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 501, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/local/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1041, in _create
    self.do_handshake()
  File "/usr/local/Cellar/[email protected]/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1310, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 573, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='explorer.api.openai.com', port=443): Max retries exceeded with url: /api/auth/csrf (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/aaaa/Tools/midjourney/midj/api.py", line 13, in <module>
    promptGenerator = PromptGenerator(config)
  File "/usr/local/lib/python3.9/site-packages/chatGPTMidJourneyPrompt/mjPrompt.py", line 21, in __init__
    self.chatbot = ChatbotV1(config)
  File "/usr/local/lib/python3.9/site-packages/revChatGPT/V1.py", line 58, in wrapper
    out = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/revChatGPT/V1.py", line 237, in __init__
    self.__check_credentials()
  File "/usr/local/lib/python3.9/site-packages/revChatGPT/V1.py", line 58, in wrapper
    out = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/revChatGPT/V1.py", line 268, in __check_credentials
    self.login()
  File "/usr/local/lib/python3.9/site-packages/revChatGPT/V1.py", line 58, in wrapper
    out = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/revChatGPT/V1.py", line 413, in login
    auth.begin()
  File "/usr/local/lib/python3.9/site-packages/OpenAIAuth.py", line 70, in begin
    response = self.session.get(
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 563, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='explorer.api.openai.com', port=443): Max retries exceeded with url: /api/auth/csrf (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1129)')))

Unable to use email or session token

In config im setting email, password, session token doesn't it work without API.

ERROR:
Traceback (most recent call last): File "/usr/share/pycharm/plugins/python-ce/helpers/pydev/pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/usr/share/pycharm/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/vino/Documents/AiArtly/chatgpt_midjourny.py", line 37, in <module> promptGenerator = PromptGenerator(config) File "/home/vino/Documents/AiArtly/lib/python3.10/site-packages/chatGPTMidJourneyPrompt/mjPrompt.py", line 18, in __init__ if config["api_key"]: KeyError: 'api_key'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.