Generar imágenes de artículos de marca con GPT-4o, FAL Flux y Google Drive

Avanzado

Este es unContent Creation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 19 nodos.Utiliza principalmente nodos como If, Set, Code, Wait, Merge. Usar GPT-4o, FAL Flux y Google Drive para generar imágenes de artículos de marca

Requisitos previos
  • Credenciales de API de Google Drive
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Clave de API de OpenAI
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": "783d2046f405cc6ecb20ef185376ed1023323a3da628b9d8156b1fb75c75e037",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "001a2632-587f-4cb8-a7a0-0fbd0f1b4f48",
      "name": "Esperar",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1040,
        3648
      ],
      "webhookId": "4023120e-b7d7-4ae5-89e5-fc42b4556910",
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "b0a4dae6-2763-4067-bba2-e9ab0bc6b6b8",
      "name": "Combinar2",
      "type": "n8n-nodes-base.merge",
      "position": [
        -960,
        3968
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "73e8a5fd-2d1e-4d53-9b2d-2b818f9c80e9",
      "name": "redimensionar logo",
      "type": "n8n-nodes-base.editImage",
      "position": [
        -1168,
        4128
      ],
      "parameters": {
        "width": 68.4,
        "height": 52.6,
        "options": {},
        "operation": "resize"
      },
      "typeVersion": 1
    },
    {
      "id": "282ea827-fe38-4f91-886a-993375a1417d",
      "name": "Combinar elementos binarios",
      "type": "n8n-nodes-base.code",
      "position": [
        -720,
        3968
      ],
      "parameters": {
        "jsCode": "const images = $input.all().reduce((acc, item, index) => {\n  acc[`data${index}`] = item.binary.data;\n  return acc;\n}, {});\nreturn [{ json: {}, binary: images }]"
      },
      "typeVersion": 2
    },
    {
      "id": "4b7f2891-54ef-4484-890e-3ee504b87725",
      "name": "Si3",
      "type": "n8n-nodes-base.if",
      "position": [
        -720,
        3648
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "949170ea-a72b-4d90-881c-c18ab99a5800",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "COMPLETED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "956ea698-f008-4fd6-8998-6170ffdb2dfa",
      "name": "Al hacer clic en 'Ejecutar flujo'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2000,
        3648
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3a2dcccc-ab9e-434c-8abe-04b673b36b7e",
      "name": "Enlazar imagen",
      "type": "n8n-nodes-base.set",
      "position": [
        -1808,
        3648
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0b01ca98-98a0-4232-be3b-a0fbc6d9bb52",
              "name": "image_url",
              "type": "string",
              "value": "=https://surecctv.com/uploads/images/2021/07/600x600-1627381898-single_product1-nk1080hir100af.jpg"
            },
            {
              "id": "756cc282-45f1-4e94-a835-9c7ff74b6c21",
              "name": "subject",
              "type": "string",
              "value": "technology"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b89307e1-1e3f-4a4b-a307-dc2f5df6256e",
      "name": "Crear prompt para generar imagen",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1600,
        3648
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Based on the topic: {{ $json.subject }}\n\nCreate an image prompt so I can put it into the Image AI Model to create a sharp, detailed illustration. The image prompt must be under 70 words, sharp and detailed, but no text or logos can be added to the image (Important).\n\nThe size of the article image for the website will be: 800x500 pixels"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "TmPSRVY5JCpWCR5d",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "9f50d697-e11c-4cdb-8834-520d87a3b6f2",
      "name": "generar imagen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1296,
        3648
      ],
      "parameters": {
        "url": "https://queue.fal.run/fal-ai/flux/dev/image-to-image",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"prompt\": \"{{ JSON.stringify($json.message.content).slice(1, -1) }}\",\n  \"image_url\": {{JSON.stringify($('Link image').item.json.image_url)}},\n  \"image_size\": {\n    \"width\": 800,\n    \"height\": 500\n  },\n  \"num_inference_steps\": 45,\n  \"guidance_scale\": 4.5,\n  \"num_images\": 1,\n  \"enable_safety_checker\": true\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Key xxxxx"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dee77768-1f9c-44ab-ad5d-025d34e93325",
      "name": "verificar finalización de imagen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -880,
        3648
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/flux/requests/{{ $json.request_id }}/status",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Key xxxx"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d7fa1e0b-af07-48fa-9120-76ad416a46a1",
      "name": "Obtener enlace de imagen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -528,
        3632
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/flux/requests/{{ $json.request_id }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Key xxxxxx"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b3638dd1-cc34-4361-9129-a5b1fcea8a60",
      "name": "Descargar imagen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1584,
        3952
      ],
      "parameters": {
        "url": "={{ $json.images[0].url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "9492aab5-5c3d-41f7-80db-dd3826d509e4",
      "name": "redimensionar imagen",
      "type": "n8n-nodes-base.editImage",
      "position": [
        -1360,
        3952
      ],
      "parameters": {
        "width": 800,
        "options": {},
        "operation": "resize"
      },
      "typeVersion": 1
    },
    {
      "id": "86ff8705-ed79-467d-9e28-30db0a6e94ff",
      "name": "Obtener logo de la empresa",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1360,
        4128
      ],
      "parameters": {
        "url": "=https://drive.google.com/uc?export=download&id=xxxxx",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "10b80e05-dc55-4cfd-bd59-c3dc90b9ced7",
      "name": "Componer imagen y logo",
      "type": "n8n-nodes-base.editImage",
      "position": [
        -512,
        3968
      ],
      "parameters": {
        "options": {},
        "operation": "composite",
        "positionX": 728,
        "dataPropertyName": "data0",
        "dataPropertyNameComposite": "data1"
      },
      "typeVersion": 1
    },
    {
      "id": "6eb031eb-0500-4574-8a85-d01fa9288582",
      "name": "Guardar en drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -320,
        3968
      ],
      "parameters": {
        "name": "={{ $('Loop Over Items').first().json.ten }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1PlUL4-0iNYSXi4YTeTN8BfsPcqIxrwh5",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1PlUL4-0iNYSXi4YTeTN8BfsPcqIxrwh5",
          "cachedResultName": "image"
        },
        "inputDataFieldName": "data0"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "7ksMk3zwMvT2CToN",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "e7f70628-ac04-4a6b-8f0f-e512a15acb02",
      "name": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2640,
        3568
      ],
      "parameters": {
        "color": 5,
        "width": 528,
        "height": 288,
        "content": "## Workflow Overview\n- **Input:** topic (`subject`) and a reference `image_url`.\n- **Prompting:** GPT-4o creates a <70-word, “no text/logo”> prompt for the image model.\n- **Generation:** HTTP Request → FAL Flux (`/image-to-image`) queues a job and returns `request_id`.\n- **Polling:** `Wait` + `check image finish` loop until `status == COMPLETED`.\n- **Post-process:** Download the image → resize to **800×500** → download logo → resize logo → composite.\n- **Output:** Save the final image to **Google Drive** with a dynamic file name."
      },
      "typeVersion": 1
    },
    {
      "id": "612b71a4-68fd-4ff5-a6f2-7ed682cef523",
      "name": "Nota adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2176,
        4064
      ],
      "parameters": {
        "width": 528,
        "height": 336,
        "content": "## Setup Checklist\n- **OpenAI / GPT-4o:** Connect your OpenAI credentials in the “Create prompt for generate image” node.\n- **FAL API Keys:** Put real keys in BOTH HTTP Request nodes:\n  - `generate image` (POST …/image-to-image)\n  - `check image finish` & `Get image link` (GET …/requests/{id}[ /status ])\n- **Logo Source:** Update the logo URL in **“Get company's logo”** (Google Drive direct download link or any public URL).\n- **Google Drive:** Connect OAuth2 and set the **Folder ID** in **“Save on drive”**.\n- **Filename:** The Drive node uses: `$('Loop Over Items').first().json.ten` → change to your desired name field.\n- **Reference Image:** Update `image_url` in **“Link image”** (or pass it from upstream data).\n"
      },
      "typeVersion": 1
    },
    {
      "id": "242f0e7e-6f45-45f8-abbe-f327201bf378",
      "name": "Nota adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        4144
      ],
      "parameters": {
        "color": 3,
        "width": 528,
        "height": 288,
        "content": "## Notes & Tips\n- **Branding:** `resize logo` and the **Composite** node place the logo at `positionX: 728`. Tweak size/position for your layout.\n- **Polling Interval:** `Wait` node amount is **2** (seconds). Increase if you hit rate limits; decrease for faster checks.\n- **Safety:** The GPT prompt enforces **no text/logos** in the generated image—keep this to avoid artifacts.\n- **Dimensions:** Final canvas is **800×500** (web article hero size). Adjust in `resize image` if your site uses a different aspect ratio.\n- **Error Handling:** If status never becomes `COMPLETED`, add an `If` branch for timeouts or retries.\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "4b7f2891-54ef-4484-890e-3ee504b87725": {
      "main": [
        [
          {
            "node": "d7fa1e0b-af07-48fa-9120-76ad416a46a1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "001a2632-587f-4cb8-a7a0-0fbd0f1b4f48",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "001a2632-587f-4cb8-a7a0-0fbd0f1b4f48": {
      "main": [
        [
          {
            "node": "dee77768-1f9c-44ab-ad5d-025d34e93325",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b0a4dae6-2763-4067-bba2-e9ab0bc6b6b8": {
      "main": [
        [
          {
            "node": "282ea827-fe38-4f91-886a-993375a1417d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3a2dcccc-ab9e-434c-8abe-04b673b36b7e": {
      "main": [
        [
          {
            "node": "b89307e1-1e3f-4a4b-a307-dc2f5df6256e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "73e8a5fd-2d1e-4d53-9b2d-2b818f9c80e9": {
      "main": [
        [
          {
            "node": "b0a4dae6-2763-4067-bba2-e9ab0bc6b6b8",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "9492aab5-5c3d-41f7-80db-dd3826d509e4": {
      "main": [
        [
          {
            "node": "b0a4dae6-2763-4067-bba2-e9ab0bc6b6b8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6eb031eb-0500-4574-8a85-d01fa9288582": {
      "main": [
        []
      ]
    },
    "b3638dd1-cc34-4361-9129-a5b1fcea8a60": {
      "main": [
        [
          {
            "node": "9492aab5-5c3d-41f7-80db-dd3826d509e4",
            "type": "main",
            "index": 0
          },
          {
            "node": "86ff8705-ed79-467d-9e28-30db0a6e94ff",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d7fa1e0b-af07-48fa-9120-76ad416a46a1": {
      "main": [
        [
          {
            "node": "b3638dd1-cc34-4361-9129-a5b1fcea8a60",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9f50d697-e11c-4cdb-8834-520d87a3b6f2": {
      "main": [
        [
          {
            "node": "001a2632-587f-4cb8-a7a0-0fbd0f1b4f48",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "86ff8705-ed79-467d-9e28-30db0a6e94ff": {
      "main": [
        [
          {
            "node": "73e8a5fd-2d1e-4d53-9b2d-2b818f9c80e9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "282ea827-fe38-4f91-886a-993375a1417d": {
      "main": [
        [
          {
            "node": "10b80e05-dc55-4cfd-bd59-c3dc90b9ced7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dee77768-1f9c-44ab-ad5d-025d34e93325": {
      "main": [
        [
          {
            "node": "4b7f2891-54ef-4484-890e-3ee504b87725",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "10b80e05-dc55-4cfd-bd59-c3dc90b9ced7": {
      "main": [
        [
          {
            "node": "6eb031eb-0500-4574-8a85-d01fa9288582",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b89307e1-1e3f-4a4b-a307-dc2f5df6256e": {
      "main": [
        [
          {
            "node": "9f50d697-e11c-4cdb-8834-520d87a3b6f2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "956ea698-f008-4fd6-8998-6170ffdb2dfa": {
      "main": [
        [
          {
            "node": "3a2dcccc-ab9e-434c-8abe-04b673b36b7e",
            "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 - Creación de contenido, IA Multimodal

¿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 nodos19
Categoría2
Tipos de nodos11
Descripción de la dificultad

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

Autor
Cong Nguyen

Cong Nguyen

@cong-nguyen

I’m a developer specialized in building web and mobile applications with AI integration and intelligent automation. With a solid background in data science, I help businesses build smarter digital solutions using cutting-edge technologies.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34