请求体=请求里的body
{
"6": {
"inputs": {
"text": "关键词",
"speak_and_recognation": {
"__value__": [
false,
true
]
},
"clip": [
"38",
0
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"31",
0
],
"vae": [
"39",
0
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE解码"
}
},
"31": {
"inputs": {
"seed": 450155265842975,
"steps": 20,
"cfg": 1,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": [
"37",
0
],
"positive": [
"6",
0
],
"negative": [
"135",
0
],
"latent_image": [
"188",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "K采样器"
}
},
"37": {
"inputs": {
"unet_name": "flux1-dev-kontext_fp8_scaled.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "UNet加载器"
}
},
"38": {
"inputs": {
"clip_name1": "clip_l.safetensors",
"clip_name2": "t5xxl_fp8_e4m3fn_scaled.safetensors",
"type": "flux",
"device": "default"
},
"class_type": "DualCLIPLoader",
"_meta": {
"title": "双CLIP加载器"
}
},
"39": {
"inputs": {
"vae_name": "ae.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "加载VAE"
}
},
"135": {
"inputs": {
"conditioning": [
"6",
0
]
},
"class_type": "ConditioningZeroOut",
"_meta": {
"title": "条件零化"
}
},
"136": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "保存图像"
}
},
"173": {
"inputs": {},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"188": {
"inputs": {
"width": 1024,
"height": 1024,
"batch_size": 1
},
"class_type": "EmptySD3LatentImage",
"_meta": {
"title": "空Latent图像(SD3)"
}
}
}请求体=上面替换好关键词和图片的json
curl -X POST "云端" \
-H "Content-Type: application/json" \
-d '{
"prompt": 请求体
}'xbot_visual_web_service_rest_response(status_code=200, content_type='application/json', content_encoding='', content='{"prompt_id": "24c11ab9-7ac9-4b17-b1ef-836294b96c5e", "number": 8, "node_errors": {}}')提取"prompt_id": "24c11ab9-7ac9-4b17-b1ef-836294b96c5e"为任务
云端=comfy运行地址
任务id=prompt_id
curl "云端/history/任务id"xbot_visual_web_service_rest_response(status_code=200, content_type='application/json', content_encoding='', content='{"2e480fe6-d6e9-495b-acc2-f8dffc044077": {"prompt": [4, "2e480fe6-d6e9-495b-acc2-f8dffc044077", {"3": {"inputs": {"seed": 616944802001007, "steps": 20, "cfg": 8.0, "sampler_name": "euler", "scheduler": "normal", "denoise": 1.0, "model": ["4", 0], "positive": ["6", 0], "negative": ["7", 0], "latent_image": ["5", 0]}, "class_type": "KSampler", "_meta": {"title": "K\\u91c7\\u6837\\u5668"}}, "4": {"inputs": {"ckpt_name": "v1-5-pruned-emaonly-fp16.safetensors"}, "class_type": "CheckpointLoaderSimple", "_meta": {"title": "Checkpoint\\u52a0\\u8f7d\\u5668\\uff08\\u7b80\\u6613\\uff09"}}, "5": {"inputs": {"width": 512, "height": 512, "batch_size": 1}, "class_type": "EmptyLatentImage", "_meta": {"title": "\\u7a7aLatent\\u56fe\\u50cf"}}, "6": {"inputs": {"text": "a boy", "speak_and_recognation": {"__value__": [false, true]}, "clip": ["4", 1]}, "class_type": "CLIPTextEncode", "_meta": {"title": "CLIP\\u6587\\u672c\\u7f16\\u7801"}}, "7": {"inputs": {"text": "text, watermark", "speak_and_recognation": {"__value__": [false, true]}, "clip": ["4", 1]}, "class_type": "CLIPTextEncode", "_meta": {"title": "CLIP\\u6587\\u672c\\u7f16\\u7801"}}, "8": {"inputs": {"samples": ["3", 0], "vae": ["4", 2]}, "class_type": "VAEDecode", "_meta": {"title": "VAE\\u89e3\\u7801"}}, "9": {"inputs": {"filename_prefix": "ComfyUI", "images": ["8", 0]}, "class_type": "SaveImage", "_meta": {"title": "\\u4fdd\\u5b58\\u56fe\\u50cf"}}}, {}, ["9"]], "outputs": {"9": {"images": [{"filename": "ComfyUI_00002_.png", "subfolder": "", "type": "output"}]}}, "status": {"status_str": "success", "completed": true, "messages": [["execution_start", {"prompt_id": "2e480fe6-d6e9-495b-acc2-f8dffc044077", "timestamp": 1756132916745}], ["execution_cached", {"nodes": ["3", "4", "5", "6", "7", "8", "9"], "prompt_id": "2e480fe6-d6e9-495b-acc2-f8dffc044077", "timestamp": 1756132916746}], ["execution_success", {"prompt_id": "2e480fe6-d6e9-495b-acc2-f8dffc044077", "timestamp": 1756132916746}]]}, "meta": {"9": {"node_id": "9", "display_node": "9", "parent_node": null, "real_node_id": "9"}}}}')若响应内容为{},每隔5秒发送请求,直到有内容
http拼接下载
云端=comfyui运行地址
filename=提取的的文件名字
云端/view?filename=filename&type=output&subfolder=
将加载图片换为LoadImageFromURL
打开 ComfyUI Manager → Install Custom Nodes → Search “LoadImageFromURL”
导出工作流api
找到json文件里的节点
3.图片链接=需要上传的图片
"190": {
"inputs": {
"image": "图片链接 ",
"keep_alpha_channel": false,
"output_mode": false
},
"class_type": "LoadImageFromUrl",
"_meta": {
"title": "Load Image From URL"
}
}
}