ComfyUI Integration
Sweet Tea is the creative workspace; ComfyUI is the engine that generates your images. This chapter covers how they connect, what the health states mean, and how to diagnose problems when the connection isn't cooperating.
How the Connection Works
Studio communicates with ComfyUI over two channels:
- REST API for queuing jobs, reading settings, and fetching metadata
- WebSocket for live progress updates during generation
Both need to be working for a smooth experience. If you can queue a job but don't see live progress updates, the issue is usually WebSocket-specific — check firewalls, proxies, or networking configuration before changing workflow settings.
Managed vs. External Runtime
You have two ways to connect Studio to ComfyUI. Choose based on how much control you want over the runtime.
Managed runtime (recommended for most users)
Studio starts, stops, and monitors ComfyUI for you. You point it at your ComfyUI installation directory, and it handles the rest.
Best when: You want convenience and fewer moving parts. Studio manages the process lifecycle and gives you logs and status without you touching a terminal.
Setup:
- Open Settings > Engine.
- Set the ComfyUI path to your ComfyUI directory.
- Optionally configure launch arguments (like
--listenor--gpu-only). - Click Start or let Studio auto-start on launch.
- Watch the status bar — when it turns healthy, you're ready.
External runtime
Studio connects to a ComfyUI instance you're running independently.
Best when: You have a custom ComfyUI setup with specific environment controls, or you're connecting to a remote instance (like a hosted GPU — see Hosted GPU Workflows).
Setup:
- Start ComfyUI yourself however you normally would.
- Open Settings > Engine.
- Enter the ComfyUI URL (default:
http://127.0.0.1:8188). - Studio connects and begins health monitoring.
Tip: You can switch between managed and external runtime anytime. If you're troubleshooting, switching to external mode and running ComfyUI manually gives you more visibility into startup logs.
Health States
The status bar at the bottom of Studio always shows the current engine state. Here's what each state means and what to do:
| State | What it means | What to do |
|---|---|---|
| Connected / Ready | Engine is healthy and accepting jobs | Generate away |
| Connecting | Studio is attempting to reach ComfyUI | Wait 15-30 seconds. If it doesn't resolve, check URL and runtime status |
| Starting | Managed runtime is launching ComfyUI | Be patient — first starts can take a minute, especially with many custom nodes |
| Disconnected | Studio can't reach ComfyUI at all | Verify the URL/path in Settings, check if ComfyUI is actually running |
| Error | Something went wrong at the runtime level | Check engine logs in Settings for the specific error message |
Note: Don't try to "fix" a Disconnected state by editing prompts or workflow settings. The issue is almost always in the connection configuration or the ComfyUI process itself, not in your creative settings.
Setting Up the Managed Runtime Step by Step
If you're using the managed path and it's your first time:
- Open Settings > Engine and set your ComfyUI directory path.
- Verify the path is correct — the directory should contain ComfyUI's
main.pyor equivalent entry point. - Add any launch arguments you need (most users can skip this).
- Click Start.
- Watch the status bar transition from Starting to Connected.
- Run one simple test generation in Prompt Studio to confirm end-to-end health.
Only move on to importing complex workflows once this baseline works.
Connecting to an External Instance
- Make sure ComfyUI is running and accessible.
- In Settings > Engine, enter the URL (e.g.,
http://127.0.0.1:8188). - Studio should connect within a few seconds.
- If it doesn't, verify:
- ComfyUI is running and not erroring on startup
- The port isn't blocked by a firewall
- If remote, that the host and port are reachable from your machine
Diagnosis Quick Reference
When something isn't working, this table helps you narrow down the cause fast:
| Symptom | Likely source | First action |
|---|---|---|
| Queue call fails immediately | Engine unreachable or misconfigured | Check URL/path in Settings, verify ComfyUI is running |
| Queue works but no progress updates | WebSocket issue | Check firewall/proxy rules, try restarting the runtime |
| Run fails with "missing node" | A custom node pack isn't installed | Open Extension Manager and install the missing pack |
| Run fails with "missing model" | A model file is missing or in the wrong path | Open Models Manager and check file paths |
| Output saves to unexpected location | Project or workflow I/O mismatch | Check active project context in Projects & Organization |
| Engine stays in "Starting" for a long time | Slow ComfyUI startup (many nodes, large models) | Wait — don't kill it prematurely. Check engine logs for progress |
Tip: Engine logs are your best friend when debugging connection issues. In Settings, look for the log viewer that shows ComfyUI's stdout and stderr output. The error message is usually right there.
