george-iam / midjourney_api Goto Github PK
View Code? Open in Web Editor NEWunofficial Midjourney API
License: MIT License
unofficial Midjourney API
License: MIT License
When adding a picture as a reference picture, the parameters are abnormal.
For example submitted is:
https://cdn.discordapp.com/attachments/1097388640411320393/1112334804248186970/girl.jpg a girl
The output is:
https:cdndiscordappcomattachments10973886404113203931112334804248186970girljpg a girl --seed 1721528761 --ar 3:4 --q 1.0 --stylize 100 --v 5.1
Obviously, image links are filtered out of symbols.
Then I repaired the sender, and I was able to submit tasks with pictures correctly, and pictures were created on Discord, but I couldn’t return to the page.
Each time I start the receiver, it shows every previously-sent prompt and downloads every image again.
How do I avoid this from happening? Is there a memory or a cache I can clean?
Thanks !
When I send a requests through sender.py script, it seems that the receiver will download all images in this discord channel. How can I download the image only generated by the current input prompt?
I am very interested in this project. Can it be run directly now? Where should I contact you if I want to sponsor this project?
I am very interested in this project. Can it be run directly now? Where should I contact you if I want to sponsor this project?
how to get sender_params.json ,
the below values:
"channelid": "", "authorization": "", "application_id": "", "guild_id": "", "session_id": "", "version": "", "id": "",
Thanks for your great work.
i meat some bug while run receiver.py,hope you can provide some help about this.
below is the error information When I start receiver.py:
=========== listening started ===========
urllib3.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:1129)
The above exception was the direct cause of the following exception:
urllib3.exceptions.ProxyError: ('Unable to connect to proxy', SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='discord.com', port=443): Max retries exceeded with url: /api/v10/channels/1105683530970828873/messages?limit=100 (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\TemporaryFiles\Midjourney_api-main\receiver.py", line 130, in
receiver.main()
File "D:\TemporaryFiles\Midjourney_api-main\receiver.py", line 107, in main
self.collecting_results()
File "D:\TemporaryFiles\Midjourney_api-main\receiver.py", line 44, in collecting_results
message_list = self.retrieve_messages()
File "D:\TemporaryFiles\Midjourney_api-main\receiver.py", line 37, in retrieve_messages
r = requests.get(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 513, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='discord.com', port=443): Max retries exceeded with url: /api/v10/channels/1105683530970828873/messages?limit=100 (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))))
do i need midjourney paid subscription to use this?
I have two questions:
When sending a new prompt, I see this error on the original terminal :
========================================= Traceback (most recent call last): File "/receiver.py", line 130, in <module> receiver.main() File "/receiver.py", line 107, in main self.collecting_results() File "/receiver.py", line 68, in collecting_results self.awaiting_list.loc[id] = [prompt, status] UnboundLocalError: local variable 'status' referenced before assignment
Is there any way I can fix it?
hi, thanks for the great work!
I want to reset the midjourney every time before I send a prompt for drawing. This is because I use a shared account and if anyone changed the settings (e.g., set a suffix to --niji 5), then I cannot use the "--v 5.1" model in this API due to conflict suffix.
Or if you have a better solution for this?
Thanks
"Https://discord.com/api/v10/channels/channelid/messages" the request, how do you catch F12 developer tools, or app interface? Web side can't catch this request now
There is no authorization in the chrome payload. Did they remove it?
XXX@jiqi midjourney_api % python /path/to/cloned/dir/sender.py --params /path/to/cloned/dir/sender_params.json --prompt 'a boy'
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3: can't open file '/path/to/cloned/dir/sender.py': [Errno 2] No such file or directory
Thank you first of all for this project. It is exactly what I need.
I have following Problems:
I can't find the authorization key in my payload. Is it needed?
When I start receiver.py I get following error:
=========== listening started =========== Traceback (most recent call last): File "/Users/matthias/Library/receiver.py", line 133, in <module> receiver.main() File "/Users/matthias/Library/receiver.py", line 110, in main self.collecting_results() File "/Users/matthias/Library/receiver.py", line 49, in collecting_results if (message['author']['username'] == 'Midjourney Bot') and ('**' in message['content']): TypeError: string indices must be integers
I wasn't able to solve it.
I hope you can help me!
I just cloned the project and did all the settings based on your instructions. The received part seems to work, but the sender parts doesn’ t work(its processing for the whole time).
I used the command below.
python sender.py --params sender_params.json --prompt "/imagine art"
It would be great to help me figure that out.
when executing a prompt and getting a 4 option results before upscale.
is there any way to instruct a specific upscale? u1,u2....?
or perhaps make the sender call the prompt in a way it returns only 1 upscaled result?
Whenever I send a prompt, it gets detected by the receiver and shows "Waiting to start" as status, but a moment later I get the following error:
prompts in progress:
prompt status
1199706074954080277 a face ,ultrarealistic photography, cinematic ... Waiting to start
Traceback (most recent call last):
File "C:\Users\User\Documents\video-generation\server\MJ_API\receiver.py", line 130, in
receiver.main()
File "C:\Users\User\Documents\video-generation\server\MJ_API\receiver.py", line 107, in main
self.collecting_results()
File "C:\Users\User\Documents\video-generation\server\MJ_API\receiver.py", line 75, in collecting_results
self.awaiting_list.loc[id] = [prompt, status]
^^^^^^
UnboundLocalError: cannot access local variable 'status' where it is not associated with a value
I've seen someone with a similar issue where the solution was to change the model version to leave it at --v 5, but it didn't work for me.
python /Users/nihao/Desktop/mycode/python/Midjourney/Midjourney_api/sender.py --params /Users/nihao/Desktop/mycode/python/Midjourney/Midjourney_api/sender_params.json --prompt 'a pig'
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
TimeoutError: [Errno 60] Operation timed out
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.