n8n+GPT 5.2 识图(多张)

javascript 复制代码
{
  "name": "GPT-5.2 识图",
  "nodes": [
    {
      "parameters": {
        "options": {
          "allowFileUploads": true
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.4,
      "position": [
        0,
        0
      ],
      "id": "29f2fd5b-4deb-4fe9-84d0-7c96565f62c5",
      "name": "When chat message received",
      "webhookId": "54d098b0-5cb5-490d-9a7f-23756cd8dbff"
    },
    {
      "parameters": {
        "jsCode": "let arr = []\n \nfor (const item of $input.all()) {\n  if (Array.isArray(item.json.files) && item.json.files.length > 0) {\n    for(let i = 0; i < item.json.files.length; i++) {\n      arr.push({\n        json: { ...item.json }, \n        binary:  { data: item.binary['data'+ i] } \n      })\n    }\n  }\n}\nreturn arr"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        208,
        0
      ],
      "id": "24451d55-afe4-42e8-82a4-bbbaf6731e05",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-5.2",
          "mode": "list",
          "cachedResultName": "GPT-5.2"
        },
        "responses": {
          "values": [
            {
              "content": "={{ $json.chatInput }}"
            },
            {
              "type": "image",
              "imageType": "base64"
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        416,
        0
      ],
      "id": "7017d4f0-dbae-4389-8682-c6720c576f3f",
      "name": "Message a model",
      "credentials": {
        "openAiApi": {
          "id": "2NGP0rW0STRYkHov",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "let arr = []\nlet text = ''\nfor (const item of $input.all()) {\n  item.json.myNewField = 1;\n  console.log('第二个', item)\n  arr.push(item.json.output[0].content[0].text)\n  \n}\ntext = arr.join('\\n\\n\\n')\nreturn [{\n  json: {\n    text\n  }\n}]"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        768,
        0
      ],
      "id": "01f054ea-053d-4148-9bb5-525ee4aa4de1",
      "name": "Code in JavaScript1"
    }
  ],
  "pinData": {},
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        []
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "af4799b0-9fda-4488-a65e-4f95da6dd97a",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "e6d562a11669b4d2f353eafef58b0a2d41d2839326a8b4201a24f4610bf43de1"
  },
  "id": "iYWtZAPJsOaeb9mH",
  "tags": []
}
javascript 复制代码
let arr = []
 
for (const item of $input.all()) {
  if (Array.isArray(item.json.files) && item.json.files.length > 0) {
    for(let i = 0; i < item.json.files.length; i++) {
      arr.push({
        json: { ...item.json }, 
        binary:  { data: item.binary['data'+ i] } 
      })
    }
  }
}
return arr
javascript 复制代码
let arr = []
let text = ''
for (const item of $input.all()) {
  item.json.myNewField = 1;
  console.log('第二个', item)
  arr.push(item.json.output[0].content[0].text)
  
}
text = arr.join('\n\n\n')
return [{
  json: {
    text
  }
}]

图片内容解析如下:

  • 主体:一位黄色海绵状的卡通角色(《海绵宝宝》风格),方形身体、表面有绿色圆点孔洞。
  • 表情与姿态:大眼睛(蓝色瞳孔)、张嘴大笑,露出两颗门牙,整体神情非常开心;站立姿势,双手自然下垂。
  • 服装:白色短袖衬衫、红色领带、棕色短裤;白色长袜(带彩色条纹)、黑色皮鞋。
  • 背景:深紫色背景,中间有一个浅蓝色圆形作为衬底。
  • 风格:清晰线条的二维矢量/卡通插画,色彩饱和度高。

如果你想要我进一步做 OCR识别文字、提取主色、描述构图或生成类似风格提示词,也可以告诉我。

这张图片内容解析如下:

  • 主体:一只白/银白色的猫咪(近景特写),圆脸、大眼睛,正对镜头注视,表情显得很专注/好奇。
  • 姿势:趴在桌面或垫子上,前爪收在身前。
  • 佩戴物 :脖子上系着红色绳子项圈 ,下面挂着一个金色小挂件(像小铃铛/小饰物)。
  • 环境 :室内场景,背景是木质家具/雕花木门,整体色调偏暖。
  • 前景/桌面 :猫趴在一块红色花纹织物(类似桌布/地毯)上,花纹较繁复。
  • 构图与风格:镜头很近,猫脸占画面大部分;焦点在眼睛和鼻子,背景略虚化,突出萌感与细节。

如果你想要更具体的解析(比如判断更像哪种猫、画面色彩/光线参数、或帮你写配文/标题),告诉我你的用途即可

参考链接

https://chat.xutongbao.top/n8n/

相关推荐
周周爱喝粥呀19 小时前
LLM 中的自回归模型与非自回归模型:GPT 和 BERT 的区别
人工智能·gpt·ai·回归
共绩算力19 小时前
DeepSeek V3.2 迈向 GPT-5 级别性能的路径:稀疏注意力、大规模强化学习与上下文重用
人工智能·gpt·共绩算力
百***243719 小时前
GPT-5.2 vs DeepSeek-V3.2 全维度对比:一步API适配下的研发选型指南
gpt
百***243720 小时前
GPT-5.2与DeepSeek-V3.2选型指南:一步API通用下的全维度技术对比
gpt
维度攻城狮20 小时前
科研提速!Zotero Awesome GPT 搭配本地 Ollama 模型使用指南
gpt·zotero·ollama·awesome gpt
victory04312 天前
同一prompt下 doubao qwen gpt kimi的模型训练时长预测不同表现
gpt·prompt
向量引擎3 天前
【万字硬核】解密GPT-5.2-Pro与Sora2底层架构:从Transformer到世界模型,手撸一个高并发AI中台(附Python源码+压测报告)
人工智能·gpt·ai·aigc·ai编程·ai写作·api调用
程序员佳佳3 天前
【万字硬核】从GPT-5.2到Sora2:深度解构多模态大模型的“物理直觉”与Python全栈落地指南(内含Banana2实测)
开发语言·python·gpt·chatgpt·ai作画·aigc·api
向量引擎4 天前
[架构师级] 压榨GPT-5.2与Sora 2的极限性能:从单体调用到高并发多模态Agent集群的演进之路(附全套Python源码与性能调优方案)
开发语言·人工智能·python·gpt·ai·ai写作·api调用
workflower4 天前
Gpt 5 mini自动识别用例
gpt·测试用例·集成测试·需求分析·软件需求·结对编程