Large Language ModelsGenerate imagesGenerate videos

Discord Bot AI Image Generator: Free Bots and How to Make One

Want a Discord bot that turns text prompts into AI images without a monthly fee? This article sorts the free options by how they really work, shows what each one costs you in queue time and limits, and builds your own slash command image bot with working code.

Discord Bot AI Image Generator: Free Bots and How to Make One
Cristian Da Conceicao
Founder of Picasso IA

Type /imagine a lighthouse at dawn in a chat channel, wait about ten seconds, and a finished picture lands in the thread for everyone to react to. That is the whole appeal of a Discord bot AI image generator: no browser tab, no sign-up form, no extra app. The catch is that the famous bots charge monthly fees, and the free ones come with queues, daily caps, or a sudden shutdown. This article sorts the free options by how they really work, shows what each one costs you in waiting time, and then builds your own bot in under 100 lines of JavaScript.

💡 Quick answer: The easiest free route is a community bot that borrows volunteer GPUs. The most reliable route is a bot you host yourself, and the code below is short enough to finish in one sitting.

What Discord Image Bots Actually Do

A Discord image bot is a small program with three jobs: listen for a command, send your text to an image model, and post the result back to the channel. The bot does almost no heavy lifting itself. The real work happens on a GPU somewhere else, which is why a bot can run on a laptop, a spare mini PC, or the cheapest cloud server.

Man in a charcoal hoodie watching a chat window where a bot just posted a sunrise photo

How a Slash Command Works

Every modern bot follows the same loop, and seeing it once makes the rest of this article easier to follow:

  1. A member types /imagine and fills in a prompt.
  2. Discord sends an interaction to your bot and expects an answer within 3 seconds.
  3. The bot replies with a "thinking" state, called a deferred reply, which buys up to 15 minutes.
  4. The bot calls an image model and waits for the job to finish.
  5. The bot edits the reply and attaches the finished picture.

Step 3 is where most first attempts fail. Image jobs take longer than three seconds, so a bot that skips the deferred reply shows "The application did not respond" and the picture arrives to nobody.

Top-down view of a notebook diagram, phone chat and coffee on an oak desk

Why Discord Suits AI Art

Chat turns out to be a surprisingly good home for image generation:

  • Shared feed. Everyone sees every prompt, so people copy what works and improve on it.
  • Instant feedback. Reactions and replies show which results landed.
  • Built-in permissions. Roles decide who may generate, and channels keep experiments away from serious talk.
  • Mobile by default. Members make images from a phone without installing anything new.

Low-angle view of a bedroom desk with two monitors showing a chat of generated photos and code

💡 Tip: Give the bot its own channel. Image spam in a general chat is the fastest way to annoy a community.

Free Discord Image Bots Compared

"Free" means different things depending on who pays for the GPU. The table groups the main types by that single question.

Bot typeWho pays for the GPUTypical waitMain catch
Community GPU networkVolunteers who donate spare capacitySeconds to several minutesQueue priority, limited model choice
Free trial botsThe bot owner, until credits run outFastCredits end, then a paywall
Self-hosted open sourceYouDepends on your GPU or APIYou maintain it
Paid flagship botsYour subscriptionFastMonthly fee

Prices and limits change often, so check a bot's own page before you invite it to your server.

Four friends laughing around one monitor in a bright living room

Community GPU Bots

Stable Horde, now also called AI Horde, is the best-known example. Volunteers share graphics cards, and anyone can request Stable Diffusion images at no cost. Priority is tracked with points called kudos, which you earn by lending GPU time, so requests from users with fewer points wait longer. Community bots built on this network are the closest thing to a truly free Discord AI art bot, with one trade-off: speed depends on how many volunteers are online.

Free Trial Bots

Many bots hand out a few free generations and then ask for payment. They work well for testing a style, but check three warning signs before adding one to a server:

  • No update in months.
  • No clear owner or support channel.
  • A permission request the bot has no reason to need, such as Administrator.

A bot that only posts pictures needs Send Messages and Attach Files. Nothing more.

Why Midjourney Costs Money

Midjourney started as a Discord bot and made the format popular. Every image burns real GPU minutes, and a chat bot has no ad space to pay for them, so the cost lands on the user. That is also why long-running free bots tend to be small, community-run, or backed by another business.

How to Make Your Own Bot

Building your own removes the queue and the paywall. You pick the model, the limits, and the rules. You need Node.js 20.6 or newer, a Discord account that can add bots to a server, and an API token from an image provider. The code below uses the PicassoIA API because the flow is simple: create a prediction, poll it, download the file.

Close-up of a woman's hands typing on a laptop with a code editor in a cafe

Create the Discord Application

  1. Open the Discord Developer Portal and click New Application.
  2. In the Bot tab, reset the token and copy it once. Treat it like a password.
  3. In OAuth2, tick the scopes bot and applications.commands, then tick the permissions Send Messages and Attach Files.
  4. Open the generated URL and add the bot to a test server.
  5. Turn on Developer Mode in Discord's settings, then copy your server ID and the application ID.

Save the values in a .env file next to your code:

DISCORD_TOKEN=your-bot-token
CLIENT_ID=your-application-id
GUILD_ID=your-test-server-id
PICASSOIA_TOKEN=your-picassoia-api-token

Then run npm init -y and npm install discord.js, and add "type": "module" to package.json.

💡 Tip: Slash commands need no privileged intents, so you skip the Message Content approval that text-command bots must request.

Register the Slash Command

Create register.js. It tells Discord that /imagine exists, with a required prompt and an optional shape:

import { REST, Routes, SlashCommandBuilder } from "discord.js";

const imagine = new SlashCommandBuilder()
  .setName("imagine")
  .setDescription("Make an image from a text prompt")
  .addStringOption((o) =>
    o.setName("prompt").setDescription("What to picture").setRequired(true).setMaxLength(500)
  )
  .addStringOption((o) =>
    o.setName("ratio").setDescription("Image shape").addChoices(
      { name: "Square", value: "1:1" },
      { name: "Wide", value: "16:9" },
      { name: "Tall", value: "9:16" }
    )
  );

const rest = new REST().setToken(process.env.DISCORD_TOKEN);
await rest.put(
  Routes.applicationGuildCommands(process.env.CLIENT_ID, process.env.GUILD_ID),
  { body: [imagine.toJSON()] }
);
console.log("Command registered");

Run it once with node --env-file=.env register.js. Commands registered for a single server appear right away, while global commands can take longer to show up, so test on one server first.

Write the Image Handler

Create bot.js. This is the whole bot:

import { Client, GatewayIntentBits, AttachmentBuilder } from "discord.js";

const API = "https://api.picassoia.com/v1";
const headers = {
  Authorization: `Bearer ${process.env.PICASSOIA_TOKEN}`,
  "Content-Type": "application/json",
};
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

async function generateImage(prompt, aspectRatio) {
  const create = await fetch(`${API}/models/picassoia/picassoia-image/predictions`, {
    method: "POST",
    headers,
    body: JSON.stringify({ input: { prompt, aspect_ratio: aspectRatio } }),
  });
  if (!create.ok) throw new Error(`Create failed with status ${create.status}`);

  let prediction = await create.json();
  while (["starting", "processing"].includes(prediction.status)) {
    await sleep(2000);
    const poll = await fetch(`${API}/predictions/${prediction.id}`, { headers });
    prediction = await poll.json();
  }
  if (prediction.status !== "succeeded") throw new Error(`Prediction ${prediction.status}`);
  return prediction.output[0];
}

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.on("interactionCreate", async (interaction) => {
  if (!interaction.isChatInputCommand() || interaction.commandName !== "imagine") return;

  const prompt = interaction.options.getString("prompt", true);
  const ratio = interaction.options.getString("ratio") ?? "1:1";
  await interaction.deferReply();

  try {
    const imageUrl = await generateImage(prompt, ratio);
    const file = Buffer.from(await (await fetch(imageUrl)).arrayBuffer());
    await interaction.editReply({
      content: `**${interaction.user.username}:** ${prompt.slice(0, 300)}`,
      files: [new AttachmentBuilder(file, { name: "image.jpg" })],
      allowedMentions: { parse: [] },
    });
  } catch (error) {
    console.error(error);
    await interaction.editReply("That one failed. Try again in a minute.");
  }
});

client.login(process.env.DISCORD_TOKEN);

Start it with node --env-file=.env bot.js, type /imagine in your test server, and a picture should appear in a few seconds. Four details deserve a closer look:

  • deferReply() answers inside the 3-second window, then the real work gets 15 minutes.
  • The polling loop checks every 2 seconds and stops when the status leaves starting and processing.
  • allowedMentions: { parse: [] } stops a prompt containing @everyone from pinging the whole server.
  • Re-uploading the file keeps the picture in the channel as a normal Discord attachment.

Use Flux 2 Pro on PicassoIA

Before you hard-code anything, test your wording on a model page. Flux 2 Pro is a good place to check whether a prompt style gives sharp, photographic results, and the same prompt can then go straight into your bot.

Woman in a denim shirt comparing printed photographs on a long table

Pick a Model for the Job

ModelGood fit for a bot command
Flux 2 ProPhotographic scenes and portraits
Seedream 4.5Clean, polished artwork and edits
GPT Image 2Long prompts and readable text in images
Nano Banana 2Quick drafts and image edits
Imagen 4Sharp, realistic everyday scenes
PicassoIA ImageThe model the bot above calls through the API

Test a Prompt Step by Step

  1. Open the Flux 2 Pro page on PicassoIA.
  2. Type the exact prompt a member would send to /imagine.
  3. Pick the aspect ratio you plan to offer: square, wide, or tall.
  4. Generate, look at the result, and change one detail of the wording at a time.
  5. Repeat until three attempts in a row look right, then save that wording as an example for your /help message.

A few parameter tips for the bot itself:

  • Offer only the three shapes above. Fewer choices means fewer confusing results.
  • Ask for one image per command. Chat replies stay fast and the file stays small, since Discord limits attachments to roughly 10 MB on a standard server.
  • Use JPG output for chat. It uploads faster than PNG.
  • Add an optional seed number so friends can reproduce each other's results.

💡 Plan note: The API page lists predictions as free of credits for now and asks for the Infinite plan. Check the PicassoIA API page for the current terms before you build on it.

Once images work, the same pattern powers other commands. A /edit command can call PicassoIA Image Editor Pro, and an /animate command can use a video model such as Seedance 2.0. Video takes longer, so the deferred reply matters even more there.

Keep the Bot Fast and Safe

A bot that works for you alone can still fall over when twenty members hit it at once.

Cooldowns and Queue Limits

The PicassoIA API allows 5 queued or running predictions per account, shared across all your tokens. Track that number in the bot and give each user a short cooldown:

const COOLDOWN_MS = 20_000;
const MAX_IN_FLIGHT = 5;
const lastUse = new Map();
let inFlight = 0;

function checkLimits(userId) {
  const wait = (lastUse.get(userId) ?? 0) + COOLDOWN_MS - Date.now();
  if (wait > 0) return `Slow down, try again in ${Math.ceil(wait / 1000)}s.`;
  if (inFlight >= MAX_IN_FLIGHT) return "The queue is full. Try again in a minute.";
  return null;
}

In the handler, call checkLimits before deferReply(). If it returns text, send it as a private reply (add MessageFlags to your discord.js import and use flags: MessageFlags.Ephemeral). Otherwise set lastUse, add one to inFlight, and subtract one in a finally block after the work ends.

Desk with a handwritten checklist, phone chat and a brass padlock on a notebook

Content Rules for Your Server

An image bot posts whatever the model makes from whatever people type, so set the rules before launch:

  • Limit where it works. Restrict /imagine to one channel or a role in the server's command settings.
  • Respect age-restricted channels. Adult content belongs only in channels Discord marks as age-restricted, and the model provider's own rules still apply.
  • Log prompts privately. Post each prompt and user ID to a moderator-only channel.
  • Filter obvious abuse. Reject prompts that match a short blocklist before they reach the model.
  • Block mass pings. Keep allowedMentions switched off for user text.

Where to Host the Bot

Because the model runs elsewhere, the bot itself needs very little CPU or memory. A 1 GB server is plenty.

Small black mini PC on a wooden shelf with an ethernet cable plugged in

Mini PC or Cloud Server

OptionCostUptimeWatch out for
Laptop you already ownFreeOnly while it is awakeBot goes offline when you close the lid
Mini PC at homeSmall power billAs good as your internetHome router restarts
Small cloud serverA few dollars a monthVery highYou manage updates
Free hosting tiersFreeOften sleeps after idle timeBot disappears from the member list

Whichever you pick, run the bot under a process manager such as pm2 or systemd so it restarts after a crash, and keep the .env file out of version control.

Prompts That Work in Chat

Members will type short, vague prompts. Your job is to make short prompts work and to show people what a better one looks like.

Write Prompts Like a Photo Brief

A reliable pattern is subject, setting, light, lens. Pin an example in the channel:

Weak promptStronger prompt
a doga golden retriever on a wet beach at sunrise, low angle, 35mm photo, soft backlight
old towna foggy harbor town at dawn, fishing boats, wet cobblestones, 35mm photo
coffeea ceramic cup of coffee on a worn oak table, window light from the left, 85mm macro

Let a Language Model Expand Prompts

For short prompts, add a rewrite step: send the member's text to a chat model with the instruction "Rewrite this as a one-sentence photo brief with subject, setting, light and lens," then pass the result to the image model. Test the instruction by hand first. Paste it into Gemini 3.5 Flash or Claude Sonnet 5 on PicassoIA and read the output before wiring it into the bot. Show the rewritten prompt in the reply so members see how the result was made.

Make Your First Image Today

You now have the full map: free community bots for quick fun, trial bots for testing, and a small self-hosted bot when you want control. The fastest way to find out which prompts your server will love is to try them before the bot even exists.

Smiling man in a cafe holding a phone that shows a generated mountain photo

Open Flux 2 Pro or Seedream 4.5 on Picasso IA, type three prompts your community would actually send, and save the best results as examples for your /help message. Then pick up the code above, add the /imagine command, and invite your friends. When you want more options, browse every image, video and language model at picassoia.com/en/all-models and swap in whichever one fits your server best.

Share this article