Commit Graph
112 Commits
Author SHA1 Message Date
Sebastian Monroy 010cd6c33b update .env.example to include BRANDO_API_KEY and MINIO_ENDPOINT 2025-10-07 12:01:55 +01:00
Sebastian Monroy a29f1d411c black-formatter pass 2025-10-07 11:41:11 +01:00
Sly cfd8e2cfde feat: implement storage endpoints migration for ComfyUI nodes (#8)
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
2025-10-06 13:07:37 -07:00
Sebastian Monroy a491e6463c added comfyui-kjnodes prerequisite to README 2025-10-01 17:16:52 +01:00
Sebastian Monroy 5b8184cc33 make mediastreamoutput node have an output pin for the url it uploaded to 2025-10-01 17:15:02 +01:00
Sebastian Monroy 6b2b482b89 tweak log messages for NilorImageResizeV2 node 2025-10-01 15:37:25 +01:00
Sebastian Monroy ea13b61f21 fix MediaStreamOutput node's "fps" input being visible only when "format" input is changed to "video" 2025-10-01 15:37:08 +01:00
Sebastian Monroy 663d2dd739 replace print() statements in NilorImageResizeV2 node with logging.info statements 2025-10-01 15:25:05 +01:00
Sebastian Monroy b940ad79ea support 3 decimal places in NilorUserInput_Float node 2025-10-01 15:14:55 +01:00
Sebastian Monroy baba20c3c4 standardize logged messages, warnings, and errors 2025-10-01 14:34:15 +01:00
Sebastian Monroy f3dbe8a3ed black-formatter pass 2025-10-01 14:29:40 +01:00
Sebastian Monroy cb9a98edf1 import ImagePadKJ from kijai library for NilorImageResizeV2 2025-10-01 14:29:14 +01:00
Sebastian Monroy e8ee057dbe new NilorWanFrameTrim node 2025-10-01 14:28:27 +01:00
Sebastian Monroy 5f7d00560b update requirements.txt to prevent installation error 2025-10-01 13:39:10 +01:00
stephennilor 90e812b0c3 add forked kj resize node 2025-10-01 18:47:54 +08:00
Sebastian Monroy 51777e3462 feat(workers): include required fields in status updates; honor optional status_policy
- 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
2025-09-26 16:06:33 +01:00
Sebastian Monroy 7806a92772 logging improvements for worker_consumer.py 2025-09-25 16:59:38 +01:00
Sebastian Monroy a42221565d refactor(nilor-nodes): adopt content_id in worker_consumer and MediaStreamOutput
- read `content_id` from job payloads in `worker_consumer.py` (replace `client_id`)
- rename internal mappings (e.g., `prompt_id_to_content_id_map`)
- MediaStreamOutput: require `content_id` input (replace `job_id`)
- completion messages: `{ "content_id": <uuid>, "status": "completed", "outputs": { ... } }`
- web widget: hide `content_id` instead of `job_id`
- BREAKING CHANGE: older payloads with `job_id`/`client_id` are no longer accepted
2025-09-25 16:10:06 +01:00
Sebastian Monroy 75a45c6c34 further improve logging everywhere, using thinspace instead of brackets to fix terminal rendering, including all raised errors 2025-09-25 11:50:16 +01:00
Sebastian Monroy 414679c676 simplified the logging when worker_consumer.py fails to initialize SQS, improved logging everywhere 2025-09-25 11:30:25 +01:00
Sebastian Monroy 5af42118fe add SQS_ENABLED flag to .env to toggle SQS functionality related to worker_consumer.py 2025-09-25 11:02:48 +01:00
Sebastian Monroy 7bc6116a12 NilorWanTileResolution: added MIN_TILE_AREA constant of 384x384 2025-09-25 10:15:07 +01:00
stephennilor 08e2d39d76 add tile size preference to wan tile node 2025-09-25 14:54:35 +08:00
Sebastian Monroy 803fca81f7 fix __init__.py so all nodes show up 2025-09-24 15:29:03 +01:00
Sebastian Monroy b44a66bf03 feat(nilornodes): add tile resolution helper node
- implement NilorWanTileResolution node with validated maximal tile selection
- register the helper within node mappings and display names
2025-09-24 15:28:53 +01:00
Sebastian Monroy 35428a8287 black formatter pass on all python scripts 2025-09-10 14:47:43 +01:00
Sebastian Monroy 41372155c1 fix requirements.txt 2025-09-09 11:14:22 +01:00
Sebastian Monroy 04ac2b655a set up websocket connection with ComfyUI so that it can report whether it has started a ComfyUI job, and then set job status to "running" via the queue 2025-09-08 14:33:55 +01:00
Sebastian Monroy cc9056e11c implement status update publishing to SQS
-   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
2025-09-08 12:16:57 +01:00
Sebastian Monroy 19c693168b new NilorGroup controller node, updated _hook names to be more indicative of the fact that groups and presets are both types of controllers which accept the same hooks from the same UserInput nodes 2025-09-04 15:49:11 +01:00
Sebastian Monroy 66d6318b9a typo in preset node name 2025-09-04 12:17:58 +01:00
Sebastian Monroy a94814e632 dynamically growing/shrinking _preset_hook pins on the preset controller node 2025-09-04 12:17:23 +01:00
Sebastian Monroy c2edf563f9 preset controller: initial code for nodes (WIP) 2025-09-04 11:53:12 +01:00
Sebastian Monroy ccb2b14dfa updated MediaStreamOutput so that each instance of the node ONLY sends the dictionary related to its own output, rather than sending the entire final_outputs_dict
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.
2025-09-02 14:53:28 +01:00
Sebastian Monroy d2ae46d3c2 update requirements.txt 2025-09-02 12:26:07 +01:00
Sebastian Monroy 5f723ae82d MediaStream: hide inputs conditionally using js scripts 2025-09-01 18:11:09 +01:00
Sebastian Monroy feedc4a002 add support for a "framerate" input to the MediaStreamOutput node 2025-09-01 18:10:50 +01:00
Sebastian Monroy 0d6ea9f00c new NilorUserInput_Boolean node 2025-09-01 17:43:24 +01:00
Sebastian Monroy 55d83abed0 Remove mask output from MediaStreamInput
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.
2025-09-01 13:59:53 +01:00
Sebastian Monroy 85e28d01d5 implement two-phase download for image batches
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.
2025-09-01 13:55:50 +01:00
Sebastian Monroy b091d3057b MediaStreamInput: add "image_batch" option to format input, which downloads a video and outputs as tensor batch (WIP) 2025-09-01 10:36:20 +01:00
Sebastian Monroy f731a55292 made default values of now-un-hidden inputs for MediaStream nodes indicate that they do not need editing by the user 2025-08-25 13:44:59 +01:00
Sebastian Monroy 5e2aa12434 unhid some MediaSteam node inputs because they're required to be visible to appear in exported workflow API .jsons 2025-08-25 13:21:48 +01:00
Sebastian Monroy a76949e628 add "format" field to MediaStreamInput node 2025-08-22 13:42:42 +01:00
Sebastian Monroy afc68ccded hide more MediaStream fields for better UX 2025-08-18 11:10:48 +01:00
Sebastian Monroy 778ed5272f feat: Implement static naming for I/O contract (WIP)
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.
2025-08-13 17:09:52 +01:00
Sebastian Monroy e5b165605a update README and .env.example 2025-08-11 13:52:32 +01:00
Sebastian Monroy 2387d0e0ad update worker_consumer.py to work with new SQS requirements and update .env.example 2025-08-08 16:54:09 +01:00
Sebastian Monroy 67c5159cfc decouple ComfyUI workers from Brain API by introducing a second SQS queue to mediate job completion reporting, update requirements.txt and .env.example 2025-08-08 16:07:03 +01:00
Sebastian Monroy dd9e13e148 4.1: added support for job completion webhook payloads to media_stream nodes. 2025-08-04 14:59:03 +01:00