Cannot authenticate to local ComfyUI with a valid API key when workspace has zero credits
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
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
A valid API key should authenticate successfully regardless of the current credit balance.
The user should be able to access the billing/checkout flow to purchase credits.
### Actual Behavior
The login fails.
The account name/email is never displayed.
Requests to customer endpoints return:
```
HTTP 403
Workspace has no active subscription (billing inactive)
```
### Steps to Reproduce
1. Create a workspace with 0 credits (fresh account).
2. Generate a valid API key on https://[platform.comfy.org/profile/api-keys](https://platform.comfy.org/profile/api-keys).
3. Open the local ComfyUI frontend.
4. Attempt to sign in using the API key.
### Debug Logs
```powershell
[INFO] got prompt
[ERROR] !!! Exception during processing !!! Payment Required: Please add credits to your account to use this node.
[ERROR] Traceback (most recent call last):
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\execution.py", line 461, in execute
raise ex
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\execution.py", line 457, in execute
results.append(r.result())
^^^^^^^^^^
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\execution.py", line 292, in async_wrapper
return await f(**args)
^^^^^^^^^^^^^^^
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\comfy_api\internal\__init__.py", line 145, in wrapped_async_func
return await method(locked_class, **inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\comfy_api\latest\_io.py", line 1955, in EXECUTE_NORMALIZED_ASYNC
to_return = await cls.execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\comfy_api_nodes\nodes_gemini.py", line 1536, in execute
response = await sync_op(
^^^^^^^^^^^^^^
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\comfy_api_nodes\util\client.py", line 114, in sync_op
raw = await sync_op_raw(
^^^^^^^^^^^^^^^^^^
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\comfy_api_nodes\util\client.py", line 244, in sync_op_raw
return await _request_base(cfg, expect_binary=as_binary)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Adam Ratajczak\Desktop\ComfyUI_windows_portable\ComfyUI\comfy_api_nodes\util\client.py", line 789, in _request_base
raise Exception(msg)
Exception: Payment Required: Please add credits to your account to use this node.
```
### Other
If I log in with my Comfy account (Google/OAuth) instead of using the API key, I can purchase credits. After purchasing credits, the exact same API key immediately works without being regenerated or changed.
Contributor guide
Research direction
Start by tracing API-key sign-in and the customer endpoint requests described in the issue, then inspect the request path shown in comfy_api_nodes/util/client.py, especially _request_base. Reproduce with a fresh workspace at zero credits and compare API-key authentication with Google/OAuth. Done means a valid API key authenticates, the account identity and billing/checkout flow are accessible, and the key works after credits are purchased without regeneration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, authentication, payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100