I want users to describe a picture (or send a photo to edit) and get the image back in Telegram. How do I set that up?
AI & Knowledge Base
October 04, 2026
How do I make my bot generate or edit images with AI?
Best answer
Use the AI Agent node in Image mode, then send the result with a Message node.
1. Create an image preset
Go to Settings → AI → Presets, create a preset with Preset Type set to Image, and choose the image model. Add an instruction if you want a fixed style.
2. Build the flow
- A Message node asks: "Describe the image you want, or send a photo to edit."
- An AI Agent node with Mode: Image, your image preset, and Input Last user message (or Wait for user message).
- A Message node with an image card whose source is From variable → AI image (last generated).
- Connect the AI Agent's On error output to a short message, for example "I couldn't create this image, try describing it differently."
How input works
- Text only — draws a new image.
- Photo + text — edits the photo using the text.
- Photo only — edits the photo using the preset's instruction.
- Users can refine step by step ("make it ginger", "add a hat"). The tags #edit and #new let them choose between refining the previous image and drawing a new one. Refining the previous image needs an OpenAI image preset.
Cost and storage
Images use your plan's AI tokens. For example, one medium-quality square image is about 108,000 tokens and a low-quality one is about 32,000. Images made in test mode are free. Generated images are kept for 35 days.
Learn more: AI Agent node, Image mode.
Your answer
You need to log in to ask a question.
Log in