Skip to content

Request for API Endpoints DocumentationΒ #6607

Closed

Description

@Rahultawar

Hello,

I am currently working on integrating ComfyUI into my project and need detailed information about the available API endpoints. Specifically, I am looking for the endpoints to:

  1. Queue a new prompt for image generation.
  2. Retrieve the result of a generated image.
  3. Check the status of the prompt queue.

Could you please provide the correct endpoints and the expected request/response structures for these actions?

Thank you for your assistance!

Activity

  1. drone540 commented on Jan 26, 2025

    @drone540

    There are some examples here:

    https://github.com/comfyanonymous/ComfyUI/tree/master/script_examples

    basically these urls are in use:
    http://127.0.0.1:8188/prompt

    http://127.0.0.1:8188/history
    http://127.0.0.1:8188/history/{prompt_id} - returned from prompt - but returns nothing until it's done.

    http://127.0.0.1:8188/view

    However since I'm using a non web socket approach since my comfy ui is not online with a reverse proxy to make a direct connection in javascript. I have my php script return the replies from the requests. I'm not able to get any status info from these URLs.

    I know there is a http://127.0.0.1:8188/queue link but it only shows what I sent in basically and nothing about the status.

    So I would like to know if there is a way to get the status myself. At least the percentage completed or queue position easily. Preview images would be a bonus.

    edit
    I also looked at these 2 files just now, and don't see a way to get that progress from hijack_progress function directly from server

    https://github.com/comfyanonymous/ComfyUI/blob/master/server.py

    https://github.com/comfyanonymous/ComfyUI/blob/master/main.py#L221

  2. Rahultawar commented on Jan 27, 2025

    @Rahultawar
    Author

    Thank you for the detailed response and the links to the examples and relevant files. This information is very helpful. I'll review the provided resources and adjust my implementation accordingly. I appreciate your assistance!

  3. hartmark commented on Jan 27, 2025

    @hartmark

    I'd also love to have some /progress/{prompt_id} endpoint, where you can get current status and start time and elapsed time.

    I'm no python developer but from what quick I have gathered from the code it seems the current timestamp is not added into the queue information.

    https://github.com/comfyanonymous/ComfyUI/blob/255edf22463f597a1e136091e0f5cbbbe5f400a4/server.py#L635

  4. 2a3b4c commented on Aug 9, 2025

    @2a3b4c

    Has there been any progress on this so far.

  5. alexisrolland commented on Aug 20, 2025

    @alexisrolland
    Member

    In case this helps, you can find more details about the different API endpoints in the file server.py at the root of the ComfyUI folder.

  6. Yoruba commented on Sep 4, 2025

    @Yoruba

    Core Endpoints

    prefix /api

    • /ws: A WebSocket endpoint for real-time communication, providing status updates, execution progress, and error messages.
    • /prompt: A POST endpoint used to queue a workflow for execution. It takes a JSON object as input and returns a prompt_id to track the job.
    • /history/{prompt_id}: A GET endpoint to retrieve the results and metadata for a specific workflow after it has finished execution.
    • /view: A GET endpoint used to fetch a generated image, requiring the filename, subfolder, and type ("input", "output", or "temp") as parameters.
    • /upload/image: A POST endpoint to upload an image to the server.
    • /upload/mask: A POST endpoint to upload a mask to the server.

    Other Endpoints

    prefix /api

    • /embeddings: A GET endpoint to retrieve a list of available embeddings.
    • /features: A GET endpoint to retrieve the server's features and capabilities.
    • /models: A GET endpoint to get a list of available model types.
    • /models/{folder}: A GET endpoint to get a list of models in a specific folder.
    • /system_stats: A GET endpoint to retrieve information about the system (e.g., Python version, devices, VRAM).
    • /interrupt: A POST endpoint to stop the current workflow execution.
    • /free: A POST endpoint to free memory by unloading specific models.
    • /queue: A POST endpoint to manage the execution queue (e.g., clear pending or running jobs).
    • /object_info: A GET endpoint to explore available nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions