You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Queue a new prompt for image generation.
Retrieve the result of a generated image.
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!
Reacted by Bukit Sorrento, Alexis Rolland and Andray
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
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!
/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.
Reacted by Alexis Rolland, Andray, Felipe Venturino, unionizemaids, Better-Boy, adibafandia, africsnail, Brian Jorden, Zyrthofar, iwr-redmond and 2 more
Activity
drone540 commentedon Jan 26, 2025
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
Rahultawar commentedon Jan 27, 2025
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!
hartmark commentedon Jan 27, 2025
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
2a3b4c commentedon Aug 9, 2025
Has there been any progress on this so far.
alexisrolland commentedon Aug 20, 2025
In case this helps, you can find more details about the different API endpoints in the file
server.pyat the root of the ComfyUI folder.Yoruba commentedon Sep 4, 2025
Core Endpoints
prefix /api
prompt_idto track the job.filename,subfolder, andtype("input", "output", or "temp") as parameters.Other Endpoints
prefix /api