Comfy-Org / Comfy-Org/ComfyUI

Broken /api/assets route in OSS comfy

Open
#12,617 3 comments 1 reaction 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [ ] 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

I tried uploading an asset via the API locally according to the openapi specification.

### Actual Behavior

I got 500 internal server error, and this was printed on the comfy console:

### Steps to Reproduce

I'm using the portable version of comfy.

My request was:
```
curl --location 'http://127.0.0.1:8188/api/assets' \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--header 'X-API-Key: ••••••' \
--form 'file=@"/C:/Users/aWX1183422/Downloads/left.png"' \
--form 'tags="input,yellow,world"' \
--form 'id="907b95c9-4804-fb24-81c3-2f4215ef124f"' \
--form 'preview_id="8f15b4ed-8e19-1b74-d358-90ef05f5e71b"' \
--form 'name="my asset"' \
--form 'mime_type="image/png"' \
--form 'user_metadata="{}"'
```

### Debug Logs

```powershell
upload_asset_from_temp_path failed for tmp_path=C:\Users\aWX1183422\Downloads\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\temp\uploads\d24698f5f0ed499d9146422c64a3dc02\.upload.part, owner_id=default
Traceback (most recent call last):
File "C:\Users\aWX1183422\Downloads\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\app\assets\manager.py", line 179, in upload_asset_from_temp_path
import app.assets.hashing as hashing
File "C:\Users\aWX1183422\Downloads\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\app\assets\hashing.py", line 1, in
from blake3 import blake3
ModuleNotFoundError: No module named 'blake3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\aWX1183422\Downloads\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\app\assets\api\routes.py", line 327, in upload_asset
created = manager.upload_asset_from_temp_path(
spec,
...<3 lines>...
expected_asset_hash=spec.hash,
)
File "C:\Users\aWX1183422\Downloads\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\app\assets\manager.py", line 182, in upload_asset_from_temp_path
raise RuntimeError(f"failed to hash uploaded file: {e}")
RuntimeError: failed to hash uploaded file: No module named 'blake3'
```

### Other

_No response_

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.