Skip to main content

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

Workflow preview

Workflow preview
100%
Enhance & expand Telegram images to 3:2 with CodeFormer & LightX AI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Automatically enhance and expand Telegram images with AI This n8n workflow turns your Telegram bot into a powerful AI photo enhancer! Whether users send a photo or a link , it processes the imag...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegram, n8n-nodes-base.set, n8n-nodes-base.awss3, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.wait, n8n-nodes-base.splitinbatches, n8n-nodes-base.merge

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Vadym Nahornyi.

Original n8n.io source

1.1 Workflow description

Title
Enhance & expand Telegram images to 3:2 with CodeFormer & LightX AI
Workflow name
Enhance & expand Telegram images to 3:2 with CodeFormer & LightX AI

πŸš€ Automatically enhance and expand Telegram images with AI

This n8n workflow turns your Telegram bot into a powerful AI photo enhancer!
Whether users send a photo or a link, it processes the image by:

  1. πŸ“₯ Receiving the input (photo or link)
  2. 🧠 Upscaling quality using Replicate's CodeFormer
  3. πŸ“ Analyzing image dimensions and calculating paddings to fit the 3:2 ratio
  4. πŸ–ΌοΈ Expanding the image contextually with LightX AI
  5. ☁️ Uploading the result to S3
  6. πŸ”— Sending back a public URL to the user in Telegram

πŸ‘₯ Who is it for?

  • Telegram bot creators
  • Content creators & photographers
  • SMM pros looking to quickly polish user images
  • AI enthusiasts who want plug-and-play image workflows

πŸ› οΈ Setup Requirements

  • A Telegram bot (via @BotFather)
  • AWS S3 Bucket (public)
  • Replicate API key
  • LightX API key

πŸ”§ How to customize

  • Add custom prompts or ratio in JavaScript node
  • Connect to other AI tools for filters or style transfer
  • Switch storage destination (e.g. Google Drive or Dropbox)

πŸ’‘ Tips

  • Works great in photo-related communities
  • Can be used for virtual try-ons, image recovery or thumbnail generation

🌍 Languages

The main sticky note can be localized β€” feel free to swap it for your audience!


1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Send Final URL to User via Telegram

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 2 - Generate Public URL for Final Image

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Upload Final Photo to S1

Type / Role
n8n-nodes-base.awsS3 - awsS3
Config choices
Version 2

Block 4 - Download Final Photo from LightX

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Generate Output Filename (.jpeg) Final

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Check If Expansion Is Complete

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 7 - Check LightX Expansion Status

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Wait Before Checking Status Again

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 9 - Iterate Until Expansion is Ready

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 10 - Request AI Expansion from LightX

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 11 - Upload File to LightX via PUT

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 12 - Merge Data for Upload

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 13 - Extract Upload Link from LightX Response

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Request Upload Link from LightX

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - Get File Size (in Bytes)

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Calculate Padding for 3:2 Ratio

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Download Upscaled Image from Replicate1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 18 - Wait After Upscale

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 19 - AI Upscale Image via Replicate

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 20 - Generate Output File Name (.png)

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 21 - Set Input URL for AI Model

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 22 - Generate Public URL for Original Image

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 23 - Upload Original Photo to S1

Type / Role
n8n-nodes-base.awsS3 - awsS3
Config choices
Version 2

Block 24 - Generate Input File Name (.jpeg)

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Showing the first 24 of 35 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Enhance & expand Telegram images to 3:2 with CodeFormer & LightX AI
Complexity advanced
Nodes 35
Categories Content Creation, Multimodal AI
Author Vadym Nahornyi
Published 26 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6497/6497.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Enhance & expand Telegram images to 3:2 with CodeFormer & LightX AI do?

Automatically enhance and expand Telegram images with AI This n8n workflow turns your Telegram bot into a powerful AI photo enhancer! Whether users send a photo or a link , it processes the imag...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.