Convierte imágenes normales en fotos y videos impresionantes

Avanzado

Este es unDesign, AI, Marketingflujo de automatización del dominio deautomatización que contiene 20 nodos.Utiliza principalmente nodos como Wait, Telegram, HttpRequest, ConvertToFile, TelegramTrigger, combinando tecnología de inteligencia artificial para lograr automatización inteligente. Convierte fotos normales en fotos y videos impresionantes

Requisitos previos
  • Bot Token de Telegram
  • Pueden requerirse credenciales de autenticación para la API de destino
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "meta": {
    "instanceId": "e5aa7986ab694604988fd614f16d3dd8cb275c306d75d6a818e14c909713473c"
  },
  "nodes": [
    {
      "id": "0db7b2f0-dfb2-4c92-98c8-d5eb27ca54f3",
      "name": "Telegram Bot Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -280,
        380
      ],
      "webhookId": "ab3c5adb-2300-4fcc-9d5c-7402e7456415",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {
          "download": true
        }
      },
      "description": "Listens for incoming messages with images from a Telegram bot",
      "typeVersion": 1.2
    },
    {
      "id": "434d739e-54d7-4f75-955f-e1181ff23db8",
      "name": "Documentación de Inicio del Flujo de Trabajo",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        -20
      ],
      "parameters": {
        "width": 400,
        "height": 560,
        "content": "## 📱 Telegram Message Trigger\n\nThis workflow begins when your Telegram bot receives a message containing an image. The bot waits for users to send a photo with a caption that describes desired edits.\n\n### Requirements:\n- A configured Telegram bot token\n- Images must be sent with a descriptive caption\n- The bot must have permission to download files\n\n### Output:\n- Complete message object with photo data\n- Caption text (used as prompt for AI editing)"
      },
      "typeVersion": 1
    },
    {
      "id": "dc5ddb08-76b8-4a1f-a2fb-315c64199157",
      "name": "Descripción General del Flujo de Trabajo",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        -220
      ],
      "parameters": {
        "color": 3,
        "width": 400,
        "height": 560,
        "content": "## 🖼️ Image Processing Pipeline\n\nThis workflow demonstrates a complete AI image processing pipeline:\n\n1. Receives images via Telegram\n2. Edits them with OpenAI's image editing API\n3. Sends the edited result back to user\n4. Optionally generates variations with Replicate\n\n### Use Cases:\n- Product mockups\n- Creative photo editing\n- AI-assisted design iterations\n- Custom image transformations"
      },
      "typeVersion": 1
    },
    {
      "id": "b4682f5b-4c6e-4ba0-a40b-c2851c64bfef",
      "name": "OpenAI API Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        -240
      ],
      "parameters": {
        "color": 3,
        "width": 340,
        "height": 680,
        "content": "## 🎨 OpenAI Image Editing API\n\nSends the image to OpenAI with the caption as a prompt for AI-based editing.\n\n### Configuration:\n- Model: `gpt-image-1`\n- Format: `multipart/form-data`\n- Quality: Low (faster, cheaper)\n- Size: 1024x1024 (standard)\n\n### Input Parameters:\n- `image`: Binary file from Telegram\n- `prompt`: Caption from user message\n- Optional parameters: quality, size, n (number of variations)\n\n### Authentication:\n- Requires OpenAI API key configured in n8n credentials"
      },
      "typeVersion": 1
    },
    {
      "id": "a7266711-bee5-40a2-afc2-86affd226abc",
      "name": "Documentación de Conversión",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -120
      ],
      "parameters": {
        "color": 4,
        "width": 380,
        "height": 580,
        "content": "## 📤 File Format Conversion\n\nConverts the base64-encoded image from OpenAI into a proper binary file format for sending back to the user.\n\n### Technical Details:\n- Transforms API response JSON to binary\n- Source: `data[0].b64_json` field\n- Converts to PNG image format\n- Preserves image quality and metadata\n\n### Output:\n- Binary image data ready for transmission\n- MIME type: image/png"
      },
      "typeVersion": 1
    },
    {
      "id": "f651bd6f-dc2f-4d60-b896-2c860ef0673f",
      "name": "Editar Imagen (OpenAI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        160,
        280
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/images/edits",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "image",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "prompt",
              "value": "={{ $json.message.caption }}"
            },
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "n",
              "value": "1"
            },
            {
              "name": "size",
              "value": "1024x1024"
            },
            {
              "name": "quality",
              "value": "low"
            }
          ]
        },
        "nodeCredentialType": "openAiApi"
      },
      "credentials": {
        "openAiApi": {
          "id": "10eOcgAxufRENylm",
          "name": "OpenAi account"
        }
      },
      "description": "Sends image to OpenAI for AI-powered editing based on the caption",
      "typeVersion": 4.2
    },
    {
      "id": "8e50ff8a-6c4b-486e-9307-9624fc7ff274",
      "name": "Convertir a Imagen Binaria",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        580,
        280
      ],
      "parameters": {
        "options": {
          "fileName": "edited_image.png",
          "mimeType": "image/png"
        },
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json"
      },
      "description": "Converts base64 encoded image to binary format for sending",
      "typeVersion": 1.1
    },
    {
      "id": "e8096804-b5a7-4f2f-943b-e4a5db0929fb",
      "name": "Enviar Imagen Editada",
      "type": "n8n-nodes-base.telegram",
      "position": [
        880,
        740
      ],
      "webhookId": "6d8b80b6-8450-49c9-98dc-0f34e14da588",
      "parameters": {
        "chatId": "={{ $json.message.chat.id }}",
        "operation": "sendPhoto",
        "binaryData": true,
        "additionalFields": {
          "caption": "Here's your edited image! ✨"
        }
      },
      "description": "Sends the edited image back to the user via Telegram",
      "typeVersion": 1.2
    },
    {
      "id": "d33a7637-4046-40a9-90e6-6d8b8fc2f4b6",
      "name": "Replicate Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1460,
        120
      ],
      "parameters": {
        "color": 2,
        "width": 400,
        "height": 700,
        "content": "## 🧠 Replicate AI Image Generation\n\nUses Replicate's API to create additional AI-generated variations of the image.\n\n### Technical Details:\n- Model: pixverse/pixverse-v4\n- Uses image URL from Telegram's file storage\n- Applies custom prompt enhancing the original image\n\n### Authentication:\n- Requires Replicate API token\n- Handles asynchronous process with polling\n\n### Input:\n- Original image URL from Telegram\n- Enhanced prompt for creative direction"
      },
      "typeVersion": 1
    },
    {
      "id": "d0894342-ab6a-473c-9ad0-667987801a9f",
      "name": "Documentación del Nodo de Espera",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        180
      ],
      "parameters": {
        "color": 6,
        "width": 280,
        "height": 600,
        "content": "## ⏱️ Polling Mechanism\n\nWaits for Replicate to process the image generation request.\n\n### Configuration:\n- 45 second wait time\n- Allows asynchronous API to complete processing\n- Prevents timeout errors\n\n### Alternative Options:\n- Could be replaced with polling HTTP requests\n- Webhook can be used if supported by the API"
      },
      "typeVersion": 1
    },
    {
      "id": "5f0417a3-7682-481c-b642-c2b45142839e",
      "name": "Documentación de Recuperación de Archivos",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        -40
      ],
      "parameters": {
        "color": 5,
        "width": 340,
        "height": 560,
        "content": "## 📡 File Retrieval System\n\nRetrieves the file path from Telegram's servers to generate a direct URL.\n\n### Technical Details:\n- Uses Telegram Bot API's getFile endpoint\n- Extracts file_id from the received photo\n- Generates a URL that Replicate can access\n\n### Security Note:\n- Bot token is exposed in the URL\n- Consider using environment variables\n- Limited lifetime access to the file"
      },
      "typeVersion": 1
    },
    {
      "id": "906ba4d2-445c-477f-8732-be7e9d828ba0",
      "name": "Generar Variación (Replicate)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1620,
        640
      ],
      "parameters": {
        "url": "https://api.replicate.com/v1/models/pixverse/pixverse-v4/predictions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"input\": {\n    \"prompt\": \"{{ $json.message.caption || 'a creative enhancement of this image' }}\",\n    \"quality\": \"720p\",\n    \"image\": \"https://api.telegram.org/file/bot{{$credentials.telegramBot.botToken}}/{{ $json.result.file_path }}\"\n}}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{$credentials.replicateApi.apiKey}}"
            }
          ]
        }
      },
      "description": "Sends the original image to Replicate for AI-powered variation",
      "typeVersion": 4.2
    },
    {
      "id": "ab244f36-31e3-4dea-9c8e-e4935335810a",
      "name": "Recuperar Imagen Generada",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2540,
        840
      ],
      "parameters": {
        "url": "={{ $json.urls.get }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{$credentials.replicateApi.apiKey}}"
            }
          ]
        }
      },
      "description": "Gets the final generated image from Replicate after processing",
      "typeVersion": 4.2
    },
    {
      "id": "fee42f2b-09d2-47f9-842a-52139e8c8de6",
      "name": "Enviar Imagen de Variación",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2740,
        280
      ],
      "webhookId": "c2af49c2-2c87-4020-928a-ce18f14e557f",
      "parameters": {
        "file": "={{ $json.output }}",
        "chatId": "={{ $json.message.chat.id }}",
        "operation": "sendDocument",
        "additionalFields": {
          "caption": "Here's an AI-generated variation of your image! 🚀"
        }
      },
      "description": "Sends the AI-generated variation back to the user",
      "typeVersion": 1.2
    },
    {
      "id": "93c43617-3c40-451f-b3b5-eb1d276db1ba",
      "name": "Obtener Ruta del Archivo",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1220,
        340
      ],
      "parameters": {
        "url": "https://api.telegram.org/bot{{$credentials.telegramBot.botToken}}/getFile",
        "options": {},
        "jsonBody": "={\n  \"file_id\": \"{{ $json.result.photo[0].file_id }}\"\n}\n",
        "sendBody": true,
        "specifyBody": "json"
      },
      "description": "Retrieves the file path from Telegram's servers",
      "typeVersion": 4.2
    },
    {
      "id": "71391d58-693a-4c6e-9180-a7b5819bdd3f",
      "name": "Esperar Procesamiento",
      "type": "n8n-nodes-base.wait",
      "position": [
        2080,
        600
      ],
      "webhookId": "eb746bd1-bead-4d9c-b5d5-6c1a1b605c20",
      "parameters": {
        "amount": 45
      },
      "description": "Waits for Replicate to complete the image generation (45 seconds)",
      "typeVersion": 1.1
    },
    {
      "id": "736f5bc9-3785-486d-a93a-d6e9cbd5e45b",
      "name": "Documentación de Configuración",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        380
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 400,
        "content": "## 📝 Setup Instructions\n\n1. Configure credentials:\n   - OpenAI API key\n   - Telegram Bot token\n   - Replicate API key\n\n2. Update the chat IDs to match your Telegram users/groups\n\n3. Test the workflow by sending an image with caption to your bot\n\n4. Optional: Adjust prompts and parameters to customize the AI behavior"
      },
      "typeVersion": 1
    },
    {
      "id": "2873e80c-d160-4bbc-88e7-89097adaa0bd",
      "name": "Nota: Enviar Salida de Replicate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        20
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 440,
        "content": "### Telegram: Send Replicate Output\n\nSends the final video generated by Replicate back to the user via Telegram as a document.\n\n**Note:** The `Chat ID` is dynamically pulled from the trigger node (`={{ $json.message.chat.id }}`).\n"
      },
      "typeVersion": 1
    },
    {
      "id": "65e13c0b-cf11-4c15-8de4-a6633e621a43",
      "name": "Nota: Obtener Resultado de Replicate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2420,
        580
      ],
      "parameters": {
        "color": 7,
        "width": 360,
        "height": 400,
        "content": "### Replicate API: Get Result\n\nPeriodically (after the wait) calls the URL provided by Replicate for the prediction result. This node downloads the final video output.\n\n**Note:** Replace `{{ $env[\"REPLICATE_API_TOKEN\"] }}` with your actual Replicate API token. The `Response Format` is set to `Base64` to prepare the output for sending via Telegram.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d6f4bd9c-6016-45a1-9318-c37aa5786e34",
      "name": "Nota: Enviar Imagen Editada",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        500
      ],
      "parameters": {
        "color": 6,
        "width": 280,
        "height": 380,
        "content": "### Telegram: Send Edited Image\n\nSends the image edited by OpenAI back to the user who triggered the workflow.\n\n**Note:** The `Chat ID` is dynamically pulled from the trigger node (`={{ $json.message.chat.id }}`).\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "93c43617-3c40-451f-b3b5-eb1d276db1ba": {
      "main": [
        [
          {
            "node": "906ba4d2-445c-477f-8732-be7e9d828ba0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e8096804-b5a7-4f2f-943b-e4a5db0929fb": {
      "main": [
        [
          {
            "node": "93c43617-3c40-451f-b3b5-eb1d276db1ba",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f651bd6f-dc2f-4d60-b896-2c860ef0673f": {
      "main": [
        [
          {
            "node": "8e50ff8a-6c4b-486e-9307-9624fc7ff274",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "71391d58-693a-4c6e-9180-a7b5819bdd3f": {
      "main": [
        [
          {
            "node": "ab244f36-31e3-4dea-9c8e-e4935335810a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0db7b2f0-dfb2-4c92-98c8-d5eb27ca54f3": {
      "main": [
        [
          {
            "node": "f651bd6f-dc2f-4d60-b896-2c860ef0673f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8e50ff8a-6c4b-486e-9307-9624fc7ff274": {
      "main": [
        [
          {
            "node": "e8096804-b5a7-4f2f-943b-e4a5db0929fb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ab244f36-31e3-4dea-9c8e-e4935335810a": {
      "main": [
        [
          {
            "node": "fee42f2b-09d2-47f9-842a-52139e8c8de6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "906ba4d2-445c-477f-8732-be7e9d828ba0": {
      "main": [
        [
          {
            "node": "71391d58-693a-4c6e-9180-a7b5819bdd3f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Diseño, Inteligencia Artificial, Marketing

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos20
Categoría3
Tipos de nodos6
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Autor

AI & Automation Consultant. Sharing cool stuff on my YouTube Channel

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34