From 7357618e4efed4d2f00805f9d61a82fd8deacdf0 Mon Sep 17 00:00:00 2001 From: fishwww-ww <2470335462@qq.com> Date: Mon, 13 Oct 2025 17:47:41 +0800 Subject: [PATCH 1/4] feat: doubao seedream text to image plugin --- modules/tool/packages/seedream1/config.ts | 104 ++++++++++++++++++ modules/tool/packages/seedream1/index.ts | 10 ++ modules/tool/packages/seedream1/logo.png | Bin 0 -> 6524 bytes modules/tool/packages/seedream1/package.json | 17 +++ modules/tool/packages/seedream1/src/index.ts | 54 +++++++++ .../packages/seedream1/test/index.test.ts | 8 ++ 6 files changed, 193 insertions(+) create mode 100644 modules/tool/packages/seedream1/config.ts create mode 100644 modules/tool/packages/seedream1/index.ts create mode 100644 modules/tool/packages/seedream1/logo.png create mode 100644 modules/tool/packages/seedream1/package.json create mode 100644 modules/tool/packages/seedream1/src/index.ts create mode 100644 modules/tool/packages/seedream1/test/index.test.ts diff --git a/modules/tool/packages/seedream1/config.ts b/modules/tool/packages/seedream1/config.ts new file mode 100644 index 00000000..c6534b33 --- /dev/null +++ b/modules/tool/packages/seedream1/config.ts @@ -0,0 +1,104 @@ +import { defineTool } from '@tool/type'; +import { FlowNodeInputTypeEnum, WorkflowIOValueTypeEnum } from '@tool/type/fastgpt'; +import { ToolTypeEnum } from '@tool/type/tool'; + +export default defineTool({ + name: { + 'zh-CN': '豆包 Seedream 绘图', + en: 'Seedream Image Generation Model' + }, + courseUrl: 'https://www.volcengine.com/docs/82379/1541523', + type: ToolTypeEnum.multimodal, + description: { + 'zh-CN': '豆包 Seedream 图片生成模型', + en: 'Seedream Image Generation Model' + }, + toolDescription: '豆包Seedream图片生成模型', + secretInputConfig: [ + { + key: 'apiKey', + label: 'API Key', + description: '豆包Seedream图片生成模型', + required: true, + inputType: 'secret' + } + ], + versionList: [ + { + value: '0.1.0', + description: 'Default version', + inputs: [ + { + key: 'modelID', + label: '模型ID', + renderTypeList: [FlowNodeInputTypeEnum.select], + valueType: WorkflowIOValueTypeEnum.string, + description: '模型ID', + toolDescription: '模型ID', + defaultValue: 'doubao-seedream-4-0-250828', + list: [{ label: 'Doubao-Seedream-4.0', value: 'doubao-seedream-4-0-250828' }], + required: true + }, + { + key: 'prompt', + label: '提示词', + renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference], + valueType: WorkflowIOValueTypeEnum.string, + description: '用于生成图像的提示词,支持中英文。', + toolDescription: '用于生成图像的提示词,支持中英文。', + required: true + }, + { + key: 'size', + label: '生成图像的尺寸信息', + renderTypeList: [FlowNodeInputTypeEnum.select], + valueType: WorkflowIOValueTypeEnum.string, + description: '生成图像的尺寸信息', + toolDescription: '生成图像的尺寸信息', + defaultValue: '1:1', + list: [ + { label: '1:1', value: '2048x2048' }, + { label: '4:3', value: '2304x1728' }, + { label: '3:4', value: '1728x2304' }, + { label: '16:9', value: '2560x1440' }, + { label: '9:16', value: '1440x2560' }, + { label: '3:2', value: '2496x1664' }, + { label: '2:3', value: '1664x2496' }, + { label: '21:9', value: '3024x1296' } + ], + required: false + }, + { + key: 'seed', + label: '随机种子', + renderTypeList: [FlowNodeInputTypeEnum.numberInput], + valueType: WorkflowIOValueTypeEnum.number, + description: '随机数种子, 用于控制模型生成内存的随机性', + toolDescription: '随机数种子, 用于控制模型生成内存的随机性', + min: -1, + max: 2147483647, + defaultValue: -1, + required: false + }, + { + key: 'watermark', + label: '水印', + renderTypeList: [FlowNodeInputTypeEnum.switch], + valueType: WorkflowIOValueTypeEnum.boolean, + description: '是否添加水印', + toolDescription: '是否添加水印', + defaultValue: true, + required: false + } + ], + outputs: [ + { + valueType: WorkflowIOValueTypeEnum.string, + key: 'image', + label: '生成的图片', + description: '生成的图片' + } + ] + } + ] +}); diff --git a/modules/tool/packages/seedream1/index.ts b/modules/tool/packages/seedream1/index.ts new file mode 100644 index 00000000..d698ed48 --- /dev/null +++ b/modules/tool/packages/seedream1/index.ts @@ -0,0 +1,10 @@ +import config from './config'; +import { InputType, OutputType, tool as toolCb } from './src'; +import { exportTool } from '@tool/utils/tool'; + +export default exportTool({ + toolCb, + InputType, + OutputType, + config +}); diff --git a/modules/tool/packages/seedream1/logo.png b/modules/tool/packages/seedream1/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a81fdbd7a5aba1774adf60bfae9c2cb72cf386e1 GIT binary patch literal 6524 zcmV-?8H47DP)|2E>hFX6nOU;j1YzAWFm3?}v|-MAh!{+eC&8Z`Y0B>67cwH-J9 znp*l1EBdf-|EX#J8#Mp_{r(g#{TMR-2qN|kChj)nyRL2j3?}*-EBzce{1z|v7c=lU z;l3{1xUOvfrD^`2UH%d*{hng>3nlXgAMzJ3=qcX09WehEF#ZlH{Nw!kj+^XL-ovYE z{|+egL)*MJ=)3Oz{_yns7%KUva`HG!>O9%HWZ}p??!ryoz&q}} z>HYlI`Suem@(w2HUvTE6?&37rxcdD3Y*hHw-1nnu_Q09(ta|aEXYpF!#X0M|^8f$# z`TVD{@x}G;S!(1kMdT$r#p$TA2a2O=+|=N z&OqwON87$P+q(Mm{rBzs$^XU8R@%a@f_}u#U z8#4FL*7n=O_Sn1ju!8Zn^Xg7v<~HHLIN-qg|Np0M|LNKJ-sJbMefQM2^(#2@pQ`b# zxbA3p=^iT$G`r6?4CO7s-MfEy9^~BBe&-wGalJZAd z?kPa+zxC`CJM1t=>sM*%Ekfq0@8u$D<3d&Aob2A0?A<`)%xmGyK<>t!YX6sL{xUoE z%dGXZhxNV1^U3$|nWXK4=hQyW(?QzO_W%Fl&G=kS_+wJ{P)PUR$@Ipg^2ey}I8N<# zh3kiv>KIbxdx+yAbKxurAFFPYspvD`!F%^gwdC3xW~Kiihg82GNF@i39cSn9v80%|fqE@sF)rP5%b;m3`8AZcmhS#X# zSyNMGm^#(4(qm;bJVx83sATv@vZ|TQi6NOMM(f3xF2ny&4YSZd(N}4wEfxNoY?#gG zDB6_P4oioDkR7vDLJ?Ljn7RyuqQ=tg$PQkWyy?g=NUD`3YcYzwej@8@R)c6=`HDA< zM9a0hX?XiSV$j7^j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Hi$3?Wo20J>|f7EH_)7aBCHjiu+}I95fh zt*WjarpyE~uFl^0s`YK&TM3JohFYr|6LIzV>)JbuZv2IqzOLqPbS-!+Vl(sT%lC>! z5)~qHy1c}0$wVSYBgWWb-+1=i#dzAOT0rN5mKvKuWOdPclhf5+y_h@Ie-X8%yu`}V zSn%-6VQeF#7htJz;bEQ4W8v*9Aq$&XyKUfUH!MkttJ_^xkDHe-tY;Z#T~~b-EJakm z%Bx^9+s5Q@1(pz@q3eTZ)4k=L#jw): Promise> { + const url = 'https://ark.cn-beijing.volces.com/api/v3/images/generations'; + + const { data } = await POST( + url, + { + model: modelID, + prompt, + size, + seed, + watermark + }, + { + headers: { + Authorization: `Bearer ${apiKey}`, + 'Content-Type': 'application/json' + } + } + ); + const image_url = data.data[0].url; + if (!image_url) { + return Promise.reject('Failed to generate image'); + } + + return { + image: image_url + }; +} diff --git a/modules/tool/packages/seedream1/test/index.test.ts b/modules/tool/packages/seedream1/test/index.test.ts new file mode 100644 index 00000000..b70e289f --- /dev/null +++ b/modules/tool/packages/seedream1/test/index.test.ts @@ -0,0 +1,8 @@ +import { expect, test } from 'vitest'; +import tool from '..'; + +test(async () => { + expect(tool.name).toBeDefined(); + expect(tool.description).toBeDefined(); + expect(tool.cb).toBeDefined(); +}); From 66dc5e3acc167224f905cc90d512adb4b22fa396 Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Mon, 13 Oct 2025 21:11:34 +0800 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- modules/tool/packages/seedream1/config.ts | 4 ++-- modules/tool/packages/seedream1/src/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/tool/packages/seedream1/config.ts b/modules/tool/packages/seedream1/config.ts index c6534b33..826b85ba 100644 --- a/modules/tool/packages/seedream1/config.ts +++ b/modules/tool/packages/seedream1/config.ts @@ -73,8 +73,8 @@ export default defineTool({ label: '随机种子', renderTypeList: [FlowNodeInputTypeEnum.numberInput], valueType: WorkflowIOValueTypeEnum.number, - description: '随机数种子, 用于控制模型生成内存的随机性', - toolDescription: '随机数种子, 用于控制模型生成内存的随机性', + description: '随机数种子, 用于控制模型生成内容的随机性', + toolDescription: '随机数种子, 用于控制模型生成内容的随机性', min: -1, max: 2147483647, defaultValue: -1, diff --git a/modules/tool/packages/seedream1/src/index.ts b/modules/tool/packages/seedream1/src/index.ts index 16b2ebd3..beb724fb 100644 --- a/modules/tool/packages/seedream1/src/index.ts +++ b/modules/tool/packages/seedream1/src/index.ts @@ -3,7 +3,7 @@ import { POST } from '@tool/utils/request'; export const InputType = z.object({ apiKey: z.string().describe('Doubao Seedream API Key'), - modelID: z.string().nonempty().describe('modal ID'), + modelID: z.string().nonempty().describe('model ID'), prompt: z.string().nonempty().describe('describe the desired image content'), size: z.string().optional().describe('aspect ratio of the generated content'), seed: z.number().optional().describe('Random seed to control the randomness of model generation'), From 098645a35eea7cc01f9b2629bb9deaf67c3bd30b Mon Sep 17 00:00:00 2001 From: fishwww-ww <2470335462@qq.com> Date: Tue, 14 Oct 2025 11:17:59 +0800 Subject: [PATCH 3/4] feat: optimize --- .../{seedream1 => seedream}/config.ts | 19 +++++++++--------- .../packages/{seedream1 => seedream}/index.ts | 0 .../packages/{seedream1 => seedream}/logo.png | Bin .../{seedream1 => seedream}/package.json | 0 .../{seedream1 => seedream}/src/index.ts | 16 ++++++++++----- .../test/index.test.ts | 0 6 files changed, 20 insertions(+), 15 deletions(-) rename modules/tool/packages/{seedream1 => seedream}/config.ts (88%) rename modules/tool/packages/{seedream1 => seedream}/index.ts (100%) rename modules/tool/packages/{seedream1 => seedream}/logo.png (100%) rename modules/tool/packages/{seedream1 => seedream}/package.json (100%) rename modules/tool/packages/{seedream1 => seedream}/src/index.ts (83%) rename modules/tool/packages/{seedream1 => seedream}/test/index.test.ts (100%) diff --git a/modules/tool/packages/seedream1/config.ts b/modules/tool/packages/seedream/config.ts similarity index 88% rename from modules/tool/packages/seedream1/config.ts rename to modules/tool/packages/seedream/config.ts index 826b85ba..2187e9a3 100644 --- a/modules/tool/packages/seedream1/config.ts +++ b/modules/tool/packages/seedream/config.ts @@ -4,21 +4,21 @@ import { ToolTypeEnum } from '@tool/type/tool'; export default defineTool({ name: { - 'zh-CN': '豆包 Seedream 绘图', + 'zh-CN': 'Seedream 4.0 绘图', en: 'Seedream Image Generation Model' }, courseUrl: 'https://www.volcengine.com/docs/82379/1541523', type: ToolTypeEnum.multimodal, description: { - 'zh-CN': '豆包 Seedream 图片生成模型', + 'zh-CN': '豆包 Seedream 4.0 图片生成模型', en: 'Seedream Image Generation Model' }, - toolDescription: '豆包Seedream图片生成模型', + toolDescription: 'Seedream 4.0 图片生成模型', secretInputConfig: [ { key: 'apiKey', label: 'API Key', - description: '豆包Seedream图片生成模型', + description: '豆包Seedream 4.0 图片生成模型', required: true, inputType: 'secret' } @@ -29,12 +29,11 @@ export default defineTool({ description: 'Default version', inputs: [ { - key: 'modelID', - label: '模型ID', + key: 'model', + label: '模型', renderTypeList: [FlowNodeInputTypeEnum.select], valueType: WorkflowIOValueTypeEnum.string, - description: '模型ID', - toolDescription: '模型ID', + description: '模型', defaultValue: 'doubao-seedream-4-0-250828', list: [{ label: 'Doubao-Seedream-4.0', value: 'doubao-seedream-4-0-250828' }], required: true @@ -95,8 +94,8 @@ export default defineTool({ { valueType: WorkflowIOValueTypeEnum.string, key: 'image', - label: '生成的图片', - description: '生成的图片' + label: '生成的图片链接', + description: '生成的图片链接' } ] } diff --git a/modules/tool/packages/seedream1/index.ts b/modules/tool/packages/seedream/index.ts similarity index 100% rename from modules/tool/packages/seedream1/index.ts rename to modules/tool/packages/seedream/index.ts diff --git a/modules/tool/packages/seedream1/logo.png b/modules/tool/packages/seedream/logo.png similarity index 100% rename from modules/tool/packages/seedream1/logo.png rename to modules/tool/packages/seedream/logo.png diff --git a/modules/tool/packages/seedream1/package.json b/modules/tool/packages/seedream/package.json similarity index 100% rename from modules/tool/packages/seedream1/package.json rename to modules/tool/packages/seedream/package.json diff --git a/modules/tool/packages/seedream1/src/index.ts b/modules/tool/packages/seedream/src/index.ts similarity index 83% rename from modules/tool/packages/seedream1/src/index.ts rename to modules/tool/packages/seedream/src/index.ts index beb724fb..cf415511 100644 --- a/modules/tool/packages/seedream1/src/index.ts +++ b/modules/tool/packages/seedream/src/index.ts @@ -3,7 +3,7 @@ import { POST } from '@tool/utils/request'; export const InputType = z.object({ apiKey: z.string().describe('Doubao Seedream API Key'), - modelID: z.string().nonempty().describe('model ID'), + model: z.string().nonempty().describe('model name'), prompt: z.string().nonempty().describe('describe the desired image content'), size: z.string().optional().describe('aspect ratio of the generated content'), seed: z.number().optional().describe('Random seed to control the randomness of model generation'), @@ -17,9 +17,15 @@ export const OutputType = z.object({ image: z.string().describe('generated image URL') }); +type SeedreamResponse = { + data: { + url: string; + }[]; +}; + export async function tool({ apiKey, - modelID, + model, prompt, size, seed, @@ -27,10 +33,10 @@ export async function tool({ }: z.infer): Promise> { const url = 'https://ark.cn-beijing.volces.com/api/v3/images/generations'; - const { data } = await POST( + const { data } = await POST( url, { - model: modelID, + model, prompt, size, seed, @@ -43,7 +49,7 @@ export async function tool({ } } ); - const image_url = data.data[0].url; + const image_url = data?.data?.[0]?.url; if (!image_url) { return Promise.reject('Failed to generate image'); } diff --git a/modules/tool/packages/seedream1/test/index.test.ts b/modules/tool/packages/seedream/test/index.test.ts similarity index 100% rename from modules/tool/packages/seedream1/test/index.test.ts rename to modules/tool/packages/seedream/test/index.test.ts From db5dc877157e4a59d5e085d00e8d307dfce53d51 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Thu, 16 Oct 2025 21:53:23 +0800 Subject: [PATCH 4/4] config --- modules/tool/packages/seedream/config.ts | 15 ++------------- modules/tool/packages/seedream/src/index.ts | 12 +++--------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/modules/tool/packages/seedream/config.ts b/modules/tool/packages/seedream/config.ts index 2187e9a3..0d635809 100644 --- a/modules/tool/packages/seedream/config.ts +++ b/modules/tool/packages/seedream/config.ts @@ -53,7 +53,6 @@ export default defineTool({ renderTypeList: [FlowNodeInputTypeEnum.select], valueType: WorkflowIOValueTypeEnum.string, description: '生成图像的尺寸信息', - toolDescription: '生成图像的尺寸信息', defaultValue: '1:1', list: [ { label: '1:1', value: '2048x2048' }, @@ -73,21 +72,10 @@ export default defineTool({ renderTypeList: [FlowNodeInputTypeEnum.numberInput], valueType: WorkflowIOValueTypeEnum.number, description: '随机数种子, 用于控制模型生成内容的随机性', - toolDescription: '随机数种子, 用于控制模型生成内容的随机性', min: -1, max: 2147483647, defaultValue: -1, required: false - }, - { - key: 'watermark', - label: '水印', - renderTypeList: [FlowNodeInputTypeEnum.switch], - valueType: WorkflowIOValueTypeEnum.boolean, - description: '是否添加水印', - toolDescription: '是否添加水印', - defaultValue: true, - required: false } ], outputs: [ @@ -95,7 +83,8 @@ export default defineTool({ valueType: WorkflowIOValueTypeEnum.string, key: 'image', label: '生成的图片链接', - description: '生成的图片链接' + description: '生成的图片链接', + required: true } ] } diff --git a/modules/tool/packages/seedream/src/index.ts b/modules/tool/packages/seedream/src/index.ts index cf415511..971398dd 100644 --- a/modules/tool/packages/seedream/src/index.ts +++ b/modules/tool/packages/seedream/src/index.ts @@ -6,11 +6,7 @@ export const InputType = z.object({ model: z.string().nonempty().describe('model name'), prompt: z.string().nonempty().describe('describe the desired image content'), size: z.string().optional().describe('aspect ratio of the generated content'), - seed: z.number().optional().describe('Random seed to control the randomness of model generation'), - watermark: z - .boolean() - .optional() - .describe('Whether to add watermark, located at bottom right corner of image') + seed: z.number().optional().describe('Random seed to control the randomness of model generation') }); export const OutputType = z.object({ @@ -28,8 +24,7 @@ export async function tool({ model, prompt, size, - seed, - watermark + seed }: z.infer): Promise> { const url = 'https://ark.cn-beijing.volces.com/api/v3/images/generations'; @@ -39,8 +34,7 @@ export async function tool({ model, prompt, size, - seed, - watermark + seed }, { headers: {