[Partner Nodes] feat(LTX): add new nodes for model version 2.5 - #15501
Conversation
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
📝 WalkthroughWalkthroughAdds LTX 2.5 text-to-video, image-to-video, and audio-to-video API nodes. The nodes validate model settings and media inputs, upload images or audio, submit asynchronous jobs, poll job status, and download video outputs. The changes add model-specific pricing and optional frame inputs. Existing LTX 2.0 text-to-video and image-to-video nodes are marked deprecated. All three LTX 2.5 nodes are registered in the extension. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
…ombobox Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
d048f88
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
comfy_api_nodes/nodes_ltxv.py (2)
38-79: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy liftKeep the partner workflow inline in each node.
_v25_submit_and_pollcentralizes the submit, poll, status-check, and download flow. Keep this flow in each LTX 2.5executemethod. This convention keeps partner nodes independently readable and editable.Based on learnings, API node
executeimplementations should keep the full submit → poll → status-check → download flow inline unless a concrete correctness or security issue requires sharing it.🤖 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_ltxv.py` around lines 38 - 79, Remove the shared _v25_submit_and_poll helper and inline its complete submit, poll, missing-video validation, and download flow directly into each LTX 2.5 node execute method. Preserve the existing endpoints, response models, retry behavior, status extraction, error message, and video output handling while keeping each partner workflow independently readable.Source: Learnings
396-427: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy liftAdd tests for the new LTX 2.5 paths.
This PR adds validation, seed controls, media uploads, request submission, polling, and downloads without test changes. Add mocked tests for all three nodes. Cover invalid long-duration settings, request payloads, upload failures, terminal job failures, missing video URLs, downloads, and seed-driven re-execution.
As per path instructions, test new validation, request/polling, media upload, seed, and download paths.
Also applies to: 449-496, 533-579
🤖 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_ltxv.py` around lines 396 - 427, Add mocked tests covering the new LTX 2.5 flows in the three node classes, including validation of invalid long-duration settings, request payload construction, media-upload failures, terminal job failures, missing video URLs, successful downloads, and seed-driven re-execution. Exercise the relevant execute and submission/polling helpers for all three nodes, reusing existing test mocking patterns and covering validation, upload, seed, and download paths.Source: Path instructions
🤖 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_ltxv.py`:
- Around line 213-217: Update _v25_validate_settings so durations over 10
seconds require fps to be exactly 24 or 25 and resolution to be one of the four
allowed 720p/1080p values (2560x1440, 1440x2560, 3840x2160, or 2160x3840);
reject all other combinations while preserving validation for shorter durations.
---
Outside diff comments:
In `@comfy_api_nodes/nodes_ltxv.py`:
- Around line 38-79: Remove the shared _v25_submit_and_poll helper and inline
its complete submit, poll, missing-video validation, and download flow directly
into each LTX 2.5 node execute method. Preserve the existing endpoints, response
models, retry behavior, status extraction, error message, and video output
handling while keeping each partner workflow independently readable.
- Around line 396-427: Add mocked tests covering the new LTX 2.5 flows in the
three node classes, including validation of invalid long-duration settings,
request payload construction, media-upload failures, terminal job failures,
missing video URLs, successful downloads, and seed-driven re-execution. Exercise
the relevant execute and submission/polling helpers for all three nodes, reusing
existing test mocking patterns and covering validation, upload, seed, and
download paths.
🪄 Autofix
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: ASSERTIVE
Plan: Pro Plus
Run ID: 35c1449f-601b-434c-ac0b-eb9cd3cfcc4f
📒 Files selected for processing (1)
comfy_api_nodes/nodes_ltxv.py
📜 Review details
⏰ Context from checks skipped due to timeout. (9)
- GitHub Check: Run Pylint
- GitHub Check: test (macos-latest)
- GitHub Check: test (ubuntu-latest)
- GitHub Check: test (ubuntu-latest)
- GitHub Check: test (windows-2022)
- GitHub Check: test (macos-latest)
- GitHub Check: test (windows-latest)
- GitHub Check: test
- GitHub Check: Run Pylint
🧰 Additional context used
📓 Path-based instructions (6)
**/*
📄 CodeRabbit inference engine (AGENTS.md)
**/*: Keep changes small, direct, and limited to the narrowest necessary code path and smallest number of files.
Prefer practical fixes, minimal dependencies, and existing repository patterns; remove obsolete, dead, unreachable, or unused code.
Preserve existing APIs, node names, model-loading behavior, file layout, and workflow compatibility unless replacement is explicitly intended.
Core ComfyUI must not add outbound internet requests, telemetry, tracking, reporting, remote configuration, or background network activity. User-authorized model downloads are limited to the requested artifact and must exclude telemetry and unrelated metadata.
Files:
comfy_api_nodes/nodes_ltxv.py
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Keep state and capability flags on the object that owns the behavior. Prefer explicit parent-owned attributes over probing child objects withgetattr; use child checks only when the child owns the delegated behavior.
Preserve shared method signatures, argument order, return shapes, side effects, and error behavior unless every affected caller and interface is intentionally updated.
Do not add unused compatibility parameters, flags, attributes, constructor options, or model-specific options to shared helpers; keep one-off behavior at the integration boundary.
Normalize third-party return conventions at integration boundaries so core code receives the expected type and shape; avoid undocumented caller-side unwrapping.
Do not addtorch.no_grad,torch.inference_mode, or inference-mode wrappers. Do not add model freeze/unfreeze toggles; only disable globally enabled inference mode when a training path requires gradients.
Remove inference-only training behavior such as dropout while preserving checkpoint and state-dict compatibility; usenn.Identitywhen deleting a module would alter keys or ordering.
Keep imports at module scope except established optional-backend probes or imports required to avoid cycles; avoid unnecessarytry/exceptblocks and use specific exceptions with useful fallbacks.
Do not add workarounds for unsupported library versions, especially PyTorch exception-and-float-cast retries, unless a comment names the exact versions still requiring them.
Let unsupported model formats, invalid quantization metadata, and bad states fail with clear errors instead of silently degrading output.
Match local style, keep comments sparse and useful, and remove comments that merely restate obvious code.
Treat dtype, device placement, VRAM use, and offloading as correctness concerns across CPU, CUDA, ROCm, MPS, DirectML, XPU, NPU, and low-VRAM environments.
Prefer existing ComfyUI and Comfy Kitchen operations, quantization helpers, cast/offload helpe...
Files:
comfy_api_nodes/nodes_ltxv.py
**/*.{py,json}
📄 CodeRabbit inference engine (AGENTS.md)
Treat legacy combo,
io.Combo, andio.DynamicCombovalues affecting filesystem access as untrusted; revalidate them at load/save boundaries withfolder_paths, containment checks, or fixed allowlists.
Files:
comfy_api_nodes/nodes_ltxv.py
**/*.{py,md,txt,json}
📄 CodeRabbit inference engine (AGENTS.md)
Keep warning and info messages short and actionable, remove noisy or misleading logging, and make documentation edits concise, factual, and tied to changed behavior.
Files:
comfy_api_nodes/nodes_ltxv.py
**
⚙️ CodeRabbit configuration file
**: IMPORTANT: Only comment on issues directly introduced by this PR's code changes.
Treat AGENTS.md as mandatory repository policy, not optional style guidance.
Flag PR changes that violate AGENTS.md even when the code is otherwise functional.
In particular, enforce architecture boundaries, dtype/device/memory rules,
interface contracts, import style, no unnecessary try/except blocks, no inline
imports, no outbound internet paths in core ComfyUI, and narrow scoped fixes.
Prefer direct findings over suggestions when a rule is violated. Only ignore
AGENTS.md when it clearly conflicts with a newer explicit maintainer instruction
in the PR.
Do NOT flag pre-existing issues in code that was merely moved, re-indented,
de-indented, or reformatted without logic changes. If code appears in the diff
only due to whitespace or structural reformatting (e.g., removing awith:block),
treat it as unchanged. Contributors should not feel obligated to address
pre-existing issues outside the scope of their contribution.
Files:
comfy_api_nodes/nodes_ltxv.py
comfy_api_nodes/**
⚙️ CodeRabbit configuration file
comfy_api_nodes/**: Third-party API integration nodes. Focus on:
- No hardcoded API keys or secrets
- Proper error handling for API failures (timeouts, rate limits, auth errors)
- Correct Pydantic model usage
- Security of user data passed to external APIs
Files:
comfy_api_nodes/nodes_ltxv.py
🧠 Learnings (6)
📚 Learning: 2026-02-21T14:01:41.482Z
Learnt from: pythongosssss
Repo: Comfy-Org/ComfyUI PR: 12555
File: comfy_extras/nodes_glsl.py:719-724
Timestamp: 2026-02-21T14:01:41.482Z
Learning: In PyOpenGL, bare Python scalars can be accepted for 1-element array parameters by NumberHandler. This means you can pass an int/float directly to OpenGL texture deletion (e.g., glDeleteTextures(tex)) without wrapping in a list. Verify function-specific expectations and ensure types match what the OpenGL call expects; use explicit lists only when the API requires an array.
Applied to files:
comfy_api_nodes/nodes_ltxv.py
📚 Learning: 2026-04-18T16:55:46.724Z
Learnt from: bigcat88
Repo: Comfy-Org/ComfyUI PR: 13465
File: comfy_api_nodes/nodes_bytedance.py:1496-1506
Timestamp: 2026-04-18T16:55:46.724Z
Learning: In `comfy_api_nodes` Python async node implementations (e.g., `async def execute`), synchronous CPU/IO-heavy helpers (such as video/audio trim/resize and base64/MP3 conversion) may be called directly without offloading to a thread executor (e.g., `asyncio.to_thread`). Treat this as an existing, broader refactor concern rather than a new PR regression: if the PR does not introduce additional synchronous blocking calls, reviewers should not flag it as a new issue. However, if the PR adds new synchronous CPU/IO work inside `async def execute`, prefer offloading with `asyncio.to_thread` (or an equivalent background executor) to avoid blocking the event loop.
Applied to files:
comfy_api_nodes/nodes_ltxv.py
📚 Learning: 2026-05-07T17:59:26.050Z
Learnt from: bigcat88
Repo: Comfy-Org/ComfyUI PR: 13753
File: comfy_api_nodes/nodes_gemini.py:1148-1157
Timestamp: 2026-05-07T17:59:26.050Z
Learning: In ComfyUI node implementations under `comfy_api_nodes/`, when building JSONata expressions that use `IO.PriceBadge` for `$lookup` against a price map keyed in lowercase, do not add an explicit `$lowercase()` around widget values (e.g., combo options like "1K", "2K", "4K"). The ComfyUI frontend automatically lowercases widget values before evaluating the JSONata expression, so the lookup keys will already match the lowercase map entries.
Applied to files:
comfy_api_nodes/nodes_ltxv.py
📚 Learning: 2026-07-14T20:09:03.091Z
Learnt from: bigcat88
Repo: Comfy-Org/ComfyUI PR: 14928
File: comfy_api_nodes/nodes_sync_so.py:168-202
Timestamp: 2026-07-14T20:09:03.091Z
Learning: In the `comfy_api_nodes/` package, partner/API node `execute` implementations should keep the full submit → poll → status-check → download flow written inline within each node (even if similar logic appears across multiple nodes). This is an intentional repo convention to optimize per-node readability and independent editability, so during reviews you should generally not recommend refactoring this pattern into a shared helper function for these nodes (unless there’s a concrete correctness/security issue).
Applied to files:
comfy_api_nodes/nodes_ltxv.py
📚 Learning: 2026-07-16T16:29:35.022Z
Learnt from: bigcat88
Repo: Comfy-Org/ComfyUI PR: 14958
File: comfy_api_nodes/nodes_heygen.py:554-558
Timestamp: 2026-07-16T16:29:35.022Z
Learning: When implementing ComfyUI API nodes in this repo, for any billable HTTP POST operations, follow the established policy: keep the existing default retry behavior. Do not add idempotency keys or disable retries. The rationale is to prevent failures from aborting the entire workflow; when reviewing new API nodes, check that POST billing requests preserve the default retry configuration and remain consistent with this policy.
Applied to files:
comfy_api_nodes/nodes_ltxv.py
📚 Learning: 2026-08-04T18:49:57.785Z
Learnt from: bigcat88
Repo: Comfy-Org/ComfyUI PR: 15295
File: comfy_api_nodes/nodes_bfl.py:1037-1051
Timestamp: 2026-08-04T18:49:57.785Z
Learning: When consuming dictionaries produced by IO.Autogrow.Type, rely on their iteration order to match the configured template-slot order. This ordering is preserved by _expand_schema_for_dynamic, parse_class_inputs, and build_nested_inputs, so consumers should iterate the dictionary directly when processing dynamic slots.
Applied to files:
comfy_api_nodes/nodes_ltxv.py
🔇 Additional comments (1)
comfy_api_nodes/nodes_ltxv.py (1)
117-118: LGTM!Also applies to: 141-156, 173-196, 201-210, 589-591
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms