ComfyUI API
    ComfyUI API
    • 连接ComfyUI实时进度消息
    • 获取历史任务数据
      GET
    • 根据id获取历史任务数据
      GET
    • 获取节点信息
      GET
    • 发布绘图任务
      POST
    • 获取任务数据
      GET
    • 图片上传
      POST
    • 上传蒙版图片接口
      POST
    • 获取embeddings列表
      GET
    • 获取扩展节点文件列表
      GET
    • 图片预览
      GET
    • 获取服务器当前剩余任务列队的数量
      GET
    • 获取所有的队列信息
      GET
    • 清除队列
      POST
    • 删除指定任务队列
      POST
    • 取消当前任务
      POST

      根据id获取历史任务数据

      开发中
      GET
      http://192.168.2.184:8188/history/{prompt_id}
      获取历史任务数据(根据任务id获取历史数据)

      请求参数

      Path 参数
      prompt_id
      string 
      必需
      示例值:
      8278b4e6-656a-4dbd-8ec9-4a0784babac7

      示例代码

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location --request GET 'http://192.168.2.184:8188/history/8278b4e6-656a-4dbd-8ec9-4a0784babac7'

      返回响应

      🟢200成功
      application/json
      Body
      object {0}
      示例
      {
          "8278b4e6-656a-4dbd-8ec9-4a0784babac7": {
              "prompt": [
                  0,
                  "8278b4e6-656a-4dbd-8ec9-4a0784babac7",
                  {
                      "3": {
                          "inputs": {
                              "seed": 156680208700286,
                              "steps": 20,
                              "cfg": 8,
                              "sampler_name": "euler",
                              "scheduler": "normal",
                              "denoise": 1,
                              "model": [
                                  "4",
                                  0
                              ],
                              "positive": [
                                  "6",
                                  0
                              ],
                              "negative": [
                                  "7",
                                  0
                              ],
                              "latent_image": [
                                  "5",
                                  0
                              ]
                          },
                          "class_type": "KSampler",
                          "_meta": {
                              "title": "K采样器"
                          }
                      },
                      "4": {
                          "inputs": {
                              "ckpt_name": "juggernautXL_v9Rundiffusionphoto2.safetensors"
                          },
                          "class_type": "CheckpointLoaderSimple",
                          "_meta": {
                              "title": "Checkpoint加载器(简易)"
                          }
                      },
                      "5": {
                          "inputs": {
                              "width": 512,
                              "height": 512,
                              "batch_size": 1
                          },
                          "class_type": "EmptyLatentImage",
                          "_meta": {
                              "title": "空Latent"
                          }
                      },
                      "6": {
                          "inputs": {
                              "text": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,",
                              "clip": [
                                  "4",
                                  1
                              ]
                          },
                          "class_type": "CLIPTextEncode",
                          "_meta": {
                              "title": "CLIP文本编码器"
                          }
                      },
                      "7": {
                          "inputs": {
                              "text": "text, watermark",
                              "clip": [
                                  "4",
                                  1
                              ]
                          },
                          "class_type": "CLIPTextEncode",
                          "_meta": {
                              "title": "CLIP文本编码器"
                          }
                      },
                      "8": {
                          "inputs": {
                              "samples": [
                                  "3",
                                  0
                              ],
                              "vae": [
                                  "4",
                                  2
                              ]
                          },
                          "class_type": "VAEDecode",
                          "_meta": {
                              "title": "VAE解码"
                          }
                      },
                      "9": {
                          "inputs": {
                              "filename_prefix": "ComfyUI",
                              "images": [
                                  "8",
                                  0
                              ]
                          },
                          "class_type": "SaveImage",
                          "_meta": {
                              "title": "保存图像"
                          }
                      }
                  },
                  {
                      "extra_pnginfo": {
                          "workflow": {
                              "last_node_id": 9,
                              "last_link_id": 9,
                              "nodes": [
                                  {
                                      "id": 7,
                                      "type": "CLIPTextEncode",
                                      "pos": [
                                          413,
                                          389
                                      ],
                                      "size": {
                                          "0": 425.27801513671875,
                                          "1": 180.6060791015625
                                      },
                                      "flags": {},
                                      "order": 3,
                                      "mode": 0,
                                      "inputs": [
                                          {
                                              "name": "clip",
                                              "type": "CLIP",
                                              "link": 5,
                                              "label": "CLIP"
                                          }
                                      ],
                                      "outputs": [
                                          {
                                              "name": "CONDITIONING",
                                              "type": "CONDITIONING",
                                              "links": [
                                                  6
                                              ],
                                              "slot_index": 0,
                                              "label": "条件"
                                          }
                                      ],
                                      "properties": {
                                          "Node name for S&R": "CLIPTextEncode"
                                      },
                                      "widgets_values": [
                                          "text, watermark"
                                      ]
                                  },
                                  {
                                      "id": 6,
                                      "type": "CLIPTextEncode",
                                      "pos": [
                                          415,
                                          186
                                      ],
                                      "size": {
                                          "0": 422.84503173828125,
                                          "1": 164.31304931640625
                                      },
                                      "flags": {},
                                      "order": 2,
                                      "mode": 0,
                                      "inputs": [
                                          {
                                              "name": "clip",
                                              "type": "CLIP",
                                              "link": 3,
                                              "label": "CLIP"
                                          }
                                      ],
                                      "outputs": [
                                          {
                                              "name": "CONDITIONING",
                                              "type": "CONDITIONING",
                                              "links": [
                                                  4
                                              ],
                                              "slot_index": 0,
                                              "label": "条件"
                                          }
                                      ],
                                      "properties": {
                                          "Node name for S&R": "CLIPTextEncode"
                                      },
                                      "widgets_values": [
                                          "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
                                      ]
                                  },
                                  {
                                      "id": 5,
                                      "type": "EmptyLatentImage",
                                      "pos": [
                                          473,
                                          609
                                      ],
                                      "size": {
                                          "0": 315,
                                          "1": 106
                                      },
                                      "flags": {},
                                      "order": 0,
                                      "mode": 0,
                                      "outputs": [
                                          {
                                              "name": "LATENT",
                                              "type": "LATENT",
                                              "links": [
                                                  2
                                              ],
                                              "slot_index": 0,
                                              "label": "Latent"
                                          }
                                      ],
                                      "properties": {
                                          "Node name for S&R": "EmptyLatentImage"
                                      },
                                      "widgets_values": [
                                          512,
                                          512,
                                          1
                                      ]
                                  },
                                  {
                                      "id": 3,
                                      "type": "KSampler",
                                      "pos": [
                                          863,
                                          186
                                      ],
                                      "size": {
                                          "0": 315,
                                          "1": 262
                                      },
                                      "flags": {},
                                      "order": 4,
                                      "mode": 0,
                                      "inputs": [
                                          {
                                              "name": "model",
                                              "type": "MODEL",
                                              "link": 1,
                                              "label": "模型"
                                          },
                                          {
                                              "name": "positive",
                                              "type": "CONDITIONING",
                                              "link": 4,
                                              "label": "正面条件"
                                          },
                                          {
                                              "name": "negative",
                                              "type": "CONDITIONING",
                                              "link": 6,
                                              "label": "负面条件"
                                          },
                                          {
                                              "name": "latent_image",
                                              "type": "LATENT",
                                              "link": 2,
                                              "label": "Latent"
                                          }
                                      ],
                                      "outputs": [
                                          {
                                              "name": "LATENT",
                                              "type": "LATENT",
                                              "links": [
                                                  7
                                              ],
                                              "slot_index": 0,
                                              "label": "Latent"
                                          }
                                      ],
                                      "properties": {
                                          "Node name for S&R": "KSampler"
                                      },
                                      "widgets_values": [
                                          156680208700286,
                                          "randomize",
                                          20,
                                          8,
                                          "euler",
                                          "normal",
                                          1
                                      ]
                                  },
                                  {
                                      "id": 8,
                                      "type": "VAEDecode",
                                      "pos": [
                                          1209,
                                          188
                                      ],
                                      "size": {
                                          "0": 210,
                                          "1": 46
                                      },
                                      "flags": {},
                                      "order": 5,
                                      "mode": 0,
                                      "inputs": [
                                          {
                                              "name": "samples",
                                              "type": "LATENT",
                                              "link": 7,
                                              "label": "Latent"
                                          },
                                          {
                                              "name": "vae",
                                              "type": "VAE",
                                              "link": 8,
                                              "label": "VAE"
                                          }
                                      ],
                                      "outputs": [
                                          {
                                              "name": "IMAGE",
                                              "type": "IMAGE",
                                              "links": [
                                                  9
                                              ],
                                              "slot_index": 0,
                                              "label": "图像"
                                          }
                                      ],
                                      "properties": {
                                          "Node name for S&R": "VAEDecode"
                                      }
                                  },
                                  {
                                      "id": 9,
                                      "type": "SaveImage",
                                      "pos": [
                                          1451,
                                          189
                                      ],
                                      "size": {
                                          "0": 210,
                                          "1": 58
                                      },
                                      "flags": {},
                                      "order": 6,
                                      "mode": 0,
                                      "inputs": [
                                          {
                                              "name": "images",
                                              "type": "IMAGE",
                                              "link": 9,
                                              "label": "图像"
                                          }
                                      ],
                                      "properties": {},
                                      "widgets_values": [
                                          "ComfyUI"
                                      ]
                                  },
                                  {
                                      "id": 4,
                                      "type": "CheckpointLoaderSimple",
                                      "pos": [
                                          26,
                                          474
                                      ],
                                      "size": {
                                          "0": 315,
                                          "1": 98
                                      },
                                      "flags": {},
                                      "order": 1,
                                      "mode": 0,
                                      "outputs": [
                                          {
                                              "name": "MODEL",
                                              "type": "MODEL",
                                              "links": [
                                                  1
                                              ],
                                              "slot_index": 0,
                                              "label": "模型"
                                          },
                                          {
                                              "name": "CLIP",
                                              "type": "CLIP",
                                              "links": [
                                                  3,
                                                  5
                                              ],
                                              "slot_index": 1,
                                              "label": "CLIP"
                                          },
                                          {
                                              "name": "VAE",
                                              "type": "VAE",
                                              "links": [
                                                  8
                                              ],
                                              "slot_index": 2,
                                              "label": "VAE"
                                          }
                                      ],
                                      "properties": {
                                          "Node name for S&R": "CheckpointLoaderSimple"
                                      },
                                      "widgets_values": [
                                          "juggernautXL_v9Rundiffusionphoto2.safetensors"
                                      ]
                                  }
                              ],
                              "links": [
                                  [
                                      1,
                                      4,
                                      0,
                                      3,
                                      0,
                                      "MODEL"
                                  ],
                                  [
                                      2,
                                      5,
                                      0,
                                      3,
                                      3,
                                      "LATENT"
                                  ],
                                  [
                                      3,
                                      4,
                                      1,
                                      6,
                                      0,
                                      "CLIP"
                                  ],
                                  [
                                      4,
                                      6,
                                      0,
                                      3,
                                      1,
                                      "CONDITIONING"
                                  ],
                                  [
                                      5,
                                      4,
                                      1,
                                      7,
                                      0,
                                      "CLIP"
                                  ],
                                  [
                                      6,
                                      7,
                                      0,
                                      3,
                                      2,
                                      "CONDITIONING"
                                  ],
                                  [
                                      7,
                                      3,
                                      0,
                                      8,
                                      0,
                                      "LATENT"
                                  ],
                                  [
                                      8,
                                      4,
                                      2,
                                      8,
                                      1,
                                      "VAE"
                                  ],
                                  [
                                      9,
                                      8,
                                      0,
                                      9,
                                      0,
                                      "IMAGE"
                                  ]
                              ],
                              "groups": [],
                              "config": {},
                              "extra": {
                                  "ds": {
                                      "scale": 1.3310000000000004,
                                      "offset": [
                                          148.65111914906248,
                                          -147.5722921301243
                                      ]
                                  }
                              },
                              "version": 0.4,
                              "widget_idx_map": {
                                  "3": {
                                      "seed": 0,
                                      "sampler_name": 4,
                                      "scheduler": 5
                                  }
                              }
                          }
                      },
                      "client_id": "a18ca951a80a405f843c501d53a6d4a6"
                  },
                  [
                      "9"
                  ]
              ],
              "outputs": {
                  "9": {
                      "images": [
                          {
                              "filename": "ComfyUI_00065_.png",
                              "subfolder": "",
                              "type": "output"
                          }
                      ]
                  }
              },
              "status": {
                  "status_str": "success",
                  "completed": true,
                  "messages": [
                      [
                          "execution_start",
                          {
                              "prompt_id": "8278b4e6-656a-4dbd-8ec9-4a0784babac7",
                              "timestamp": 1723822366782
                          }
                      ],
                      [
                          "execution_cached",
                          {
                              "nodes": [],
                              "prompt_id": "8278b4e6-656a-4dbd-8ec9-4a0784babac7",
                              "timestamp": 1723822366782
                          }
                      ],
                      [
                          "execution_success",
                          {
                              "prompt_id": "8278b4e6-656a-4dbd-8ec9-4a0784babac7",
                              "timestamp": 1723822403336
                          }
                      ]
                  ]
              }
          }
      }
      上一页
      获取历史任务数据
      下一页
      获取节点信息
      Built with