查询工作流详情
curl --request GET \
--url https://www.chenyu.cn/api/open/v2/workflow/market/info \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chenyu.cn/api/open/v2/workflow/market/info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.chenyu.cn/api/open/v2/workflow/market/info', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.chenyu.cn/api/open/v2/workflow/market/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.chenyu.cn/api/open/v2/workflow/market/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.chenyu.cn/api/open/v2/workflow/market/info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chenyu.cn/api/open/v2/workflow/market/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"workflow_id": "<string>",
"revision_id": "<string>",
"title": "<string>",
"description": "<string>",
"tags": [
{}
],
"covers": [
{}
],
"owner": {},
"quote_currency": "<string>",
"quote_amount": "<string>",
"may_incur_external_model_cost": true,
"external_cost_notice": "<string>",
"editable_parameter_manifest": [
{
"name": "<string>",
"display_name": "<string>",
"description": "<string>",
"value_type": "<string>",
"required": true,
"default_value": "<any>",
"ui_schema": {},
"bindings": [
{}
],
"sort_order": 123
}
],
"candidate_output_manifest": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>",
"node_id": "<string>",
"output_key": "<string>",
"file_index": 123,
"history_count": 123,
"sort_order": 123
}
]
}
}工作流市场
查询工作流详情
查询可访问的已发布工作流详情、输入参数清单和输出参数清单
GET
/
api
/
open
/
v2
/
workflow
/
market
/
info
查询工作流详情
curl --request GET \
--url https://www.chenyu.cn/api/open/v2/workflow/market/info \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chenyu.cn/api/open/v2/workflow/market/info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.chenyu.cn/api/open/v2/workflow/market/info', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.chenyu.cn/api/open/v2/workflow/market/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.chenyu.cn/api/open/v2/workflow/market/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.chenyu.cn/api/open/v2/workflow/market/info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chenyu.cn/api/open/v2/workflow/market/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"workflow_id": "<string>",
"revision_id": "<string>",
"title": "<string>",
"description": "<string>",
"tags": [
{}
],
"covers": [
{}
],
"owner": {},
"quote_currency": "<string>",
"quote_amount": "<string>",
"may_incur_external_model_cost": true,
"external_cost_notice": "<string>",
"editable_parameter_manifest": [
{
"name": "<string>",
"display_name": "<string>",
"description": "<string>",
"value_type": "<string>",
"required": true,
"default_value": "<any>",
"ui_schema": {},
"bindings": [
{}
],
"sort_order": 123
}
],
"candidate_output_manifest": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>",
"node_id": "<string>",
"output_key": "<string>",
"file_index": 123,
"history_count": 123,
"sort_order": 123
}
]
}
}查询工作流详情
根据工作流 ID 查询当前 API Key 可访问的已发布版本详情。提交运行前,应先读取editable_parameter_manifest,再按参数清单组装 inputs。
版本说明: 返回的
revision_id 是当前可访问的已发布版本。提交运行时可以传入该值来锁定本次调用的版本。可见范围: 支持查询公开发布的工作流,也支持查询当前 API Key 所属用户自己已发布的非公开工作流。
请求参数
string
required
工作流 ID
响应参数
integer
响应码,
0 表示成功string
响应信息
object
工作流详情
Show data
Show data
string
工作流 ID
string
当前发布版本 ID
string
工作流标题
string
工作流介绍
array
工作流标签
array
工作流封面地址列表
object
发布者信息,包含
user_id 和 display_namestring
报价币种,当前为
CNYstring
预估报价金额。实际结算以运行完成后的实际消耗为准
boolean
是否可能产生第三方模型费用
string
第三方模型费用提示
array
可编辑输入参数清单。提交运行时,
inputs 的属性名必须使用条目中的 nameShow editable_parameter_manifest[]
Show editable_parameter_manifest[]
string
参数唯一名称,也是提交运行时
inputs 使用的 keystring
面向用户展示的参数名称
string
工作流作者填写的参数说明和取值提示
string
参数值类型。常见值为
string、int、float、bool、image_input、video_input、audio_input、file_input,并兼容 image、video、audio、fileboolean
是否必须在
inputs 中提供any
工作流发布时记录的默认值,类型与
value_type 对应object
可选的输入控件定义。
control=select 时必须从 options 中选择;未返回或 control=input 时按 value_type 直接填写array
参数与 ComfyUI 节点字段的内部绑定关系。仅用于解释工作流结构,调用方不需要把该字段放入
inputsinteger
参数展示顺序,数值越小越靠前
array
输出参数清单,用于把运行结果映射为图片、视频或音频输出
Show candidate_output_manifest[]
Show candidate_output_manifest[]
editable_parameter_manifest 输入参数清单
组装运行请求时,先遍历 editable_parameter_manifest,再以每个条目的 name 为 key 写入 inputs。不要使用 display_name、bindings[].field 或文档旧版本中的 key 字段;执行引擎会拒绝 manifest 中未声明的输入参数。
基础类型填写方式
value_type | inputs 中的 JSON 类型 | 示例 |
|---|---|---|
string | 字符串 | "n6_text": "一只橘猫" |
int | 整数,不要加引号 | "n3_seed": 156680208700286 |
float | 数字,不要加引号 | "n4_cfg": 7.5 |
bool | 布尔值,不要写成字符串 | "n5_enabled": true |
| 图片输入 | 资源字符串,见下文 | "n10_image": "asset://asset_xxx" |
| 视频输入 | 资源字符串,见下文 | "n11_video": "asset://asset_xxx" |
| 音频输入 | 资源字符串,见下文 | "n12_audio": "asset://asset_xxx" |
| 通用文件输入 | 资源字符串,见下文 | "n13_file": "asset://asset_xxx" |
图片、视频、音频和通用文件参数分别由
image_input/image、video_input/video、audio_input/audio、file_input/file 标识。服务端还兼容部分历史别名;调用方应以当前详情响应实际返回的 value_type 为准。必填项和默认值
required=true:必须在inputs中提供该name,否则运行会失败required=false:可以省略,工作流会保留发布版本中保存的节点值default_value:用于展示或预填。为了让调用结果可预测,必填参数以及需要固定值的可选参数都应显式传入,不要仅依赖该字段
下拉选择
当条目返回ui_schema.control="select" 时,可选列表就在 ui_schema.options 中:
{
"name": "n4_sampler_name",
"value_type": "string",
"ui_schema": {
"control": "select",
"options_source": "comfy_node_def",
"options": [
{ "label": "euler", "value": "euler" },
{ "label": "dpmpp_2m", "value": "dpmpp_2m" }
]
}
}
value,不是 label。value 可能是字符串、数字或布尔值,必须保留其原始 JSON 类型。选项由工作流对应的 ComfyUI 节点定义动态生成,不存在平台统一的固定列表。
数字范围
当前editable_parameter_manifest 不返回 minimum、maximum 或 step 字段,开放接口也无法从清单中推导数值边界。请按 description、default_value 和具体工作流约定填写;超出底层 ComfyUI 节点支持范围的值可能在执行阶段失败。文档不会把某个工作流的数值范围套用到其他工作流。
文件和资源 ID
本地图片、视频、音频或其他文件不能直接放入 JSON。请先调用 上传工作流资源,然后把响应中的asset_uri 作为对应参数值:
{
"inputs": {
"n10_image": "asset://asset_38d2ff7769fb3b7267039941547e6a78"
}
}
asset_id,请拼成 asset://<asset_id>;不要只传裸值 asset_xxx。文件参数也支持服务端可访问的 http://、https:// 地址以及 data:<mime>;base64,...,但本地文件和较大文件建议统一先上传。资源必须属于当前调用者且媒体类型要与参数类型匹配。
candidate_output_manifest 输出参数清单
该清单只描述运行结果,不需要放入提交接口的 inputs。type 决定结果按图片、视频还是音频展示;node_id + output_key + file_index 精确定位 ComfyUI 输出。查询运行详情或执行结果时,应优先使用清单中的 name 和 type 识别输出,不要根据文件扩展名猜测类型。
代码示例
import requests
url = "https://www.chenyu.cn/api/open/v2/workflow/market/info"
headers = {
"Authorization": "Bearer your_api_key",
"Content-Type": "application/json"
}
params = {
"workflow_id": "wf_861ef31e94dcfb10e6e7"
}
response = requests.get(url, headers=headers, params=params)
detail = response.json()["data"]
print(detail["revision_id"])
print(detail["editable_parameter_manifest"])
curl -X GET "https://www.chenyu.cn/api/open/v2/workflow/market/info?workflow_id=wf_861ef31e94dcfb10e6e7" \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json"
响应示例
{
"code": 0,
"msg": "查询成功",
"data": {
"workflow_id": "wf_861ef31e94dcfb10e6e7",
"revision_id": "wfr_f9f2a2dcb99d73b0c3aa",
"title": "文生图111",
"description": "文生图基础工作流",
"tags": ["文生图", "E2E"],
"covers": ["https://www.chenyu.cn/media/example-cover"],
"owner": {
"user_id": 10001,
"display_name": "rohon"
},
"quote_currency": "CNY",
"quote_amount": "0.03000000",
"may_incur_external_model_cost": false,
"external_cost_notice": "",
"editable_parameter_manifest": [
{
"name": "n6_text",
"display_name": "正向提示词",
"description": "描述希望生成的画面",
"value_type": "string",
"required": true,
"default_value": "beautiful scenery",
"bindings": [
{
"node_id": "6",
"field": "text",
"binding_type": "scalar"
}
],
"sort_order": 10
},
{
"name": "n4_sampler_name",
"display_name": "采样器",
"description": "选择采样算法",
"value_type": "string",
"required": true,
"default_value": "euler",
"ui_schema": {
"control": "select",
"options_source": "comfy_node_def",
"options": [
{ "label": "euler", "value": "euler" },
{ "label": "dpmpp_2m", "value": "dpmpp_2m" }
]
},
"bindings": [
{
"node_id": "4",
"field": "sampler_name",
"binding_type": "scalar"
}
],
"sort_order": 20
},
{
"name": "n3_seed",
"display_name": "随机种子",
"description": "使用相同种子有助于复现结果",
"value_type": "int",
"required": true,
"default_value": 156680208700286,
"bindings": [
{
"node_id": "3",
"field": "seed",
"binding_type": "scalar"
}
],
"sort_order": 30
},
{
"name": "n10_image",
"display_name": "参考图片",
"description": "请先上传本地图片,再传 asset_uri",
"value_type": "image_input",
"required": true,
"default_value": "",
"bindings": [
{
"node_id": "10",
"field": "image",
"binding_type": "comfy_input_image"
}
],
"sort_order": 40
}
],
"candidate_output_manifest": [
{
"name": "n9_images",
"type": "image",
"description": "生成的最终图片",
"node_id": "9",
"output_key": "images",
"file_index": 0,
"history_count": 1,
"sort_order": 10
}
]
}
}