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

  1. βœ… Multi-Modal Input Support

Users can interact using:

Text Voice Images

This makes the bot highly flexible and user-friendly.

  1. βœ… 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.

  1. βœ… 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.

  1. βœ… Asynchronous & Scalable Architecture

The use of:

Webhook callbacks Wait nodes Task polling

Prevents timeouts and supports longer image generation tasks.

  1. βœ… Secure Access Control

The Telegram ID validation ensures:

Only authorized users can access the workflow.

  1. βœ… 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

  1. βœ… 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.

0
Downloads
2
Views
8.64
Quality Score
intermediate
Complexity
Created:2/17/2026
Updated:2/17/2026

πŸ”’ Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments