feat: migrate ComfyUI nodes from presigned URLs to Brain API storage endpoints
## Core Architecture Changes
- Add new BrainApiClient for direct Brain API communication
- Replace presigned URL workflow with storage_id/filename pattern
- Update MediaStreamInput to use storage_id + filename instead of presigned_download_url
- Update MediaStreamOutput to use storage_id + filename instead of presigned_upload_url
## Brain API Client Implementation
- Add comprehensive BrainApiClient with authentication and error handling
- Implement get_presigned_upload_url() and get_presigned_download_url() methods
- Add proper Bearer token authentication for Brain API requests
- Include environment variable configuration for Brain API endpoint and credentials
## Media Stream Node Updates
- Refactor MediaStreamInput to request presigned URLs from Brain API using storage_id
- Update MediaStreamOutput to upload directly to MinIO using Brain API presigned URLs
- Simplify node interface by removing presigned URL inputs from workflow templates
- Update JavaScript frontend to hide system inputs and manage node UI state
## Infrastructure Improvements
- Add .idea/ to .gitignore for IDE file exclusions
- Update user_input.py to use new storage_id pattern
- Streamline web interface JavaScript for cleaner node management
- copy content_id, venue, canvas, scene from job payload into status updates
- use running_status for first progress; fail_status on execution errors (fallbacks preserved)
- manage per-content context lifecycles
- Adds configuration for the new `job_status_updates` queue in the worker consumer.
- After successfully submitting a job to the local ComfyUI instance, the worker publishes a message with `{"status": "running"}`.
- Includes a critical check for `client_id` in the workflow data to ensure a job ID is present before publishing.
- Logs a warning and skips the update if `client_id` is missing, preventing silent failures.
- Errors during the status update publication are logged but do not interrupt the primary job, maintaining system resilience.
- Update .env.example
The purpose of this code is to notify the backend that a specific output file has been successfully generated and uploaded. The backend (ComfyUIContentHandler) needs to know which output file this message corresponds to.
The original code sent the entire final_outputs_dict. This would work, but it's inefficient and sends redundant information. If a workflow has five MediaStreamOutput nodes, each one would send a completion message containing the information for all five outputs. The backend would receive five identical messages.
The new code is more precise. It filters the dictionary to include only the key-value pair for the output it just handled. This is a much cleaner and more correct approach. It ensures that each completion message is atomic and only contains the information relevant to the event that triggered it.
Removes the MASK output from the MediaStreamInput node to simplify its API and align with the capabilities of the Brain API server.
- The `RETURN_TYPES` is now just `("IMAGE",)`.
- All internal processing methods (`_process_image`, `_process_video`, `_process_image_batch`) have been updated to no longer extract or generate mask data.
- This change simplifies the node's logic and removes an unused feature, improving maintainability.
feat:
- Add image_batch format support to MediaStreamInput node INPUT_TYPES
- Implement two-phase download: fetch manifest first, then download individual assets
- Add _process_image_batch method for converting multiple images to tensor batches
- Sort assets by sequence number from manifest to maintain proper ordering
- Add comprehensive error handling for network failures during asset downloads
- Preserve backward compatibility for existing single-file image and video workflows
- Create proper tensor concatenation along batch dimension for ComfyUI processing
- Handle varying image formats and alpha channels within batches consistently
- Add detailed logging for manifest processing and batch creation debugging
Completes Phase 4 of multi-image support plan enabling end-to-end batch processing from brain_rnd manifest generation to ComfyUI tensor consumption.
This commit aligns the nilor-nodes with the project's new unified, name-based I/O system, as specified in the workflow override fix plan. This change establishes a stable, human-readable API contract for all workflows, replacing the previous fragile node-ID-based system.
Key Changes:
- **`MediaStreamInput` & `NilorUserInput`**: Added a static, non-overridable `input_name` string widget. Workflow authors now assign a logical name to each input, which is used by the Brain API to inject data.
- **`MediaStreamOutput`**: Added a static `output_name` widget. This provides a stable key for the Brain API to identify and retrieve specific outputs.
- **`MediaStreamOutput` (Logic)**: Corrected the completion logic to properly parse the full dictionary of named outputs it receives from the Brain API, ensuring it sends the correct, complete payload upon job completion.
These changes are a critical part of the larger refactor to improve the security, scalability, and maintainability of the ComfyUI integration.