Automated AI Text-to-Image Generation Agent
This advanced n8n template demonstrates how to use AI to generate custom images from scratch - fully automated, prompt-driven, and ready to deploy at scale. It triggers via Telegram or API, parses natural language prompts, creates structured image generation parameters, generates high-quality visuals using models like Flux or Gemini, and delivers the result instantly.
Workflow Architecture

Visual representation of the n8n automation flow
The Challenge
Creating custom, high-quality visuals for marketing, social media, or storyboards is time-consuming and often requires expensive software or manual prompt engineering.
The Solution
An automated bot that takes simple chat messages, refines them into expert design prompts using an LLM, and instantly generates production-ready images via top-tier AI models.
Key Features
Multi-Channel Triggering
Initiate generation via Telegram, n8n Chat, or API calls.
Smart Prompt Refinement
Uses an AI Agent to rewrite simple inputs into detailed, high-quality image prompts.
Model Flexibility
Supports Flux, Google Gemini, OpenAI DALL-E 3, and more.
Automated Delivery
Sends the generated image back to chat or saves it to local disk/cloud.
Technical Deep Dive
Telegram Trigger
Receives user prompts.
AI Agent (Gemini)
Processes & refines prompts.
HTTP Request
Fetches generated image data.
Code Node
Cleans JSON & sets filenames.
Prerequisites
- Google Gemini / OpenAI account with image generation access
- Telegram Bot Token (if using Telegram trigger)
- n8n instance with file system access (optional)
How It Works
- 1
Import the workflow package into n8n.
- 2
Configure Telegram Trigger and AI Agent credentials.
- 3
Customize the 'Fields - Set Values' node for default resolution (e.g., 1080x1920) and model (Flux, Gemini).
- 4
Open your Telegram bot, type a prompt, and watch the magic happen.
Need this exact workflow?
We can deploy and customize this agent for your specific business needs in less than 48 hours.
Get This Agent