A Telegram bot that generates AI images from text prompts using Pollinations.ai and Arta.ai APIs, with automatic fallback between services.
- Dual AI Backend: Uses both Pollinations.ai and Arta.ai for reliable image generation
- Smart Fallback: Automatically switches services if one fails
- Customizable Output: Control image size and model parameters
- User-Friendly: Command suggestions and clear instructions
- No API Keys Needed: Uses public endpoints
- Python 3.8+
- Telegram bot token (get from @BotFather)
- For Demo try this PrompArt BOT
-
Clone the repository:
git clone https://github.com/Anon4You/Ai-Image-Generator-Bot.git cd Ai-Image-Generator-Bot
-
Install dependencies:
pip install -r requirements.txt
-
Set up your bot token:
echo "YOURTELEGRAMBOTTOKENHERE" > token.txt
(Replace
YOURTELEGRAMBOTTOKENHERE
with your actual bot token) -
Run the bot:
python bot.py
/start
or/help
- Show help message/admin
- Information about the bot creator/img [width] [height] [model] [prompt]
- Generate an image
/img a beautiful sunset
/img 512 512 a cute puppy
/img 1024 768 stable-diffusion futuristic cityscape
You can modify these constants in bot.py
:
DEFAULT_WIDTH
- Default image width (1024)DEFAULT_HEIGHT
- Default image height (1024)DEFAULT_MODEL
- Default AI model ("flux")MAX_PROMPT_LENGTH
- Maximum prompt length (400)
The bot can be deployed on:
- Any VPS or cloud server
- AWS Lambda
- Google Cloud Run
- Heroku
- Any Python-compatible hosting
This project is licensed under the MIT License - see the LICENSE file for details.
If you like this project, please consider starring ⭐ the repository!
Created by Alienkrishn
Report Issues
View on GitHub