Latenode

Automate AI image generation and share on Telegram

This n8n workflow automates the generation of custom images using AI models like Gemini or ChatGPT. Users can trigger the workflow by sending a chat message, which prompts the system to generate an image based on the message content.

The generated image is then saved to local storage and optionally shared on a communication platform like Telegram. This workflow is designed for users who need to create a variety of visual content, such as marketing materials, character art, or daily image generation, in a streamlined and automated fashion.

Updated Apr 6, 2026Est. run: 12sEst. cost: $0.038
How Latenode estimates time and cost

Latenode bills workflow runs in credits: 1 credit = 30 seconds of processing. Minimum charge per run depends on your plan. 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 credits work →
Video, audio & media

Workflow preview

What this template does

  • Generates custom images based on user prompts using AI models like Gemini or ChatGPT
  • Saves generated images to local storage for further use
  • Optionally shares the generated images on communication platforms like Telegram
  • Streamlines the creation of visual content for marketing, character art, or daily image generation
  • Delivers a personalized visual asset for each user prompt

How it works

1
Trigger

Trigger: Receive Telegram Message

The workflow is triggered when a user sends a message in a Telegram chat. The message content will be used to generate a custom image.

2
AI

Generate Image: Use ChatGPT

The message text is passed to the ChatGPT AI model, which generates a custom image based on the input. The generated image data is extracted from the ChatGPT response.

3
Action

Process Image: Extract and Save

The generated image data is extracted from the ChatGPT response and saved to local storage on the system.

4
Action

Send to Telegram: Upload Generated Image

The generated image is uploaded to the Telegram chat, allowing the user to view and share the custom-generated content.

Setup guide

1

Connect Telegram Credentials

1. In the Latenode Credentials panel, add a new Telegram credential. Enter your Telegram bot token and chat ID. This allows the workflow to receive and respond to messages in the Telegram chat.

2

Configure Pollinations.ai Connection

1. In the Latenode Credentials panel, add a new Pollinations.ai credential. Enter your Pollinations.ai API endpoint and API key. This allows the workflow to securely communicate with the Pollinations.ai API to generate images.

3

Set Image Generation Parameters

1. In the 'Fields - Set Values' node, update the 'width' and 'height' fields to your desired image dimensions. The default is 1080 x 1920 pixels. 2. In the 'AI Agent - Create Image From Prompt' node, select the AI model you want to use for image generation (e.g., 'flux').

4

Customize the Generated Image Filename

1. In the 'Code - Set Filename' node, update the logic to generate a unique filename for each generated image. You can use the current date, a hash of the input prompt, or any other relevant information to create a meaningful filename.

5

Review and Customize the Workflow

1. Inspect the other nodes in the workflow, such as the 'Code - Clean Json' and 'Code - Get Prompt' nodes, to ensure they align with your requirements. 2. Test the workflow by sending a message to your Telegram bot and verifying that the image is generated and saved as expected.

Requirements

Obtain an API key or access token for the Gemini or ChatGPT AI models to generate images based on user prompts
Set up a Telegram bot and obtain the bot token to share the generated images on a Telegram channel or group
Configure the n8n workflow to have access to the Gemini or ChatGPT API and the Telegram bot token
Ensure the n8n workflow has permission to read and write files to a designated local storage location where the generated images will be saved

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.

More templates

You might also like

Browse all templates →
Video, audio & media

Automate YouTube video uploads from Google Drive with AI metadata

This automation streamlines the process of uploading videos to YouTube, including transcription, metadata generation, and automatic publishing. It monitors a Google Drive folder for new video files, uses AI tools to generate optimized titles, descriptions, and tags, and then uploads the videos to a YouTube channel with the generated metadata. This solution targets content creators, marketing teams, and channel managers who want to automate the repetitive and time-consuming task of manual video uploads and metadata creation.

26s$0.0703
Video, audio & media

Sync new Google Drive videos to your YouTube channel

This automation template is designed to help users who need to regularly upload video content to YouTube. By monitoring a designated Google Drive folder for new video files, the automation will automatically upload those files to the user's connected YouTube channel as soon as they are added. This streamlines the content publishing process, saving time and ensuring timely updates to the YouTube channel.

Ns$0.0703
Video, audio & media

Automatically sync YouTube videos to cloud storage and extract transcripts

This automation template enables users to automatically extract transcripts and metadata from newly uploaded YouTube videos. It integrates with the ParsePrompt service to parse the video content and save the structured data to a designated destination, such as a cloud storage service or a database. This solution is designed for content creators, video producers, and marketing teams who need to efficiently manage and analyze their video assets. By automating the transcript and metadata extraction process, it streamlines video production workflows and ensures that valuable insights from video content are readily available for further analysis and utilization.

26s$0.0703