Nodes/ComfyUI Telegram Suite/Edit Message Caption 🔽
ComfyUI Node

Edit Message Caption 🔽

Rewrite the caption on a Telegram message you already sent

By SwissCore92·Created about a year ago·Updated 2 months ago· 9
Edit Message Caption 🔽
  • bot
  • trigger
  • message
  • message_id
  • trigger
chat_id
message_id
caption
parse_mode
show_caption_above_mediafalse

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 the message_id output 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_id that 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 - MarkdownV2 is strict: it requires escaping characters like _, *, [, ]. If your caption has underscores, None or HTML is the less painful default.
  • If the caption input looks greyed out, double-check message_id is actually wired - it's a forceInput socket, not a widget you type into.
CategoryTelegram Suite 🔽/edit

Inputs (7)

NameTypeDefaultDescription
botTELEGRAM_BOTTelegram bot instance
chat_idINTUnique identifier for the target chat
message_idINTUnique Identifier of the message to edit
captionSTRINGMedia caption, 0-1024 characters after entities parsing
parse_modeCOMBOMode for parsing entities in the photo caption. See https://core.telegram.org/bots/api#formatting-options for more details.
show_caption_above_mediaBOOLEANfalsePass True, if the caption must be shown above the message media
triggeropt*

Outputs (3)

NameTypeDescription
messageDICT
message_idINT
trigger*