When the channel answered a start with something that is not JSON, such
as a block page or "404: Not Found", get_data() returned {} and the
startup cache update wrote that {} to the cache, over a list cached by
an earlier start. As an installed package the Manager reads a channel
file from the cache whenever the cache file exists, so the custom node
list and the model list of the legacy UI ended in HTTP 500 and the map
of nodes to node packs came back empty, until a later start got the
lists from the channel. "cm-cli update-cache" wrote the same {} and
then stopped with KeyError: 'custom_nodes'.
- Re-raise the parse error in get_data() when the text came from an
HTTP response, so such a response is handled like a failed
connection: both startup cache updates and cm-cli skip the file and
leave the cache as it is, and without a cached list the one bundled
with the Manager is used. A local file or cache file that is not
JSON still reads as {}
- Add tests that run the real get_data(), and the real startup cache
update and get_data_by_mode() of both servers, against a local HTTP
server
- Add a CHANGELOG entry
The same change for main is #3518. Refs #3480.
ComfyUI-Manager: Core Backend (glob)
This directory contains the Python backend modules that power ComfyUI-Manager, handling the core functionality of node management, downloading, security, and server operations.
Directory Structure
- glob/ - code for new cacheless ComfyUI-Manager
- legacy/ - code for legacy ComfyUI-Manager
Core Modules
- manager_core.py: The central implementation of management functions, handling configuration, installation, updates, and node management.
- manager_server.py: Implements server functionality and API endpoints for the web interface to interact with the backend.
Specialized Modules
- share_3rdparty.py: Manages integration with third-party sharing platforms.
Architecture
The backend follows a modular design pattern with clear separation of concerns:
- Core Layer: Manager modules provide the primary API and business logic
- Utility Layer: Helper modules provide specialized functionality
- Integration Layer: Modules that connect to external systems
Security Model
The system implements a comprehensive security framework with multiple levels:
- Block: Highest security - blocks most remote operations
- High: Allows only specific trusted operations
- Middle: Standard security for most users
- Normal-: More permissive for advanced users
- Weak: Lowest security for development environments
Implementation Details
- The backend is designed to work seamlessly with ComfyUI
- Asynchronous task queuing is implemented for background operations
- The system supports multiple installation modes
- Error handling and risk assessment are integrated throughout the codebase
API Integration
The backend exposes a REST API via manager_server.py that enables:
- Custom node management (install, update, disable, remove)
- Model downloading and organization
- System configuration
- Snapshot management
- Workflow component handling