8
n8n 中文网amn8n.com

自动化图像元数据标记(社区节点)

中级

这是一个AI领域的自动化工作流,包含 7 个节点。主要使用 Merge, GoogleDrive, ExifData, OpenAi, GoogleDriveTrigger 等节点,结合人工智能技术实现智能自动化。 自动化AI图像标记并将关键词写入图像(通过社区节点)

前置要求
  • Google Drive API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "4nBQyhwqDqmXY2AL",
  "meta": {
    "instanceId": "558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a",
    "templateCredsSetupCompleted": true
  },
  "name": "自动化图像元数据标记(社区节点)",
  "tags": [],
  "nodes": [
    {
      "id": "b0b030f5-8a8c-4254-bc18-a2790748248e",
      "name": "触发器:Google Drive 文件夹新增文件",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -760,
        120
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1WaIRWXcaeNViKmpW5IyQ3YGARWYdMg47",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1WaIRWXcaeNViKmpW5IyQ3YGARWYdMg47",
          "cachedResultName": "EXIF"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "L47XiMFzcjUgBp2i",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1df51279-b3bd-49bd-9711-951eb4164290",
      "name": "下载图像文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -540,
        120
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "L47XiMFzcjUgBp2i",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "50a59e8e-ca95-4594-b8a9-0ba709795d42",
      "name": "分析图像内容",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -340,
        200
      ],
      "parameters": {
        "text": "=Deliver a comma separated list describing the content of this image.",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "id": "niikB3HA4fT5WAqt",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "456164cc-ed41-4482-adb4-4ed00682153d",
      "name": "合并元数据和图像文件",
      "type": "n8n-nodes-base.merge",
      "position": [
        -140,
        120
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3
    },
    {
      "id": "ddd6aef5-4dae-48e3-a806-3c58adea6552",
      "name": "将元数据写入图像",
      "type": "n8n-nodes-exif-data.exifData",
      "position": [
        40,
        120
      ],
      "parameters": {
        "options": {},
        "operation": "write",
        "exifMetadata": {
          "metadataValues": [
            {
              "name": "Subject",
              "value": "={{$json.content}}"
            },
            {
              "name": "Keywords",
              "value": "={{$json.content}}"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9c531288-7fca-4cca-9717-6dd059266f47",
      "name": "更新图像文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        220,
        120
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Download Image File').item.json.id }}"
        },
        "options": {},
        "operation": "update",
        "changeFileContent": true,
        "newUpdatedFileName": "={{ $('Download Image File').item.json.name }}"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "L47XiMFzcjUgBp2i",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "70b6bb63-fedf-42eb-a6a0-30faae883f2c",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        320
      ],
      "parameters": {
        "width": 660,
        "height": 680,
        "content": "# 欢迎使用我的自动化图像元数据标记工作流!"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c4d1520b-6df4-4e76-98ba-4d7555aec35d",
  "connections": {
    "Download Image File": {
      "main": [
        [
          {
            "node": "Analyze Image Content",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Metadata and Image File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Image Content": {
      "main": [
        [
          {
            "node": "Merge Metadata and Image File",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Write Metadata into Image": {
      "main": [
        [
          {
            "node": "Update Image File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Metadata and Image File": {
      "main": [
        [
          {
            "node": "Write Metadata into Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger: New file added to Google Drive Folder": {
      "main": [
        [
          {
            "node": "Download Image File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能

需要付费吗?

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

工作流信息
难度等级
中级
节点数量7
分类1
节点类型6
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流