简单 OpenAI 图像生成器
初级
这是一个自动化工作流,包含 5 个节点。主要使用 Form, FormTrigger, HttpRequest, ConvertToFile 等节点。 通过用户友好表单使用 OpenAI GPT-Image-1 模型生成图像
前置要求
- •可能需要目标 API 的认证凭证
分类
-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "AqWXpCre4fsPEkAH",
"meta": {
"instanceId": "7dfa146768a036d27a67d125f90ea637bfb301bd4fd25d0086548016421d44bd"
},
"name": "简单OpenAI图像生成器",
"tags": [],
"nodes": [
{
"id": "526c24bc-3bc5-48c3-ae1e-5b0c0352d07f",
"name": "转换为文件",
"type": "n8n-nodes-base.convertToFile",
"position": [
440,
0
],
"parameters": {
"options": {},
"operation": "toBinary",
"sourceProperty": "data[0].b64_json"
},
"typeVersion": 1.1
},
{
"id": "20fdcc11-5e8a-4788-b3a3-e556996b59f7",
"name": "提示和选项",
"type": "n8n-nodes-base.formTrigger",
"position": [
0,
0
],
"webhookId": "b749da3f-836f-4996-a8ee-bc26f8677582",
"parameters": {
"options": {},
"formTitle": "OpenAI Image Generator",
"formFields": {
"values": [
{
"fieldLabel": "Prompt",
"placeholder": "Snow-covered mountain village in the Alps",
"requiredField": true
},
{
"fieldType": "dropdown",
"fieldLabel": "Image size",
"fieldOptions": {
"values": [
{
"option": "1024x1024"
},
{
"option": "1024x1536"
},
{
"option": "1536x1024"
}
]
},
"requiredField": true
}
]
}
},
"typeVersion": 2.2
},
{
"id": "eb220b1f-2091-492a-931f-1f2e344b32a6",
"name": "OpenAI图像生成",
"type": "n8n-nodes-base.httpRequest",
"position": [
220,
0
],
"parameters": {
"url": "https://api.openai.com/v1/images/generations",
"method": "POST",
"options": {},
"sendBody": true,
"sendHeaders": true,
"authentication": "predefinedCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "model",
"value": "gpt-image-1"
},
{
"name": "prompt",
"value": "={{ $json.Prompt }}"
},
{
"name": "n",
"value": "={{ 1 }}"
},
{
"name": "size",
"value": "={{ $json['Image size'] }}"
}
]
},
"nodeCredentialType": "openAiApi"
},
"credentials": {
"openAiApi": {
"id": "x1byAha0t8ltLIeW",
"name": "OpenAi account"
}
},
"typeVersion": 4.2
},
{
"id": "86718927-490e-4d97-9b0c-1118e2ccdcb6",
"name": "返回表单",
"type": "n8n-nodes-base.form",
"position": [
660,
0
],
"webhookId": "745af4a8-ab3c-4267-aa8d-a8998cc534e5",
"parameters": {
"options": {
"formTitle": "Result"
},
"operation": "completion",
"respondWith": "returnBinary",
"completionTitle": "Result",
"completionMessage": "Here is the created image:"
},
"typeVersion": 1
},
{
"id": "a069f63f-139e-4157-a44a-448224f2c119",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-600,
0
],
"parameters": {
"width": 500,
"height": 620,
"content": "# 欢迎使用我的简单OpenAI图像生成器工作流!"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "d2376df0-9c26-4723-9e97-07fc226e7a53",
"connections": {
"526c24bc-3bc5-48c3-ae1e-5b0c0352d07f": {
"main": [
[
{
"node": "86718927-490e-4d97-9b0c-1118e2ccdcb6",
"type": "main",
"index": 0
}
]
]
},
"20fdcc11-5e8a-4788-b3a3-e556996b59f7": {
"main": [
[
{
"node": "eb220b1f-2091-492a-931f-1f2e344b32a6",
"type": "main",
"index": 0
}
]
]
},
"eb220b1f-2091-492a-931f-1f2e344b32a6": {
"main": [
[
{
"node": "526c24bc-3bc5-48c3-ae1e-5b0c0352d07f",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
初级
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
开发完成 - 通过Veo3生成产品广告
使用Google Veo 3、Gemini和Airtable自动化AI视频广告生成
Code
Form
Wait
+
Code
Form
Wait
16 节点Intuz
内容创作
使用 Unipile 和 Google Sheets 自动发送 LinkedIn
使用 Unipile 和 Google Sheets 自动发送 LinkedIn 联系人请求与破冰消息
If
Set
Code
+
If
Set
Code
44 节点PollupAI
其他
通过OpenRouter使用Gemini AI生成时尚模特产品广告
通过OpenRouter使用Gemini AI生成时尚模特产品广告
Set
Code
Form
+
Set
Code
Form
10 节点Zakwan
内容创作
AI营销报告(Google Analytics、Google Ads
AI营销报告(Google Analytics、Google Ads、Meta Ads) - 通过邮件/Telegram发送
Set
Code
Telegram
+
Set
Code
Telegram
51 节点Friedemann Schuetz
营销
自动化图像元数据标记
自动化AI图像标记并将关键词写入图像文件
Code
Merge
Google Drive
+
Code
Merge
Google Drive
9 节点Friedemann Schuetz
人工智能
基于OpenAI的AI发型预览生成器与LINE群组分享
基于OpenAI的AI发型预览生成器与LINE群组分享
Webhook
Form Trigger
Http Request
+
Webhook
Form Trigger
Http Request
8 节点kote2
内容创作