Latenode

AI-powered image generation and workflow automation

This n8n automation workflow allows users to create AI-generated images by integrating with Gemini or ChatGPT. The workflow is triggered by a chat message, which is then processed to extract the image prompt.

The prompt is sent to the AI model, and the resulting image is formatted and either sent back to the chat or saved locally. The workflow supports customization of the image size and AI model used. This automation simplifies the process of creating custom AI-generated images, making it accessible to a wide range of users without requiring advanced technical skills.

Updated Apr 2, 2026Est. run: 22sEst. cost: $0.0014
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

  • Extracts image prompts from chat messages
  • Sends prompts to Gemini or ChatGPT AI models
  • Formats and saves the generated images
  • Sends the images to a designated communication or storage platform
  • Allows customization of image size and AI model

How it works

1
Trigger

Trigger: Telegram Chat Message

The workflow is triggered by a new chat message on a Telegram channel or group.

2
Logic

Extract Image Prompt

The chat message is parsed to extract the user's image generation prompt. This prompt is cleaned and formatted to prepare it for the AI model.

3
AI

Generate Image with AI

The formatted prompt is sent to the chosen AI model (Gemini or ChatGPT) to generate the requested image.

4
Action

Save or Send Image

The generated image is assigned a unique filename and either saved to a local storage or sent back to the Telegram chat, depending on the user's preference.

Setup guide

1

Add Telegram Credentials

Add your Telegram bot API credentials in the Latenode Credentials panel. This allows the Telegram Trigger node to listen for incoming messages.

2

Configure Telegram Trigger Node

In the Latenode visual builder, add a Telegram Trigger node and select the Telegram credential you added in the previous step. This will set up the trigger to listen for new messages from users.

3

Configure AI Image Generation Node

Add a Google Gemini Chat Model node to your workflow. In the node settings, provide the API credentials for the Google Gemini service. You can also customize the image size and AI model to use for image generation.

4

Map Input and Output

In the Latenode builder, map the chat message input from the Telegram Trigger node to the prompt input of the Google Gemini Chat Model node. Then, map the resulting image output to either the Telegram Response node (to send the image back to the user) or a Save Image to Disk node (to save the image locally).

5

Test and Deploy

Test your workflow by sending a message to your Telegram bot. Verify that the AI-generated image is correctly sent back to the chat or saved to the local filesystem. Once you're satisfied, deploy your Latenode workflow to start automating AI image creation for your users.

Requirements

OpenAI API key with permission to generate images
Gemini or ChatGPT integration configured in n8n
Telegram bot token and chat ID to send generated images (if Telegram is used)
Storage service integration (e.g., cloud storage, local file system) to save generated images

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

Automatically upload YouTube videos with AI-generated metadata

This workflow automates the process of uploading videos to YouTube, including generating optimized metadata such as titles, descriptions, and tags using AI-powered analysis of video transcripts. It monitors a designated Google Drive folder for new video uploads, automatically retrieves the videos, uploads them to YouTube, and applies the generated metadata without manual intervention. The workflow is designed for content creators, marketing teams, and channel managers who want a simple, hands-off solution to upload videos and automatically generate optimized metadata.

15s$0.0009
Video, audio & media

Automate Google Drive to YouTube video publishing

This automation allows users to easily upload new videos from their Google Drive folders to their YouTube channel. It works by monitoring a specified Google Drive folder for any new video files, and then automatically uploading those files to the user's connected YouTube channel. This integration simplifies the process of sharing video content across the two platforms, saving users time and effort. The key steps involved are: 1) Detecting new video files in a Google Drive folder, and 2) Uploading those files to the user's YouTube channel with the option to customize metadata like title and description.

7s$0.0004
Video, audio & media

Automatically sync new YouTube channel videos to an RSS feed

This automation allows users to monitor a specific YouTube channel for new video uploads and automatically generate an RSS feed containing the video details. The feed can then be used in feed readers or other automation tools to stay up-to-date on the latest content from the YouTube channel. The workflow involves a 'New Video in Channel' trigger that watches for new videos, and a 'Create Item in Feed' action that generates a new feed item with the video's title, description, and source URL. This integration leverages YouTube and Zapier's RSS functionality to provide a convenient way for users to track and distribute their YouTube channel's content.

9s$0.0006