fabricatio_comfyui.http_client

HTTP-only ComfyUI client.

Owns the httpx.AsyncClient lifecycle and all REST endpoints.

Classes

ComfyuiHTTPClient

Async HTTP client for the ComfyUI REST API.

Module Contents

class fabricatio_comfyui.http_client.ComfyuiHTTPClient

Async HTTP client for the ComfyUI REST API.

Manages an httpx.AsyncClient connection pool. Use as an async context manager or call open() / close() manually.

property client_id: str

Persistent client ID for this instance.

async __aenter__() Self

Enter async context manager, opening the connection pool.

async __aexit__(*_: object) None

Exit async context manager, closing the connection pool.

open() None

Create the HTTP connection pool if not already open.

async close() None

Close the HTTP connection pool.

async queue_prompt(workflow: Dict[str, Any] | fabricatio_comfyui.models.workflow.Workflow, **kwargs: Unpack[fabricatio_comfyui.models.kwargs_types.QueueKwargs]) fabricatio_comfyui.models.comfyui.PromptResponse

Submit a workflow for execution via POST /prompt.

async get_queue_info() fabricatio_comfyui.models.comfyui.QueueInfo

Get current queue status via GET /queue.

async get_history(prompt_id: str) fabricatio_comfyui.models.comfyui.HistoryEntry | None

Get execution history via GET /history/{prompt_id}.

async interrupt() None

Interrupt the currently running workflow via POST /interrupt.

async get_image(filename: str, **kwargs: Unpack[fabricatio_comfyui.models.kwargs_types.ViewImageKwargs]) bytes

Download a generated image via GET /view.

async upload_image(image_path: str | pathlib.Path, **kwargs: Unpack[fabricatio_comfyui.models.kwargs_types.UploadKwargs]) fabricatio_comfyui.models.comfyui.UploadResponse

Upload an image via POST /upload/image.

async wait_for_completion(prompt_id: str, **kwargs: Unpack[fabricatio_comfyui.models.kwargs_types.PollKwargs]) fabricatio_comfyui.models.comfyui.ComfyuiExecutionResult

Poll GET /history/{prompt_id} until completion.