[Partner Nodes] feat(Luma): add support for Luma Rays 3.2#14540
Conversation
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
comfy_api_nodes/nodes_luma.py (1)
1334-1334: 🏗️ Heavy liftAvoid blocking the async worker while encoding uploaded videos.
These new long-video paths await
upload_video_to_comfyapi, whose helper serializes the input with synchronousvideo.save_to(...)before the upload; 18–30s inputs can block the event loop. Prefer moving that encode/duration probe intoasyncio.to_threador an equivalent executor, ideally insideupload_video_to_comfyapi. Based on learnings, newly introduced synchronous CPU/IO-heavy work insidecomfy_api_nodesasync execute paths should be offloaded.Also applies to: 1387-1387
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@comfy_api_nodes/nodes_luma.py` at line 1334, The call to upload_video_to_comfyapi contains blocking synchronous I/O operations like video.save_to() that can take 18-30 seconds and block the async event loop. Refactor the upload_video_to_comfyapi function to offload the synchronous encode/duration probe work using asyncio.to_thread() or an equivalent executor to prevent blocking the worker thread. Ensure this refactoring applies to all occurrences where upload_video_to_comfyapi is called in the new long-video paths throughout the file.Source: Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@comfy_api_nodes/nodes_luma.py`:
- Line 1051: The validate_string function calls in the Ray 3.2 execute paths use
strip_whitespace=False, which allows prompts containing only whitespace to pass
validation despite being effectively empty when sent to the Luma API. To match
the existing Luma UNI-1 validation behavior, either remove the
strip_whitespace=False parameter to use the default whitespace stripping
behavior, or explicitly set strip_whitespace=True. Apply this change to all
validate_string calls for prompt parameters at the specified line locations
(1051, 1105, 1232, 1329, 1384, and 1454).
- Around line 1330-1341: Remove the hardcoded duration logic in the try/except
block (lines 1330-1332) that calculates and sets duration to either "5s" or
"10s". Since the Luma2VideoOptions class accepts duration as an optional
parameter and the API should inherit the source video's duration for video_edit
type requests, omit the duration parameter entirely when constructing
Luma2VideoOptions for this request path. Delete the duration variable assignment
and simply remove duration from the Luma2VideoOptions initialization.
---
Nitpick comments:
In `@comfy_api_nodes/nodes_luma.py`:
- Line 1334: The call to upload_video_to_comfyapi contains blocking synchronous
I/O operations like video.save_to() that can take 18-30 seconds and block the
async event loop. Refactor the upload_video_to_comfyapi function to offload the
synchronous encode/duration probe work using asyncio.to_thread() or an
equivalent executor to prevent blocking the worker thread. Ensure this
refactoring applies to all occurrences where upload_video_to_comfyapi is called
in the new long-video paths throughout the file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9b3df748-7bca-42fd-9237-e25de76dc70a
⛔ Files ignored due to path filters (1)
comfy_api_nodes/apis/luma.pyis excluded by!comfy_api_nodes/apis/**
📒 Files selected for processing (1)
comfy_api_nodes/nodes_luma.py
Signed-off-by: bigcat88 <bigcat88@icloud.com>
f2e7fa5 to
12eae7c
Compare
PR adds 7 new nodes for the new Luma Ray 3.2 video model
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms