8
n8n 中文网amn8n.com

使用 APImage 生成 AI 图像并上传至 Google Drive

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 8 个节点。主要使用 FormTrigger, GoogleDrive, HttpRequest 等节点。 使用 APImage 生成 AI 图像并上传至 Google Drive

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "cba9e349b601c19a1409b9fd06680aff0a77829be13c8aad9a858d4cea7ff290",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e67847ce-f519-45a3-bba6-380af6cdd648",
      "name": "下载图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        96,
        64
      ],
      "parameters": {
        "url": "={{ $json.images[0] }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "generated_image"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e380ad74-2cc6-4d1e-ae30-d1fca03cb39e",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -208
      ],
      "parameters": {
        "width": 976,
        "height": 252,
        "content": "## ✨ 如何开始"
      },
      "typeVersion": 1
    },
    {
      "id": "9ea17920-9c28-4d21-9f48-e64193fec34e",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        256
      ],
      "parameters": {
        "width": 480,
        "height": 304,
        "content": "### 📤 选择您的目的地"
      },
      "typeVersion": 1
    },
    {
      "id": "82a45985-c85e-404e-b202-6344d34c933c",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        256
      ],
      "parameters": {
        "width": 480,
        "height": 304,
        "content": "### 🧩 选择您的输入"
      },
      "typeVersion": 1
    },
    {
      "id": "b48797c6-7c96-4e9a-827b-d05c435dbe13",
      "name": "APImage API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -128,
        64
      ],
      "parameters": {
        "url": "https://apimage.org/api/ai-image-generate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"prompt\": \"{{ $json['Describe the image you want'] }}\",\n  \"dimensions\": \"{{ $json['Dimensions'] }}\",\n  \"model\": \"{{ $json['AI Model'] }}\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3d77e24e-cf80-4ace-9a58-faa4dd3a4f09",
      "name": "生成图像",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -352,
        64
      ],
      "webhookId": "b7487db2-4581-4fd6-b4e0-afac3d8466fb",
      "parameters": {
        "options": {},
        "formTitle": "APImage AI Image Generator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Describe the image you want",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Dimensions",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Square"
                  },
                  {
                    "option": "Landscape"
                  },
                  {
                    "option": "Portrait"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "AI Model",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Basic"
                  },
                  {
                    "option": "Premium"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "formDescription": "Generate images in seconds"
      },
      "typeVersion": 2.2
    },
    {
      "id": "1a9c4e5a-b223-4c71-98b6-d88306cc974a",
      "name": "上传文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        320,
        64
      ],
      "parameters": {
        "name": "generated_image",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        },
        "inputDataFieldName": "generated_image"
      },
      "typeVersion": 3
    },
    {
      "id": "358d7fe8-6e82-4e77-a7e4-788e94b79e40",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        640
      ],
      "parameters": {
        "color": 7,
        "width": 672,
        "height": 352,
        "content": "### 🐞 调试支持"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "APImage API": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "APImage API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 内容创作, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量8
分类2
节点类型4
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Gegenfeld

Gegenfeld

@gegenfeld

We at Gegenfeld are an EdTech platform dedicated to delivering high-quality on-demand courses and interactive training sessions for professional development at all skill levels. With our commitment to "Accelerate your future," we empower professionals to enhance their expertise through engaging, industry-focused learning experiences. On n8n, we share some of the workflows used in our interactive training to provide deeper insights and practical applications.

外部链接
在 n8n.io 查看

分享此工作流