ComfyUI nightly crash: ImportError in comfy_api/latest (ColorPrimaries removed from PyAV)
- 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
Latest nightly breaks comfy_api/latest: startup crash due to missing ColorPrimaries
Expected Behavior
ComfyUI should start normally without crashing, even when all custom nodes are disabled.
When launching ComfyUI (with or without custom nodes), the application should:
Complete the startup sequence without errors.
Load comfy_api.version_list and comfy_api.latest without import failures.
Initialize any internal video API modules (including input implementations) without raising ImportError.
In short: ComfyUI should reach the GUI (“To see the GUI go to: …”) and be usable, regardless of whether custom nodes are enabled or disabled.
### Actual Behavior
When launching ComfyUI using the latest nightly with certain video-related custom nodes enabled (for example nodes that import comfy_api.latest), ComfyUI crashes immediately during startup, before reaching the GUI.
The crash occurs inside the internal module comfy_api/latest, specifically in:
comfy_api/latest/_input_impl/video_types.py
ComfyUI (or a custom node using comfy_api.latest) attempts to import video-related constants from PyAV:
from av.video.reformatter import ColorPrimaries, ColorRange, ColorTrc
but PyAV no longer provides these symbols, resulting in:
ImportError: cannot import name 'ColorPrimaries'
This causes ComfyUI to terminate instantly during startup.
Important:
With all custom nodes disabled, ComfyUI starts correctly.
The crash only happens when custom nodes that rely on comfy_api.latest and its video input implementation are enabled.
In short:
The latest nightly introduces changes in comfy_api/latest that break compatibility with custom nodes using its video API, causing a startup crash when those nodes are present.
ComfyUI vanilla starts correctly because it does not load the new comfy_api/latest video API. However, any custom node that relies on this API triggers a crash due to missing symbols in PyAV. This indicates a regression in ComfyUI’s internal API, not an issue in the custom nodes themselves.
### Steps to Reproduce
Steps to Reproduce
1. Update ComfyUI to the latest master/nightly (commit around Aug 20–21, 2026).
2. Install or enable any custom node that uses comfy_api.latest (for example a video-related node that imports the new video input API).
3. Start ComfyUI normally: python main.py
4. ComfyUI crashes immediately during startup with the following error: ImportError: cannot import name 'ColorPrimaries' from 'av.video.reformatter'
5. Disable all custom nodes and restart ComfyUI: python main.py --disable-all-custom-nodes and ComfyUI starts correctly.
This shows that the crash is triggered when ComfyUI loads the new comfy_api.latest video API for custom nodes, not by the custom node logic itself.
### Debug Logs
```powershell
Traceback (most recent call last):
File "main.py", line 278, in
import execution
File "execution.py", line 25, in
import nodes
File "nodes.py", line 31, in
from comfy_api.version_list import supported_versions
File "comfy_api/version_list.py", line 1, in
from comfy_api.latest import ComfyAPI_latest
File "comfy_api/latest/__init__.py", line 7, in
from ._input_impl import VideoFromFile, VideoFromComponents
File "comfy_api/latest/_input_impl/__init__.py", line 1, in
from .video_types import VideoFromFile, VideoFromComponents
File "comfy_api/latest/_input_impl/video_types.py", line 3, in
from av.video.reformatter import ColorPrimaries, ColorRange, ColorTrc
ImportError: cannot import name 'ColorPrimaries' from 'av.video.reformatter'
This crash happens during startup when ComfyUI loads the new comfy_api.latest video API for custom nodes.
Disabling all custom nodes prevents the crash because ComfyUI vanilla does not load this module.
```
### Other
The issue appears to be caused by recent changes in the ComfyUI nightly that introduced a new video API inside comfy_api/latest. This API now imports symbols (ColorPrimaries, ColorRange, ColorTrc) from PyAV that are no longer available.
Custom nodes that rely on comfy_api.latest trigger the crash because ComfyUI attempts to load the new video input implementation during startup. ComfyUI vanilla does not load this module, which is why it starts correctly when all custom nodes are disabled.
This indicates a regression in ComfyUI’s internal API rather than an issue in the custom nodes themselves. A fix or rollback may be required to restore compatibility.
Contributor guide
Research direction
Start with comfy_api/latest/_input_impl/video_types.py and trace its import from comfy_api/version_list.py, then reproduce with python main.py and a custom node that uses comfy_api.latest. Compare the PyAV symbols available in av.video.reformatter with the imports, and verify that ComfyUI reaches the GUI with the affected API loaded while python main.py --disable-all-custom-nodes continues to start.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100