fabricatio_comfyui.http_client
HTTP-only ComfyUI client.
Owns the httpx.AsyncClient lifecycle and all REST endpoints.
Classes
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.AsyncClientconnection pool. Use as an async context manager or callopen()/close()manually.- async __aenter__() Self
Enter async context manager, opening the 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 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.