🎬 Generate AI images in Telegram with GPT-4o enhancement and Flux Pro

⚑ 1,727 views · 🎬 Content Creation & Video

Description

🧠 AI Image Generator Bot β€” Telegram + AI/ML API

This n8n workflow allows users to generate AI-generated images by sending messages to a Telegram bot. Each request is logged in Google Sheets and limited by a daily quota per user. Image prompts are enhanced by LLM before generation.


πŸš€ Features


πŸ›  Setup Guide

1. πŸ“² Create Telegram Bot

2. πŸ” Set Up Credentials in n8n

3. πŸ“— Prepare Google Sheet

 user_id | date | query | result_url

4. πŸ”§ Configure the Workflow


βš™οΈ Flow Summary

NodeFunction
πŸ“© Receive Telegram MessageTriggered by user message
πŸ“Š Fetch Usage LogsReads today’s entries from Sheet
πŸ“ˆ Count Today’s RequestsCounts how many generations today
πŸ”’ Set Daily LimitSets default limit (5)
🚦 Check Limit Exceeded?If over limit β†’ notify
🧠 Enhance PromptUses GPT-4o to improve user’s prompt
🎨 Generate ImageSends to AIMLAPI to generate
πŸ–‹ Describe ImageGenerates caption for the image
πŸ“€ Send Image to UserSends back to Telegram
πŸ“ Log Successful GenerationWrites to Google Sheets

πŸ“ Data Logging

Each successful generation is stored in Google Sheets:

user_iddatequeryresult_url

πŸ’‘ Example Prompt Flow

  1. User sends:

    astronaut cat floating in space
  2. Bot replies:

    > Here’s your image: > A majestic feline astronaut drifts through a glittering cosmic void, its helmet reflecting starlight.

  3. The image is sent with the caption


πŸ”„ Daily Limit


πŸ§ͺ Testing


πŸ“Ž Resources

πŸ”— Nodes Used

Google Sheets, HTTP Request, Telegram, Telegram Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup