# Enhance & expand Telegram images to 3:2 with LightX AI: n8n workflow

> Started by an incoming Telegram message, and works across S3 and Telegram. 26 steps, 2 branches, 3 loops or waits: large, and worth reading before you trust...

Source: https://millionrounds.com/workflow/enhance-and-expand-telegram-images-to-3-2-with-lightx-ai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Alerts and monitoring](https://millionrounds.com/workflows?category=Alerts+and+monitoring#library)

# Enhance & expand Telegram images to 3:2 with LightX AI

Started by an incoming Telegram message, and works across S3 and Telegram. 26 steps, 2 branches, 3 loops or waits: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fenhance-and-expand-telegram-images-to-3-2-with-lightx-ai)

**26 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**3** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Logic 15 Service 10

The steps in the order they run, from what starts it.

- 1 **Telegram Trigger1** Telegram trigger *Starts it*
- 2 **Check If Photo Exists1** If *Logic*
- 3 **Set Input URL for AI Model** Set *Logic*
- 4 **Generate Input File Name (.jpeg)** Set *Logic*
- 5 **Generate Output File Name (.png)** Set *Logic*
- 6 **Upload Original Photo to S1** Aws S3 *Service*
- 7 **AI Upscale Image via Replicate** Http Request *Service*
- 8 **Generate Public URL for Original Image** Set *Logic*
- 9 **Wait After Upscale** Wait *Logic*
- 10 **Download Upscaled Image from Replicate1** Http Request *Service*
- 11 **Calculate Padding for 3:2 Ratio** Code *Logic*
- 12 **Get File Size (in Bytes)** Code *Logic*
- 13 **Merge Data for Upload** Merge *Logic*
- 14 **Request Upload Link from LightX** Http Request *Service*
- 15 **Upload File to LightX via PUT** Http Request *Service*
- 16 **Extract Upload Link from LightX Response** Set *Logic*
- 17 **Request AI Expansion from LightX** Http Request *Service*
- 18 **Iterate Until Expansion is Ready** Split In Batches *Logic*
- 19 **Wait Before Checking Status Again** Wait *Logic*
- 20 **Check LightX Expansion Status** Http Request *Service*
- 21 **Check If Expansion Is Complete** If *Logic*
- 22 **Generate Output Filename (.jpeg) Final** Set *Logic*
- 23 **Download Final Photo from LightX** Http Request *Service*
- 24 **Upload Final Photo to S1** Aws S3 *Service*
- 25 **Generate Public URL for Final Image** Set *Logic*
- 26 **Send Final URL to User via Telegram** Telegram *Service*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 26, with 2 branches, 3 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** S3, Telegram
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own S3 and Telegram accounts. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 26 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 26 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fenhance-and-expand-telegram-images-to-3-2-with-lightx-ai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[S3](https://millionrounds.com/workflows?service=S3#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**Analyze customer feedback and alert negative sentiment** 26 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/analyze-customer-feedback-and-alert-negative-sentiment)
- [**Score and alert Upwork jobs with OpenAI and Telegram** 26 steps · calls a model · Telegram, n8n data table](https://millionrounds.com/workflow/score-and-alert-upwork-jobs-with-openai-and-telegram)
- [**Monitor Cloudflare incidents and alert with Slack and Telegram** 25 steps · calls a model · Google Sheets, Jira](https://millionrounds.com/workflow/monitor-cloudflare-incidents-and-alert-with-slack-and-telegr)
- [**AI-Powered WhatsApp Business Assistant with Claude** 24 steps · Google Sheets, Slack](https://millionrounds.com/workflow/ai-powered-whatsapp-business-assistant-with-claude)
- [**Daily affirmations & weekly gratitude digest with Notion** 24 steps · Discord, Email](https://millionrounds.com/workflow/daily-affirmations-and-weekly-gratitude-digest-with-notion)
- [**Process Telegram image albums with Data Tables Cache** 28 steps · Telegram, n8n data table](https://millionrounds.com/workflow/process-telegram-image-albums-with-data-tables-cache)
