news 2026/4/3 2:47:22

用 Dify 工作流 + Coze 插件 Doubao-Seedream-4.0 做一个完整的工作流

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
用 Dify 工作流 + Coze 插件 Doubao-Seedream-4.0 做一个完整的工作流

摘要

本文介绍了一个基于Coze平台的完整工作流程,包含四个关键节点:1)通过触发器启动流程;2)使用Doubao-Seedream-4.0进行数据处理;3)利用LLM将结果转换为Markdown格式;4)最终输出结果。工作流支持图片/文本输入,通过OCR和内容优化处理后生成图文内容,最终以结构化Markdown格式呈现。文中提供了YAML配置文件示例,并强调合理设置触发器和统一输出格式的重要性,以提高自动化处理效率。

完整工作流

Start(上传图片 / 文本) ↓ LLM OCR + 文字优化 ↓ generateImage(Doubao-Seedream-4.0) ↓ LLM Markdown 文章生成 ↓ Answer(展示 Markdown)

在这个节点中,我们开始创建一个新的工作流。首先需要选择工作流的名称和描述,为整个流程设定一个清晰的目标。

提示:命名规范可以帮助团队更快理解工作流的用途。


第一步节点:配置触发器

配置触发器是工作流的关键步骤。触发器决定了何时启动工作流,例如新文件上传、定时任务或手动执行。

优化建议:合理选择触发器类型可以避免不必要的资源浪费。


第二步节点:添加处理逻辑

在此节点中,使用Doubao-Seedream-4.0处理数据,例如生成内容、分析信息或进行自动化操作。

提示:可以通过 Coze 插件增强节点的智能处理能力,提高效率。


第三步节点: LLM 处理成 markdown 格式

此节点负责将处理后的结果输出到指定位置,如数据库、文件系统或通知系统。

优化建议:确保输出格式统一,并根据需要选择合适的输出渠道。


第四步节点:结果输出

输出内复。

完整的 yaml (另存.yaml 导入)

app: description:''icon: 🤖 icon_background:'#FFEAD5'mode: advanced-chat name: Coze Text2Image Plugin Test use_icon_as_answer_icon:falsedependencies: - current_identifier: null type: marketplace value: marketplace_plugin_unique_identifier: langgenius/ollama:0.1.1@f3a8b649027d1bd13e67df96f3463a601c16628da4292705528d28d97d96b263 version: null kind: app version:0.5.0 workflow: conversation_variables:[]environment_variables:[]features: file_upload: allowed_file_extensions: - .JPG - .JPEG - .PNG - .GIF - .WEBP - .SVG allowed_file_types: - image allowed_file_upload_methods: - local_file - remote_url enabled:falsefileUploadConfig: audio_file_size_limit:50batch_count_limit:5file_size_limit:15image_file_batch_limit:10image_file_size_limit:10single_chunk_attachment_limit:10video_file_size_limit:100workflow_file_upload_limit:10image: enabled:falsenumber_limits:3transfer_methods: - local_file - remote_url number_limits:3opening_statement:''retriever_resource: enabled:truesensitive_word_avoidance: enabled:falsespeech_to_text: enabled:falsesuggested_questions:[]suggested_questions_after_answer: enabled:falsetext_to_speech: enabled:falselanguage:''voice:''graph: edges: - data: isInLoop:falsesourceType: start targetType: llm id:1755656337314-source-1769495277758-target source:'1755656337314'sourceHandle:sourcetarget:'1769495277758'targetHandle: target type: custom zIndex:0- data: isInLoop:falsesourceType: llm targetType: tool id:1769495277758-source-1769480385192-target source:'1769495277758'sourceHandle:sourcetarget:'1769480385192'targetHandle: target type: custom zIndex:0- data: isInLoop:falsesourceType: tool targetType: llm id:1769480385192-source-1769496917956-target source:'1769480385192'sourceHandle:sourcetarget:'1769496917956'targetHandle: target type: custom zIndex:0- data: isInLoop:falsesourceType: llm targetType: answer id:1769496917956-source-1769495850925-target source:'1769496917956'sourceHandle:sourcetarget:'1769495850925'targetHandle: target type: custom zIndex:0nodes: - data: desc:''selected:truetitle: Start type: start variables:[]height:73id:'1755656337314'position: x:80y:282positionAbsolute: x:80y:282selected:truesourcePosition: right targetPosition: left type: custom width:242- data: context: enabled:falsevariable_selector:[]model: completion_params: temperature:0.7mode: chat name: qwen2.5 provider: langgenius/ollama/ollama prompt_template: - id: 5eab9d56-5a08-44d9-ae08-abf4db6a79b7 role: system text:'请从下面的{{#1769480385192.text#}}文本中提取出所有链接(以 http:// 或 https:// 开头), 然后将每个链接转换成 Markdown 图片格式显示: ![图片](链接)'selected:falsestructured_output_enabled:truetitle: LLM2type: llm vision: enabled:falseheight:88id:'1769496917956'position: x:827.3613552326078y: -45.29221663684261 positionAbsolute: x:827.3613552326078y: -45.29221663684261 selected:falsesourcePosition: right targetPosition: left type: custom width:242- data: is_team_authorization:trueparamSchemas: - auto_generate: null default: null form: llm human_description: en_US:1表示单图,2-10 表示生成一组相关联的图,最大支持10,数量越大速度越慢, default value is1ja_JP:1表示单图,2-10 表示生成一组相关联的图,最大支持10,数量越大速度越慢, default value is1pt_BR:1表示单图,2-10 表示生成一组相关联的图,最大支持10,数量越大速度越慢, default value is1zh_Hans:1表示单图,2-10 表示生成一组相关联的图,最大支持10,数量越大速度越慢, default value is1label: en_US: max_images ja_JP: max_images pt_BR: max_images zh_Hans: max_images llm_description:1表示单图,2-10 表示生成一组相关联的图,最大支持10,数量越大速度越慢, default value is1max: null min: null name: max_images options:[]placeholder: null precision: null required:falsescope: null template: null type: number - auto_generate: null default: null form: llm human_description: en_US: 用于生成图像的提示词,支持中英文。 建议不超过300个汉字或600个英文单词。字数过多信息容易分散,模型可能因此忽略细节,只关注重点,造成视图片缺失部分元素。 ja_JP: 用于生成图像的提示词,支持中英文。 建议不超过300个汉字或600个英文单词。字数过多信息容易分散,模型可能因此忽略细节,只关注重点,造成视图片缺失部分元素。 pt_BR: 用于生成图像的提示词,支持中英文。 建议不超过300个汉字或600个英文单词。字数过多信息容易分散,模型可能因此忽略细节,只关注重点,造成视图片缺失部分元素。 zh_Hans: 用于生成图像的提示词,支持中英文。 建议不超过300个汉字或600个英文单词。字数过多信息容易分散,模型可能因此忽略细节,只关注重点,造成视图片缺失部分元素。 label: en_US: prompt ja_JP: prompt pt_BR: prompt zh_Hans: prompt llm_description: 用于生成图像的提示词,支持中英文。 建议不超过300个汉字或600个英文单词。字数过多信息容易分散,模型可能因此忽略细节,只关注重点,造成视图片缺失部分元素。 max: null min: null name: prompt options:[]placeholder: null precision: null required:truescope: null template: null type: string - auto_generate: null default: null form: llm human_description: en_US: 参考图 ja_JP: 参考图 pt_BR: 参考图 zh_Hans: 参考图 input_schema: description: 参考图 items: type: string type: array label: en_US: reference_images ja_JP: reference_images pt_BR: reference_images zh_Hans: reference_images llm_description: 参考图 max: null min: null name: reference_images options:[]placeholder: null precision: null required:falsescope: null template: null type: array - auto_generate: null default: null form: llm human_description: en_US: 方式1:指定生成图像的分辨率,并在prompt中用自然语言描述图片宽高比、图片形状或图片用途,最终由模型判断生成图片的大小。 可选值:1K、2K、4K 方式2:指定生成图像的宽高像素值: 默认值:2048x2048 取值范围:[1024x1024, 4096x4096]ja_JP: 方式1:指定生成图像的分辨率,并在prompt中用自然语言描述图片宽高比、图片形状或图片用途,最终由模型判断生成图片的大小。 可选值:1K、2K、4K 方式2:指定生成图像的宽高像素值: 默认值:2048x2048 取值范围:[1024x1024, 4096x4096]pt_BR: 方式1:指定生成图像的分辨率,并在prompt中用自然语言描述图片宽高比、图片形状或图片用途,最终由模型判断生成图片的大小。 可选值:1K、2K、4K 方式2:指定生成图像的宽高像素值: 默认值:2048x2048 取值范围:[1024x1024, 4096x4096]zh_Hans: 方式1:指定生成图像的分辨率,并在prompt中用自然语言描述图片宽高比、图片形状或图片用途,最终由模型判断生成图片的大小。 可选值:1K、2K、4K 方式2:指定生成图像的宽高像素值: 默认值:2048x2048 取值范围:[1024x1024, 4096x4096]label: en_US: size ja_JP: size pt_BR: size zh_Hans: size llm_description: 方式1:指定生成图像的分辨率,并在prompt中用自然语言描述图片宽高比、图片形状或图片用途,最终由模型判断生成图片的大小。 可选值:1K、2K、4K 方式2:指定生成图像的宽高像素值: 默认值:2048x2048 取值范围:[1024x1024, 4096x4096]max: null min: null name: size options:[]placeholder: null precision: null required:falsescope: null template: null type: string - auto_generate: null default: null form: llm human_description: en_US: 是否在生成的图片中添加水印。, default value istrueja_JP: 是否在生成的图片中添加水印。, default value istruept_BR: 是否在生成的图片中添加水印。, default value istruezh_Hans: 是否在生成的图片中添加水印。, default value istruelabel: en_US: watermark ja_JP: watermark pt_BR: watermark zh_Hans: watermark llm_description: 是否在生成的图片中添加水印。, default value istruemax: null min: null name: watermark options:[]placeholder: null precision: null required:falsescope: null template: null type: boolean params: max_images:''prompt:''reference_images:''size:''watermark:''plugin_id:''plugin_unique_identifier:''provider_icon: background:'#FFEAD5'content: grinning provider_id:'7548380026094370867'provider_name: Doubao-Seedream-4.0 provider_type: mcp selected:falsetitle: generateImage tool_configurations:{}tool_description: 图像生成 tool_label: generateImage tool_name: generateImage tool_node_version:'2'tool_parameters: max_images: type: constant value:1prompt: type: mixed value:'{{#1769495277758.structured_output.final_prompt#}}'reference_images: type: constant value: null size: type: mixed value: 4K watermark: type: constant value:falsetype: tool height:84id:'1769480385192'position: x:563.2831793982236y:134.86430588045243positionAbsolute: x:563.2831793982236y:134.86430588045243selected:falsesourcePosition: right targetPosition: left type: custom width:242- data: context: enabled:truevariable_selector: - sys - query model: completion_params: temperature:0.7mode: chat name: qwen2.5 provider: langgenius/ollama/ollama prompt_template: - id: 66068b00-39af-4f8a-b867-f37778cfc044 role: system text:'你是电影概念设计师。 请将{{#sys.query#}}整理为适合图像生成的高质量提示词, 强调构图、光影、风格,不要输出解释说明。'selected:falsestructured_output: schema: additionalProperties:falseproperties: final_prompt: type: string required:[]type: object structured_output_enabled:truetitle: LLM type: llm vision: enabled:falseheight:88id:'1769495277758'position: x:350y:230.5positionAbsolute: x:350y:230.5selected:falsesourcePosition: right targetPosition: left type: custom width:242- data: answer:'{{#1769496917956.text#}}'selected:falsetitle: 直接回复 type: answer variables:[]height:103id:'1769495850925'position: x:1157.3912308238766y:26.85806320276197positionAbsolute: x:1157.3912308238766y:26.85806320276197selected:falsesourcePosition: right targetPosition: left type: custom width:242viewport: x:138.16956106507644y:224.18796478896266zoom:0.387152569163775rag_pipeline_variables:[]

图片生成工具请参考
Dify 结合 Coze MCP 工具实现智能图片生成:完整教程

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/3/28 8:08:49

金蝶的云转型赌局,终于赢在了最后一秒?

这一刻,等得太久了。长达五年的漫长亏损,终于要结束了。 日前,金蝶国际发布了备受瞩目的2025财年业绩预告,归母净利润预估在0.6亿到1亿之间。这份财报对于金蝶最大的意义,并不是盈利了多少,而是终于扭亏为…

作者头像 李华
网站建设 2026/3/28 9:25:31

全链路·工业级·强联动!物联网智慧城市实训平台,重塑职教实训新生态

01产品概述物联网智慧城市综合实训平台是一款集教学、实训、科研于一体的综合性实训系统,主要面向物联网工程技术、智能控制、工业互联网等专业领域。该平台平台以智慧城市场景仿真实训为核心,通过高度仿真的城市环境模拟,深度融合物联网、大…

作者头像 李华
网站建设 2026/3/25 7:02:40

AI大模型应用开发- 入门基础数学

聚焦 AI 学习中 “用得到、能看懂、可实操” 的基础数学知识点,不深入公式推导,重点讲 “在 AI 里有啥用 怎么用 Python 落地”。一、 加减乘除(AI 里的 “数据计算基本功”)核心作用AI 中最基础的运算,比如数据预处理…

作者头像 李华
网站建设 2026/2/21 21:08:36

基于Springboot+Vue的健康菜谱生成系统源码文档部署文档代码讲解等

课题介绍 本课题聚焦基于SpringBootVue前后端分离架构的健康菜谱生成系统设计与实现,针对性解决大众饮食中营养搭配失衡、菜谱同质化严重、无法适配个性化需求(忌口、体质、饮食目标)、食材利用低效等核心痛点,构建集智能菜谱生成…

作者头像 李华
网站建设 2026/4/1 21:42:46

vue2 瀑布流 组件

该源码来自 uviewpro 地址为&#xff1a;https://uviewpro.cn/zh/components/waterfall.html 我改成vue2的写法 优化了计时器 瀑布流插件 <template><div class"waterfull"><div class"left" ref"leftRef"><slot name&q…

作者头像 李华
网站建设 2026/3/14 9:35:57

删除 地址栏 地址里的 某个的参数 无感刷新页面

const url new URL(window.location.href);url.searchParams.delete(abc);window.history.replaceState(null, , url.toString());意思就是 删除 地址栏 地址里的 abc的参数www.666.com?abc123删完之后 就是 www.666.com这段代码的作用就是 在不刷新页面的前提下&#xff0c;…

作者头像 李华