Edit Message Caption 🔽
Rewrite the caption on a Telegram message you already sent
- bot
- trigger
- message
- message_id
- trigger
The image came out great. The caption under it came out wrong - typo, bad prompt echo, or you just changed your mind. Rather than resend the whole message, this node edits just the caption of an existing Telegram message, leaving the media untouched.
It's the lightest node in the ComfyUI Telegram Suite edit family - no file upload at all. Where the other edit nodes replace media, this one only rewrites text. That makes it a nice fit for the "did you mean a different prompt" pattern: keep the same render, fix the words under it.
How it works
It calls Telegram's editMessageCaption API with the bot, chat, message_id, and the new caption text. No media is re-uploaded - the message keeps its position, its media, and its message_id; only the caption changes. parse_mode handles formatting: None, HTML, Markdown, or MarkdownV2, and you can move the caption above the media with show_caption_above_media.
Same two Telegram rules as every edit node: the bot can only edit messages it sent itself, and media-message edits (including their captions) stop working 48 hours after the message was sent. Text-only messages aren't subject to the 48-hour limit, but captions attached to media are.
Inputs and outputs that matter
bot,chat_id- from a Telegram Bot 🔽 node, as with everything in this pack.message_id- the message whose caption you're changing. Usually themessage_idoutput of a Send Image / Send Audio / Send Video node.caption- the new text. Empty string clears the caption.parse_mode- formatting mode for entities.show_caption_above_media- move the caption above the media.
Outputs: message (updated message as DICT), message_id (INT - unchanged by an edit), and a trigger passthrough for execution-order control.
Installation
Same pack-wide install:
cd ComfyUI/custom_nodes
git clone https://github.com/SwissCore92/comfyui-telegram-suite.git
cd comfyui-telegram-suite
pip install -r requirements.txt
or install "ComfyUI Telegram Suite" via ComfyUI Manager and restart. Populate ComfyUI/user/default/telegram-suite/config.json with your bot tokens and chat IDs, restart again. No models, no heavy deps.
Troubleshooting
- "message to edit not found" - wrong bot, wrong chat, or a
message_idthat came from a message this bot didn't send. Edits are scoped to the bot that owns the message. - Captions on media stop editing after ~2 days - the 48-hour media edit window. After that, resend.
- MarkdownV2 not rendering -
MarkdownV2is strict: it requires escaping characters like_,*,[,]. If your caption has underscores,NoneorHTMLis the less painful default. - If the caption input looks greyed out, double-check
message_idis actually wired - it's aforceInputsocket, not a widget you type into.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| bot | TELEGRAM_BOT | Telegram bot instance | |
| chat_id | INT | Unique identifier for the target chat | |
| message_id | INT | Unique Identifier of the message to edit | |
| caption | STRING | Media caption, 0-1024 characters after entities parsing | |
| parse_mode | COMBO | Mode for parsing entities in the photo caption. See https://core.telegram.org/bots/api#formatting-options for more details. | |
| show_caption_above_media | BOOLEAN | false | Pass True, if the caption must be shown above the message media |
| triggeropt | * | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| message | DICT | — |
| message_id | INT | — |
| trigger | * | — |