Home

Awesome

中文版本-Live Demo

Midjourney-Web-API

Unofficial Midjourney-Web-API, for learning and research purposes only.

:sparkles: Features

QuickStart fast start

  1. clone project
git clone https://github.com/CelestialRipple/Midjourney-Web-API
cd Midjourney-Web-API

2、 Get Cookie (make sure you can use Midjourney drawing in Discord)

  1. Fill the information in the request header into sender_params.json. It is worth noting that if you need multi-threaded drawing, please fill in the channelid array with the channelid of different channels (the maximum number of concurrency is 3 for Standard plan, 12 for PRO plan)

4、 Start Web-API

pip -r requirements.txt
python app.py
  1. (Optional) Go to app.py to configure cross-domain
nano app.py

(Updated) Introduction to external API usage:

Request method

import requests
import json

payload = {
    "prompt": "your_prompt_here"
}

url = "http://localhost:5000/api/send_and_receive";

response = requests.post(url, data=json.dumps(payload), headers={'Content-Type': 'application/json'})

print(response.json())
import requests

base_url = 'http://localhost:5000' # Replace with the URL your Flask application is actually running on
file_name = 'rockgifinrock1971_link_and_zelda_33e8886f-adae-4579-9882-bae644005f5b.png' # Replace with your actual file name
number = 3 # Replace with the number you want to use

response = requests.get(f'{base_url}/upscale', params={'file_name': file_name, 'number': number})

if response.status_code == 200.
    print('Success!')
    print(response.json())
else.
    print(f'Error: {response.status_code}')
    print(response.text)

Q&A

Q: How often is the information in sender_params.json updated? A: It has been two weeks since the project was run, and it is still not expired.

Future plan

Contact:

For suggestions and cooperation: Me@hiripple.com Ask the author to eat Crazy Thursday to speed up the project: https://afdian.net/a/hiripple/plan

License

MIT

Additions

Sender.py and Receiver.py are based on https://github.com/George-iam/Midjourney_api二次开发