Comfy-Org / Comfy-Org/ComfyUI

FLUX workflow causes system freeze when triggered via API (but works in WebUI)ance on resolving this issue.

Open
#9,183 2 comments 0 reactions 0 assignees View on GitHub
bug-cop:ask-for-info Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

The workflow should run just like it does in the WebUI: progress updates should be received, and image generation should complete successfully.

### Actual Behavior

The terminal shows a progress bar, but it freezes at 0%.

VRAM usage spikes.

The system eventually freezes or crashes (no image is generated).

### Steps to Reproduce

1. Connect to the ComfyUI API via WebSocket using a unique client_id.

2. Send a /prompt request using the FLUX workflow and the same client_id.

3. Wait for progress updates (expected via WebSocket).

4. Observe that the terminal shows a progress bar stuck at 0% and the system becomes unresponsive.

Note: I also tried removing the client_id and polling /history/{prompt_id} instead of using WebSocket, but the problem persisted.

### Debug Logs

```powershell
I don't have logs. Because always system down.
```

### Other

I'm integrating ComfyUI into a Python backend (FastAPI) and using the API to run workflows. While SDXL workflows and LoRA Loader integrations work perfectly, using flux_workflow.json or flux_workflow_gguf.json via API causes the system to hang.

To clarify, the flux_workflow files I'm using are exact copies of the ones that run successfully on the ComfyUI WebUI.

< Environment >
ComfyUI Version: 0.3.48
Workflow: flux_workflow.json and flux_workflow_gguf.json (copied from working WebUI setup)
Backend: Python + FastAPI

OS: Windows 11
RAM: 64GB
GPU: RTX 5080 Laptop GPU

------------------------------
SDXL workflows run flawlessly via the same backend integration.
LoRA Loader also works as expected.
The issue only occurs with FLUX-based workflows.
WebUI handles the same FLUX workflow with no issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.