This Telegram bot provides a convenient interface for working with images using artificial intelligence. The bot allows you to generate new images based on text prompts and edit existing photos using AI.
- Image Generation: Create new images based on text descriptions
- Photo Editing: Modify existing images using text instructions
- User-Friendly Interface: Easy interaction through buttons and text commands
- High Quality: Powered by the robust Gemini 2.0 model for image processing
- Python 3.9+
- pyTelegramBotAPI
- Google Gemini AI API
- Pillow (for image processing)
-
Clone the repository:
git clone https://github.com/timurkafff/Telegram-bot-ai-image.git cd Telegram-bot-ai-image -
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure environment variables or edit the
main.pyfile with your tokens:TELEGRAM_TOKEN: get from @BotFatherGEMINI_API_KEY: get from Google AI Studio
-
Run the bot:
python main.py
- Find the bot on Telegram by its username
- Send the
/startcommand to begin - Choose the desired function using the buttons:
- Image Generation: Create a new image based on a text description
- Photo Editor: Modify an uploaded image based on text instructions
- Google Gemini AI for providing the API for image generation and editing
- pyTelegramBotAPI for the convenient library for creating Telegram bots
