tg_bing_dalle  by yihong0618

Telegram bot for DALL-E 3 image generation

created 1 year ago
414 stars

Top 71.8% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Telegram bot that leverages Bing's DALL-E 3 image generation capabilities. It's designed for Telegram users who want to create images from text prompts directly within their chats, offering features like prompt rewriting via GPT or Gemini and image-to-prompt generation.

How It Works

The bot interacts with users via Telegram, accepting text prompts or image uploads. It utilizes Bing's image creation service, requiring users to provide their Bing cookies for authentication. For enhanced prompt generation, it integrates with OpenAI's GPT or Google's Gemini APIs, necessitating separate API keys and configurations. The core functionality relies on parsing user messages, calling the appropriate backend service (Bing Image Creator, OpenAI, or Gemini), and returning the generated image or rewritten prompt.

Quick Start & Requirements

  • Installation: pip install -r requirements.txt followed by python tg.py '<tg_token>' '<bing_cookie>'. Docker and Fly.io deployment options are also available.
  • Prerequisites:
    • Telegram Bot Token.
    • Bing Cookie string (obtained from bing.com/images/create using Edge or Chrome).
    • Python 3.11 or lower (due to openai-python compatibility issues with Python 3.12).
    • Optional: OpenAI API key (for prompt_pro) and Google Gemini API key (for prompt_gem).
  • Setup: Requires obtaining API keys and cookies, which can take a few minutes.

Highlighted Details

  • Supports prompt rewriting using GPT-3.5/4 or Gemini.
  • Allows image-to-prompt generation using startsword, prompt:, or prompt_gem:.
  • Multiple Bing cookies can be used to increase usage limits.
  • Offers deployment guides for Docker and Fly.io.

Maintenance & Community

The project is open for contributions, with a recommendation to use black for code formatting before submitting pull requests.

Licensing & Compatibility

The project does not explicitly state a license in the README. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The project explicitly states compatibility issues with Python 3.12 due to the openai-python library. Using the bot in public groups might decrease efficiency due to message processing overhead.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.