Skip to main content

GET /queue

Retrieves the current state of the execution queue, including running and pending prompts.

Response

array
Array of currently executing prompts. Each item is an array containing: [number, prompt_id, workflow, extra_data, outputs_to_execute]
array
Array of prompts waiting to be executed. Each item follows the same structure as queue_running.

Example Request

Example Response

Python Example


POST /queue

Manages the execution queue by clearing all pending items or deleting specific prompts.

Request Body

boolean
When true, removes all pending prompts from the queue. Does not affect currently running prompts.
array
Array of prompt IDs to remove from the queue.

Response

Returns 200 OK on success.

Example: Clear Queue

Example: Delete Specific Prompts

Python Example


GET /prompt

Retrieves queue information including the number of remaining tasks.

Response

object
Execution information object.

Example Request

Example Response


POST /interrupt

Interrupts the currently executing prompt or a specific prompt by ID.

Request Body

string
Optional prompt ID to interrupt. If provided, only interrupts if this specific prompt is currently running. If omitted, performs a global interrupt on any running prompt.

Response

Returns 200 OK on success.

Example: Global Interrupt

Example: Targeted Interrupt

Python Example


POST /free

Controls memory management by unloading models or freeing memory.

Request Body

boolean
When true, unloads all models from memory after the current execution completes.
boolean
When true, triggers memory cleanup after the current execution completes.

Response

Returns 200 OK on success.

Example Request

Python Example


Complete Queue Management Example

Notes

Queue operations affect pending prompts. Currently running prompts cannot be removed from the queue, but can be interrupted using /interrupt.
Clearing the queue or interrupting execution will cause any affected prompts to not complete. Make sure to handle this in your application logic.
Use the WebSocket API to receive real-time queue status updates instead of polling the REST endpoints.

See Also