🎬 Text-to-image generation with Google Gemini & enhanced prompts via Telegram Bot

⚡ 4,477 views · 🎬 Content Creation & Video

Description

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

🤖 AI Image Generator Telegram Bot

Transform simple text descriptions into stunning AI-generated images through a Telegram bot powered by Google’s Gemini 2.0 Flash image. This workflow automatically enhances user prompts with professional prompt engineering techniques and delivers high-quality images directly to your Telegram chat.

🎯 What This Workflow Does

This automation creates an intelligent Telegram bot that:

⚡️ Key Features

🛠️ How It Works

  1. Telegram Trigger: Listens for incoming messages from users
  2. AI Prompt Enhancement: Uses Gemini 2.5 Flash Lite to analyze and expand user requests into detailed prompts
  3. Structured Processing: Formats the enhanced prompt using JSON schema for consistency
  4. Image Generation: Sends the enhanced prompt to Gemini 2.0 Flash image generation API
  5. File Conversion: Converts the generated image data to a file format
  6. Delivery: Sends the generated image back to the user via Telegram

🎭 Use Cases

đź“‹ Prerequisites

Before setting up this workflow, you’ll need:

Required Accounts & APIs:

Required Credentials:

🚀 Setup Instructions

  1. Import the Workflow: Copy the workflow JSON into your n8n instance
  2. Configure Telegram Bot:
    • Create a new bot using @BotFather
    • Add your bot token to the Telegram credentials in n8n
  3. Set Up Google Gemini API:
  4. Activate the Workflow: Enable the workflow to start receiving messages

đź’ˇ Customization Options

📊 Example Interaction

User Input: “Generate a beautiful image of a dragon from game of thrones” Enhanced Prompt: “A majestic, formidable dragon, reminiscent of those from Game of Thrones, perched atop a jagged, snow-capped mountain peak. The dragon is depicted with immense, leathery wings unfurled, scales glinting with iridescent blues and deep charcoals under the harsh, cold light. Its eyes glow with an inner, fiery amber. The scene is captured with a dramatic, low-angle wide shot, emphasizing the dragon’s sheer scale against a turbulent, stormy sky filled with dark, bruised clouds and streaks of lightning. The atmosphere is oppressive and foreboding, with biting wind and swirling snow creating a sense of raw power and danger. The color palette is dominated by icy blues, stark greys, deep blacks, and the contrasting fiery glow of the dragon’s eyes and perhaps a hint of internal fire. Rendered in a hyperrealistic, cinematic digital art style, with exceptional attention to detail on the scales, musculature, and the texture of the rocky environment. Lighting is dramatic and high-contrast, with sharp highlights on the dragon’s form and deep, impenetrable shadows. Quality specifications include ultra-high detail, 8K resolution, photorealistic rendering, and an epic, awe-inspiring mood, evoking the grandeur and terror of powerful fantasy creatures.” Result: file

đź”§ Technical Details

đź”— Nodes Used

HTTP Request, Telegram, Telegram Trigger, Basic LLM Chain, Structured Output Parser, Convert to File

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup