Latenode

Automate AI image generation and share on Telegram

This template listens for Telegram bot messages, asks ChatGPT to turn the text into an image prompt, generates the picture with OpenAI Image Generation, and sends the photo back in the same chat. Put the bot token on the Telegram connection. ChatGPT and image generation are Latenode AI steps, so you do not paste an OpenAI key.

Updated Sep 16, 2026Est. run: 20sEst. cost: $0.0013
How Latenode estimates time and cost

Latenode bills workflow runtime in CPU seconds. The first 10,000 CPU seconds are free each month, then usage follows pay-as-you-go CPU-second pricing. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how CPU seconds work →

Workflow preview

What this template does

  • Turns a Telegram message into a generated image in the same chat
  • Writes a stronger prompt with ChatGPT
  • Renders the still with OpenAI Image Generation
  • Keeps the bot token on the Telegram connection

How it works

1
Trigger

Listen for Telegram prompts

The scenario starts when the bot receives a text message. JavaScript reads that prompt.

2
AI

Write the image prompt

ChatGPT turns that message into a clear image prompt. ChatGPT is Latenode AI, so you do not paste an OpenAI key.

3
AI

Generate the image

OpenAI Image Generation renders a still picture from that prompt.

4
Action

Send the photo

Telegram sends the generated file back to the same chat.

Setup guide

1

Connect Telegram

Add a Telegram connection with your bot token. Add the bot to the chat that will send prompts.

2

Set the trigger

Add a Telegram trigger for new updates. Keep text messages that should become images.

3

Add ChatGPT and image generation

In JavaScript, read the Telegram text. Ask ChatGPT to rewrite it as an image prompt, then generate the picture with OpenAI Image Generation. ChatGPT and image generation are Latenode AI nodes.

4

Send the photo back

Send the generated file as a Telegram photo. Map the chat id from the trigger. Send a test prompt and confirm the picture returns in chat.

Requirements

A Telegram bot token stored on the Telegram connection
A chat the bot can read and send photos to
A text prompt in the Telegram message

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work. Plug-and-Play AI nodes are billed separately.