If you want to create images using Midjourney, you’re stuck using Discord.
Sort of.
Midjourney has not released an API, though they are slowly staggering towards one. There’s undoubtedly a private internal API but for external public users, the technology is completely tied to Discord. Authentication on midjourney.com is via Discord and the only way to interact with the technology is by submitting /imagine commands on Discord.
This inhibits some logical workflows. For example, perhaps you want to work out a set of prompts and then batch-submit them so it can run overnight. Perhaps you want to auto-upsize each image and save them in a directory along with a text file (or a database entry) describing the prompt used.
And just to state the obvious, Midjourney is the kind of technology that works best with volume. Yes, if you play around with it, you’ll make some nice images just by feeding it fun creative prompts. But if you’re trying to get a specific kind of image or look, you’ll need to iteratively generate and tune the results.
For example, here’s a typical workflow. I have a friend who’s suffering from Lou Gehrig’s disease and is in full-time managed care. I had the idea to brighten his spirits by sending him funny images of someone who looks like him, and our other friends can comment and have a chat with him.
To make this happen, the steps are:
- Find a phrase that describes my friend. For example, “middle-aged Italian man with a friendly face and giant forearms”
- Add “no mustache” and tweak the age otherwise every image looks like Mario meets Hulk Hogan.
- Find a fun scene – for example “terrifically handsome grumpy Italian man with giant forearms taking a selfie with his fellow sailors aboard their World War II German U-boat, everyone laughing, sloshing beer”
- Experiment with lighting, mood, art style, and dozens of other parameters.
- And then eliminate all the gens where the hands are messed up or someone in the background is missing an eye or other AI artifacts
So you can easily generate 50 times to get what you want. I mean, that’s what /relax is for.
Alas, to do this, you’re going to be typing all these commands into Discord. Forget a Python script that generates all the variations you want neatly pipelining to an API.
Well, you don’t have to entirely forget it…
I came across a great article on Medium that takes an interesting approach. It uses PyAutoGUI to build a bot that talks on your Discord and feeds it prompts from a text file. I played with it and it works as advertised. You create a prompts.txt file and then watch the bot type commands.
Just writing a bog-standard Discord bot won’t work because the Midjourney bot expects “/imagine” and then “tab” and then your prompt. It’s tedious.
Unfortunately, since it’s a fake gui operator waiting for events, I haven’t quite got it modified to create those database entries. In theory it should be possible to get the attachments and save them – work in progress!
Meanwhile, you might find these resources helpful:
- First, as general advice, create your own Discord server and add the Midjourney bot to it. Otherwise if you use their official server your results are jammed in with everyone else’s and it’s a visual mess.
- All major styles and commands: This Github is an amazing resource. Tons of lighting, style, mood, artist, perspective, etc. commands.
- Quick gist of all the major Github commands
- An incredible 50TB Google Sheet showing all artists and styles (OK, it’s not really 50TB but it’s huge)
Related Posts:
- MetWeb has a 30% Off Deal on Cheap VPS Offers in Utah for Our Readers! - December 21, 2024
- Is Your Soul as Dark as a Christmas Stocking’s Coal?Make Your Online World Match - December 20, 2024
- Hosteroid has a HOT, Limited Stock Offer in Vienna or Amsterdam! - December 19, 2024
I was thinking the same about the need for a good API today and stumbled on your post. Thanks for the info and references.
Now you can access unofficial Midjourney api here at rapidapi https://rapidapi.com/aalison913/api/midjourney2
How to get directly in touch? Twitter perhaps?
Just want to show you API layer to Midjourney: userapi.ai
Link to the documentation
There are all methods including Vary Region and Remix mode provided