Harden route handlers against malformed requests:
Store entry route (PUT):
- Validate name is non-empty and under 128 chars
- Verify request body is a JSON object, not array or primitive
- Return clear error messages for each validation failure
Background stat route (GET):
- Handle os.path.getmtime() failures (permissions, race conditions)
- Log file stat errors for debugging
- Return appropriate HTTP status codes
Prevents crashes from malicious or malformed API requests.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Wrap imports in try-except blocks to provide clear error messages:
- Node imports: log helpful message if ComfyUI dependencies missing
- PromptServer import: log warning if server unavailable
- Export empty mappings instead of crashing ComfyUI startup
This allows the extension to fail gracefully when dependencies
are unavailable (e.g., during testing or accidental standalone
execution) while still providing diagnostic information.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Add practical documentation that helps users:
Usage section:
- Where to find nodes in the menu
- How to connect the nodes
- What output to expect
Troubleshooting section:
- Nodes not appearing (installation issues)
- Route/store errors (usually harmless)
- Background image not updating (connection issues)
- Workflow compatibility (breaking changes prevention)
Reduces user friction and provides self-service solutions
for common setup problems.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Implement CI pipeline that runs on push and pull requests:
Python checks (3.10, 3.11, 3.12):
- Lint with flake8 (syntax errors and code quality)
- Compile all Python modules
- Run unit test suite
JavaScript checks:
- Validate syntax of all JS files with Node.js
This ensures code quality and catches issues before they reach users.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Implement 10 unit tests covering:
- Name validation (valid and invalid patterns)
- Save, load, and delete operations
- Multiple entries and overwrites
- Empty buckets and non-existent entries
- Invalid bucket names
- Persistence across reloads
Tests use unittest (stdlib) and mock folder_paths dependency,
ensuring the store logic is reliable without ComfyUI runtime.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Prevent crashes when users provide invalid JSON or malformed bbox data:
- Catch TypeError and ValueError in addition to JSONDecodeError
- Handle non-numeric bbox coordinates gracefully with try-except
- Fall back to default positioning when bbox parsing fails
This protects users from workflow crashes due to corrupted or
hand-edited JSON input.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Fork of KJNodes' Ideogram 4 Prompt Builder with stores, multi-select, scene save/load, live background preview, and separate width/height outputs.
Co-authored-by: Cursor <cursoragent@cursor.com>