Generate Images on Telegram π€πΌοΈ from Text and Voice using Grok Imagine & Kie AI
This workflow creates an AI-powered Telegram bot that allows users to generate and modify images using Grok Imagine models via the Kie AI API.
Key Advantages
- β Multi-Modal Input Support
Users can interact using:
Text Voice Images
This makes the bot highly flexible and user-friendly.
- β Intelligent AI Orchestration
Instead of directly calling APIs, the workflow uses an AI agent that:
Understands intent Enhances prompts Chooses the correct tool automatically
This dramatically improves output quality.
- β Fully Automated Image Pipeline
From user input to final image delivery:
Upload Processing Generation Result retrieval Delivery via Telegram
Everything is automated end-to-end.
- β Asynchronous & Scalable Architecture
The use of:
Webhook callbacks Wait nodes Task polling
Prevents timeouts and supports longer image generation tasks.
- β Secure Access Control
The Telegram ID validation ensures:
Only authorized users can access the workflow.
- β Modular & Extendable Design
The workflow is built with:
Tool-based architecture Separate image generation workflows Clear orchestration logic
This makes it easy to extend with:
Video generation Style presets Advanced editing tools Multi-user support
- β Production-Ready Structure
The workflow includes:
Error handling guidelines Structured system prompts Memory handling Clear separation of concerns
This makes it suitable for:
Creative agencies AI SaaS products Marketing automation Telegram-based AI services
How it works
This workflow creates a Telegram bot that uses AI to generate and transform images through Grok Imagine models, with support for text, voice, and image inputs.
Telegram Input Handling: Users interact with the bot by sending messages, voice notes, or images. The workflow authenticates users based on their Telegram ID.
Input Processing: Text messages β Directly sent to the AI agent Voice messages β Transcribed using OpenAI Whisper, then converted to text Images β Downloaded from Telegram, uploaded to an FTP server (BunnyCDN), and the public URL is generated
AI Agent Decision Making: The "Grok Imagine Agent" (powered by Grok 4.1 Fast model) analyzes user input and determines whether to: Generate a new image from text description (text-to-image) Transform an existing image using a prompt (image-to-image)
Tool Execution: The agent calls specialized workflow tools that trigger image generation via Kie.ai API: Text-to-Image: Creates images from text prompts using "grok-imagine/text-to-image" model Image-to-Image: Modifies existing images using "grok-imagine/image-to-image" model
Async Processing: The workflow uses Wait nodes to handle asynchronous image generation, polling Kie.ai for results via task IDs.
Result Delivery: Once images are generated, they're sent back to the user through Telegram messages.
Setup Steps
Telegram Configuration: Create a Telegram Bot via BotFather to get a bot token Add your Telegram user ID in the "Code" node (replace XXX) Configure Telegram credentials in n8n with your bot token
API Credentials: OpenRouter: Sign up at OpenRouter.ai, get API key for Grok 4.1 Fast access Kie.ai: Register at Kie.ai for free API key to access image generation models OpenAI: Set up OpenAI API key for voice transcription (Whisper model)
FTP Server Setup: Configure FTP server (BunnyCDN recommended) for image hosting Update FTP credentials in n8n Set the public URL path in the "Set Image Url" node (replace XXX)
Workflow Configuration: Import the JSON workflow into n8n Update all credential references to match your accounts Verify webhook URLs are properly configured for callback handling Test the workflow and activate when ready
Optional Customizations: Adjust the system prompt in the "Grok Imagine Agent" node for different behavior Modify image aspect ratios or other parameters in the HTTP Request nodes Add additional tools for more functionality
π Subscribe to my new YouTube channel. Here Iβll share videos and Shorts with practical tutorials and FREE templates for n8n.
Need help customizing?
Contact me for consulting and support or add me on Linkedin.
Tags
Related Templates
Track Demo Bookings with Google Calendar to Meta Conversions API Integration
Who is this workflow for? If you're using Meta Ads to generate new leads to your sales pipeline, this workflow is for yo...
Transcribe & Summarize Audio with Whisper and GPT, from Google Drive to Notion
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Overview This work...
Reusable and Independently Testable Sub-workflow
Reusable and Independently Testable Sub-workflow This n8n workflow provides a standardized structure for building and te...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments