MidJourney Echo URL Discord Bot

Recursively using MidJourney Images to Improve Results

Inspired by Zelrik#0969, who pointed out this fine workflow. Recursively using images can improve results.

Process Example

Original prompt: beautiful woman with green hair and bright pink eyes

[URL of selected] , beautiful woman with green hair and bright pink eyes, gothic, night --ar 9:16

[URL of selected] , beautiful woman with green hair and bright pink eyes, gothic, night, rule of thirds --ar 6:4

While you can do this by right-clicking the image, getting the url, pasting it, and building your prompt string, you can simplify this process if you know how to do your own Discord bot (or have a friend who does).

How to do this FAST by implementing your own Echo Llama bot on your own server.

Demonstration of Echo Llama Discord Bot. It listens for a MidJourney image response, then echos that image's URL and prompt back, for easy copy/paste to the Imagine Prompt.

https://youtu.be/cazjpmvegqo

Code to use in your Discord Bot:

For more advanced code, see https://github.com/Fledgewing/MidJourneyHelperBot/blob/main/index.js and https://wiki.artmechanicum.com/wiki/Help#What_is_MidJourneyHelperBot? by Temporalis#3311.

const Discord = require('discord.js');
const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] });
const settings = require('./settings.json');


client.on('ready',() => {
	console.log("online");
});

client.on('messageCreate', message => {
	if (message.author === client.user) return;

	if (message.author.username === "Midjourney Bot") {
		var str = message.content;
		var sub = str.match(/^\*\*.*\*\*/);
		if (sub) {
			sub = sub[0];
			sub = sub.substr(2);
			sub = sub.substr(0, sub.length - 2)
			message.attachments.forEach(attachment => {
				const ImageLink = attachment.proxyURL;
				message.channel.send(`\`${ImageLink} , ${sub}\``);
			});
		}
	}
});

client.on('error', function (err) {
  console.log('Global error handler called:\n');
  if(err) {console.log(err);}
});

client.login(settings.token);

If you find this useful, please consider my books.
Cattail.Nu, L.L.C.
Books by T.L. Ford