Cannot connect to 127.0.0.1:8188: locate the running ComfyUI service
localhost identifies the device making the request. Its meaning differs across a browser, phone, container, notebook and remote server.
Symptoms and scope
localhost identifies the device making the request. Its meaning differs across a browser, phone, container, notebook and remote server.
Error fragments for search; IDs, values and filenames may vary:
Connection refused
ECONNREFUSED
Failed to fetch
Source-supported context
Official Portable instructions use the address printed by the running process. Native API routes belong to that server; connection refusal happens before prompt validation. Source 1 Source 2 Source 3
Cases to distinguish
1. The backend exited on a dependency/GPU error and no process is listening.
2. The service listens on another address/port or inside a remote/container environment.
3. A firewall, reverse proxy, port mapping or platform entry point does not reach that service.
Diagnostic sequence
The sequence below is an editorial procedure based on the cited context, not a diagnosis already confirmed for your environment.
Step 1. Read the earliest startup failure and final listening address and confirm that the process remains alive.
Step 2. Test locally on the service host, then inspect each container/platform mapping to narrow the failing boundary.
Step 3. Check host, port and scheme for HTTP and WebSocket independently. Avoid mixed insecure HTTP/WS access from an HTTPS page.
Step 4. For remote access, use an authenticated controlled entry point following the platform's instructions. Do not expose an unprotected ComfyUI service directly to the internet.
Completion check
The intended client reads a lightweight endpoint and then completes a small task. A working homepage does not establish a working WebSocket connection.
Limitations and cautions
Failed to fetch can also indicate CORS or certificate failures. This article is not a platform-specific public-tunnel configuration guide.
Original sources
- Python errno — original record checked 2026-09-21.
- ComfyUI Portable Windows — original record checked 2026-09-21.
- ComfyUI Server API routes — original record checked 2026-09-21.
Localization prepared: 2026-09-22. The source-check dates above were inherited from the existing article; this translation does not claim they were all rechecked today. No GPU run, minimum-memory measurement or runtime guarantee is supplied.
Related troubleshooting and guides
Was this page helpful?
Anonymous. Only a yes/no counter is stored; no account, IP address or device details.
Sources & references
Localized from the existing Chinese research draft. Original source-check dates are retained; this translation is not new technical verification or a runtime test.
01Python errnoSource checked: 2026-09-2102ComfyUI Portable WindowsSource checked: 2026-09-2103ComfyUI Server API routesSource checked: 2026-09-21