Nodes/ComfyUI-TelegramSender/Telegram: Send Image Album
ComfyUI Node

Telegram: Send Image Album

Batch your image drops

By smbdsbrain·Created 3 months ago·Updated 3 months ago· 0
Telegram: Send Image Album
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
    caption
    send_as_phototrue
    send_as_documentfalse

    Once you've got Telegram: Send Image in one workflow, you want it in all of them - and then you hit the awkward bit: you've got five outputs and you really don't want five separate messages spamming the chat, one per render. Telegram: Send Image Album is the tidy version. It collects up to ten image sources and drops them as a single Telegram album (sendMediaGroup), so your grid of variations arrives as one swipeable message instead of a wall of notifications.

    It's the same pack, same credentials, same idea - the node exists to replace a dozen Telegram: Send Image nodes with one. If your workflow fans out into several outputs (different seeds, different upscalers, a before/after pair), this is the one you reach for.

    How it works

    It's a straightforward gather-and-send. Each of the optional image_1 through image_10 inputs takes an IMAGE tensor, and any of them may itself be a batch - all frames get flattened in order into one list. Then it calls Telegram's sendMediaGroup, which has a hard cap of 10 media per album, so anything larger is automatically split into multiple albums. If only one image ends up connected, it gracefully degrades to a plain single sendPhoto / sendDocument instead of building a one-item album.

    In document mode it embeds the ComfyUI workflow metadata into each PNG, exactly like the single-image node - so the whole album is round-trippable back into ComfyUI. The caption lands on the first item of the first album only; Telegram won't repeat it per media.

    The inputs that matter

    • image_1image_10 (all optional IMAGE) - wire up to ten image sources. Unconnected inputs are simply ignored, so you can leave holes.
    • caption (STRING, multiline) - the message text, attached to the first item of the first album.
    • send_as_photo (boolean, default True) - sends the collection as a photo album. Preview-friendly, but Telegram recompresses and strips metadata.
    • send_as_document (boolean, default False) - sends as a document album of PNGs with the workflow metadata preserved.

    No outputs - it's an output node, so it ends the workflow.

    Installing it

    ComfyUI Manager, search "TelegramSender". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/smbdsbrain/ComfyUI-TelegramSender
    

    In ComfyUI's Python environment:

    pip install requests
    

    imageio / imageio-ffmpeg from the pack README are only needed by the video nodes - for images, requests alone is the real dependency. Restart ComfyUI, node under utils/telegram.

    Credentials are shared across the pack, first match wins: ComfyUI Settings → Telegram Sender → Credentials (recommended), a telegram_config.json next to the node, or TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_ID env vars. Bot token from @BotFather; chat ID numeric or @channel.

    Troubleshooting

    • Got two albums instead of one - both toggles are doing work: send_as_photo and send_as_document each fire their own sendMediaGroup. Keep one. (The defaults - photo on, document off - are actually sane here, unlike the single-image node.)
    • More than 10 images - you get multiple albums, split automatically. That's Telegram's rule, not a bug.
    • Caption missing from later items - expected. Telegram only shows it on the first media of an album.
    • "bot_token and/or chat_id not specified" - the usual pack credential error; check the Settings page.

    The video equivalent - same gather-into-album shape, but for VIDEO outputs - is Telegram: Send Video Album.

    Categoryutils/telegram

    Inputs (13)

    NameTypeDefaultDescription
    captionSTRING
    send_as_photoBOOLEANtrue
    send_as_documentBOOLEANfalse
    image_1optIMAGE
    image_2optIMAGE
    image_3optIMAGE
    image_4optIMAGE
    image_5optIMAGE
    image_6optIMAGE
    image_7optIMAGE
    image_8optIMAGE
    image_9optIMAGE
    image_10optIMAGE

    Outputs (0)

    No outputs