Phase 6: ComfyUI — Workflow Engine · 55 min · Python · ComfyUI · websockets
ComfyUI API Integration
Design visually, execute programmatically — the /prompt, /history, /view API is how ComfyUI becomes production infrastructure.
Hiring signal: ComfyUI API integration (/prompt, /history, /view, WebSocket) is the core skill for ComfyUI Pipeline Engineer roles — it's tested in every ComfyUI-focused interview.
What you will learn
- Use the /prompt endpoint: POST API-format workflow JSON to trigger execution
- Use the /history endpoint: poll for completed workflow results
- Use the /view endpoint: retrieve generated output images/videos
- Track execution via WebSocket events: node-by-node completion progress
The Problem
A team designs a great image generation workflow in ComfyUI's visual editor. Now they need to:
- Execute it from a Python backend (not the UI)
- Track execution progress (which node is running)
- Retrieve the generated image programmatically
- Handle errors and retries
They don't know ComfyUI has a REST API and WebSocket for programmatic control. They try to screen-scrape the UI — that's not production-grade.
ComfyUI API integration is the core skill for ComfyUI Pipeline Engineer roles — it's tested in every ComfyUI-focused interview.
What you'll build
Use the /prompt endpoint to trigger workflow execution, /history to poll for results, /view to retrieve output images, and WebSocket to track node-by-node execution progress. Build a complete Python client for ComfyUI.
ComfyUI API Endpoints
API Overview
| Endpoint | Method | Purpose |
|---|
/prompt | POST | Submit workflow for execution |
/history | GET | Check execution history/results |
/view | GET | Retrieve generated output files |
/queue | GET | Check queue status |
/interrupt | POST | Cancel current execution |
/object_info | GET | Get available node types and parameters |
/system_stats | GET | Get system info (GPU, VRAM, etc.) |
Base URL
http://127.0.0.1:8188
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers /prompt — Submit Workflow, /history — Poll for Results, /view — Retrieve Output, WebSocket — Real-Time Progress, Complete Python Client, Error Handling, Key Takeaways, What's Next — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy