A Discord bot that transforms your photos into AI-generated art, powered by Google Gemini (completely free).
Upload a selfie, pet photo, or anything. Pick a style like Anime, Cyberpunk, Ghibli, or Oil Painting and get an AI-generated version in seconds.
| Command | Description |
|---|---|
/transform |
Transform a photo with a style preset or custom prompt |
/compare |
Side-by-side before & after comparison |
/randomstyle |
Random style surprise |
/transform_all |
Apply all 10 styles at once |
| React with paint | React on any image to auto-transform it |
- Voting - every result gets reaction buttons so people can vote
- #ai-gallery - all transformations auto-post to a gallery channel
- 10 Style Presets - Anime, Oil Painting, Cyberpunk, Watercolor, Pixel Art, Sketch, 3D Render, Fantasy, Pop Art, Ghibli
- Custom Prompts - write your own style description
| Key | Where to get it | Cost |
|---|---|---|
| Discord Bot Token | discord.com/developers | Free |
| Gemini API Key | aistudio.google.com/apikey | Free (500 images/day) |
- Go to Discord Developer Portal, create a New Application
- Go to Bot tab, enable Message Content Intent
- Go to OAuth2, URL Generator:
- Scopes:
bot,applications.commands - Permissions:
Send Messages,Attach Files,Embed Links,Add Reactions,Read Message History
- Scopes:
- Copy the generated URL and invite the bot to your server
# Clone the repo
git clone https://github.com/butunghd0-max/python-image-discordbot-experimenting-practice.git
cd python-image-discordbot-experimenting-practice
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env with your Discord bot token and Gemini API key
# Run the bot
python bot.pyCreate a text channel called #ai-gallery in your Discord server. The bot will automatically post all transformations there.
bot.py # Main bot - commands, events, and logic
image_transform.py # Google Gemini API integration
requirements.txt # Python dependencies
.env.example # API key template
.gitignore # Keeps secrets out of git
- Python + discord.py - bot framework
- Google Gemini API (
google-genai) - AI image generation (free) - Pillow - image processing and comparison generation
- Never commit your
.envfile - it contains your secret API keys - Gemini free tier allows around 500 image generations per day
/transform_alluses 10 API calls at once, use it sparingly- The bot needs the Message Content and Reactions intents enabled
This project is just iseng-iseng doang (just messing around for fun/practice). Just practicing how to incorporate APIs. The bot is essentially gluing the Discord API and Google Gemini API together.
A more serious version will likely be built in Node.js / JavaScript, since I need to learn that for my Computer Science IA. Stay tuned!
Feel free to use and modify this project however you'd like.
Discord. "Discord Developer Portal - Documentation." Discord, Discord Inc., 9 Mar. 2026, https://discord.com/developers/docs/intro.
Discord.py. "Discord.py Documentation." Read the Docs, discord.py, 9 Mar. 2026, https://discordpy.readthedocs.io/en/stable/.
Google. "Gemini API: Image Generation." Google AI for Developers, Google, 9 Mar. 2026, https://ai.google.dev/gemini-api/docs/image-generation.
Google. "Google AI Studio: API Keys." Google AI Studio, Google, 9 Mar. 2026, https://aistudio.google.com/apikey.
Google. "Google Gen AI Python SDK." GitHub, Google, 9 Mar. 2026, https://github.com/googleapis/python-genai.
Pillow Contributors. "Pillow (PIL Fork) Documentation." Read the Docs, Pillow, 9 Mar. 2026, https://pillow.readthedocs.io/en/stable/.
Sauber, Sven. "python-dotenv." PyPI, Python Software Foundation, 9 Mar. 2026, https://pypi.org/project/python-dotenv/.