comfyui api interface document

comfyui-api documentation

If you need the original version of apifox, please contact me: ai_009966
Code cloud address:
https://ext.dcloud.net.cn/plugin?id=12603

1. GET /history

Get all historical task data

Request parameters

Name Location Type Required Description
prompt_id query string No 8b918008 -751f-414c-9575-7174e841ceac

Return results

< /table>

2. GET /embeddings

Get a list

Status code Status code meaning Description Data model
200 OK Success Inline

< /table>

3. GET /history/{prompt_id}

Get historical task data (get historical data based on task id)

Return results

Status code Status code meaning Description Data model
200 OK Success Inline

< /table>

4. GET /extensions

Get the list of extended node files

Return results

Status code Status code meaning Description Data model
200 OK Success Inline

< /table>

5. POST /upload/image

Upload image interface

Body request parameters

image: string

Request parameters

Status code Status code meaning Description Data model
200 OK Success Inline
Name Location Type Required Description
body body object No none
? image body string(binary) Yes The image will be sent to the server in binary format
{<!-- -->
  "name": "aaa (7).webp",
  "subfolder": "",
  "type": "input"
}

Return results

< /table>

6. POST /upload/mask

Upload mask image interface, generally used for partial redrawing

Body request parameters

image: string
type: input
subfolder: clipspace
original_ref: "{"filename":"Download.png","type":"input","subfolder":"clipspace"}"

Request parameters

Status code Status code meaning Description Data model
200 OK Success Inline

td>

Name Location Type Required Description
body body object No none
? image body string(binary) Yes The image will be sent to the server in binary format
? type body string No Destination folder for uploading images
? subfolder body string No Target subfolder for uploaded images
? original_ref body string Yes No
{<!-- -->
  "name": "Download.png",
  "subfolder": "clipspace",
  "type": "input"
}

Return results

< /table>

Return data structure

7. GET /view

Online preview interface for images (uploaded images, raw images, and masked images are all previewed through this interface)

Request parameters

Status code Status code meaning Description Data model
200 OK Success Inline
Name Location Type Required Description
filename query string is picture Name
type query string No Image storage location folder (input is the long-distance image, output is the generated image)
subfolder query string No Subfolder (no need to fill in)
preview query string No Preview
channel query string No None

Return results

< /table>

8. POST /view_metadata/{folder_name}

none

Request parameters

Status code Status code meaning Description Data model
200 OK Success Inline
Name Location Type Required Description
folder_name path string is none

Return results

< /table>

9. GET /system_stats

System statistics interface

{<!-- -->
    "system": {<!-- -->
        "os": "nt",
        "python_version": "3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]",
        "embedded_python": true
    },
    "devices": [
        {<!-- -->
            "name": "cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync",
            "type": "cuda",
            "index": 0,
            "vram_total": 25769279488,
            "vram_free": 22114014558,
            "torch_vram_total": 2348810240,
            "torch_vram_free": 104404318
        }
    ]
}

Return results

Status code Status code meaning Description Data model
200 OK Success Inline

< /table>

10. GET /prompt

Get the current number of remaining task queues on the server

{<!-- -->
  "exec_info": {<!-- -->
    "queue_remaining": 1
  }
}

Return results

Status code Status code meaning Description Data model
200 OK Success Inline

< /table>

11. POST /prompt

The delivery interface of drawing tasks. This interface only delivers tasks and returns task ID information.
This interface only delivers tasks and returns task ID information.

Body request parameters

{<!-- -->
  "client_id": "533ef3a3-39c0-4e39-9ced-37d290f371f8",
  "prompt": {<!-- -->
    "3": {<!-- -->
      "inputs": {<!-- -->
        "seed": 764714814161513,
        "steps": 26,
        "cfg": 5,
        "sampler_name": "dpmpp_3m_sde_gpu",
        "scheduler": "karras",
        "denoise": 1,
        "model": [
          "40",
          0
        ],
        "positive": [
          "49",
          0
        ],
        "negative": [
          "6",
          0
        ],
        "latent_image": [
          "5",
          0
        ]
      },
      "class_type": "KSampler"
    },
    "5": {<!-- -->
      "inputs": {<!-- -->
        "width": 1024,
        "height": 768,
        "batch_size": 1
      },
      "class_type": "EmptyLatentImage"
    },
    "6": {<!-- -->
      "inputs": {<!-- -->
        "text": "",
        "clip": [
          "40",
          1
        ]
      },
      "class_type": "CLIPTextEncode"
    },
    "8": {<!-- -->
      "inputs": {<!-- -->
        "samples": [
          "3",
          0
        ],
        "vae": [
          "40",
          2
        ]
      },
      "class_type": "VAEDecode"
    },
    "9": {<!-- -->
      "inputs": {<!-- -->
        "filename_prefix": "ComfyUI",
        "images": [
          "8",
          0
        ]
      },
      "class_type": "SaveImage"
    },
    "13": {<!-- -->
      "inputs": {<!-- -->
        "clip_vision": [
          "39",
          0
        ],
        "image": [
          "34",
          0
        ]
      },
      "class_type": "CLIPVisionEncode"
    },
    "19": {<!-- -->
      "inputs": {<!-- -->
        "strength": 1,
        "noise_augmentation": 0,
        "conditioning": [
          "42",
          0
        ],
        "clip_vision_output": [
          "13",
          0
        ]
      },
      "class_type": "unCLIPConditioning"
    },
    "34": {<!-- -->
      "inputs": {<!-- -->
        "image": "clipspace/clipspace-mask-1645940.7000000002.png [input]",
        "choose file to upload": "image"
      },
      "class_type": "LoadImage"
    },
    "36": {<!-- -->
      "inputs": {<!-- -->
        "clip_vision": [
          "39",
          0
        ],
        "image": [
          "38",
          0
        ]
      },
      "class_type": "CLIPVisionEncode"
    },
    "37": {<!-- -->
      "inputs": {<!-- -->
        "strength": 0.75,
        "noise_augmentation": 0,
        "conditioning": [
          "19",
          0
        ],
        "clip_vision_output": [
          "36",
          0
        ]
      },
      "class_type": "unCLIPConditioning"
    },
    "38": {<!-- -->
      "inputs": {<!-- -->
        "image": "beijing1 (2).webp",
        "choose file to upload": "image"
      },
      "class_type": "LoadImage"
    },
    "39": {<!-- -->
      "inputs": {<!-- -->
        "clip_name": "clip_vision_g.safetensors"
      },
      "class_type": "CLIPVisionLoader"
    },
    "40": {<!-- -->
      "inputs": {<!-- -->
        "ckpt_name": "sd_xl_base_1.0.safetensors"
      },
      "class_type": "CheckpointLoaderSimple"
    },
    "42": {<!-- -->
      "inputs": {<!-- -->
        "conditioning": [
          "6",
          0
        ]
      },
      "class_type": "ConditioningZeroOut"
    },
    "43": {<!-- -->
      "inputs": {<!-- -->
        "safe": "enable"
      },
      "class_type": "HEDPreprocessor"
    },
    "44": {<!-- -->
      "inputs": {<!-- -->
        "safe": "enable",
        "image": [
          "34",
          0
        ]
      },
      "class_type": "HEDPreprocessor"
    },
    "45": {<!-- -->
      "inputs": {<!-- -->
        "images": [
          "44",
          0
        ]
      },
      "class_type": "PreviewImage"
    },
    "46": {<!-- -->
      "inputs": {<!-- -->
        "control_net_name": "control-lora-depth-rank256.safetensors"
      },
      "class_type": "ControlNetLoader"
    },
    "47": {<!-- -->
      "inputs": {<!-- -->
        "image": [
          "34",
          0
        ]
      },
      "class_type": "ScribblePreprocessor"
    },
    "48": {<!-- -->
      "inputs": {<!-- -->
        "images": [
          "47",
          0
        ]
      },
      "class_type": "PreviewImage"
    },
    "49": {<!-- -->
      "inputs": {<!-- -->
        "strength": 0.5,
        "conditioning": [
          "37",
          0
        ],
        "control_net": [
          "46",
          0
        ],
        "image": [
          "47",
          0
        ]
      },
      "class_type": "ControlNetApply"
    }
  }
}

Request parameters

Status code Status code meaning Description Data model
200 OK Success Inline
Name Location Type Required Description
body body object No none
{<!-- -->
  "prompt_id": "352c1fc4-7382-4c4a-965f-583c4b126a1b",
  "number": 38,
  "node_errors": {<!-- -->}
}

Return results

< /table>

12. GET /object_info

Get all components and available parameters in the system

Status code Status code meaning Description Data model
200 OK Success Inline

< /table>

Return data structure

13. GET /object_info/{node_class}

Get component parameters in the system based on component name

Return results

Status code Status code meaning Description Data model
200 OK Success Inline

< /table>

15. POST /queue

Delete the queue/no return information is successful

Body request parameters

{<!-- -->
  "delete": "string"
}

Request parameters

Status code Status code meaning Description Data model
200 OK Success Inline
Name Location Type Required Description
body body object No none
? delete body string Yes Contains task id List of

Return results

< /table>

16. GET /interrupt

Cancel current task/no parameters required

Return results

Status code Status code meaning Description Data model
200 OK Success Inline

< /table>

syntaxbug.com © 2021 All Rights Reserved.
Status code Status code meaning Description Data model
200 OK Success Inline