Skip to content

[Partner Nodes] feat: add Runway Aleph2 node#14306

Merged
Kosinkadink merged 2 commits into
masterfrom
feat/api-nodes/runway-aleph2
Jun 12, 2026
Merged

[Partner Nodes] feat: add Runway Aleph2 node#14306
Kosinkadink merged 2 commits into
masterfrom
feat/api-nodes/runway-aleph2

Conversation

@bigcat88

@bigcat88 bigcat88 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Nodes for this endpoint: https://docs.dev.runwayml.com/api/#tag/Start-generating/paths/~1v1~1video_to_video/post

API Node PR Checklist

Scope

  • Is API Node Change

Pricing & Billing

  • Need pricing update
  • No pricing update

If Need pricing update:

  • Metronome rate cards updated
  • Auto‑billing tests updated and passing

QA

  • QA done
  • QA not required

Comms

  • Informed Kosinkadink

@bigcat88 bigcat88 marked this pull request as ready for review June 12, 2026 16:44
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds Aleph2 video-to-video editing support to the Runway node collection. It introduces three new node classes—Keyframe, Prompt Image, and Video-to-Video—that enable timeline-aware guidance images for video generation. The implementation validates constraints (prompt length, video duration, fps caps), uploads videos and guidance images, constructs Aleph2 request payloads, polls for task completion, and downloads results. Simultaneously, the PR refactors progress extraction into get_response and migrates exception handling from the removed RunwayApiError to ValueError across existing nodes.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding Runway Aleph2 node support. It is specific, concise, and directly reflects the primary purpose of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is related to the changeset, referencing the Runway Aleph2 endpoint and including a relevant API Node PR Checklist.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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_runway.py`:
- Around line 789-815: Validate all Aleph2 inputs (keyframes and prompt_images)
before calling upload_video_to_comfyapi or upload_image_to_comfyapi: first check
keyframes is not None and enforce len(keyframes.items) <= 5 and call
_check_seconds for each KEYFRAME_MODE_SECONDS item, and similarly validate
prompt_images length and timestamps/percentages for PROMPT_IMAGE_MODE_TIMESTAMP
before any uploads; only after these validations pass, call
upload_video_to_comfyapi and then upload_image_to_comfyapi for each item to
build keyframe_models and prompt_image_models so failed/invalid requests never
trigger uploads. Ensure references to upload_video_to_comfyapi,
upload_image_to_comfyapi, keyframes, prompt_images, and _check_seconds are used
to locate and reorder the logic.
🪄 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

Run ID: 4b13f73b-2385-4493-a9e4-735d92a0265d

📥 Commits

Reviewing files that changed from the base of the PR and between d7a5527 and 370d59c.

⛔ Files ignored due to path filters (1)
  • comfy_api_nodes/apis/runway.py is excluded by !comfy_api_nodes/apis/**
📒 Files selected for processing (1)
  • comfy_api_nodes/nodes_runway.py

Comment on lines +789 to +815
video_url = await upload_video_to_comfyapi(cls, video)

keyframe_models: list[RunwayAleph2KeyframeSeconds | RunwayAleph2KeyframeAt] = []
if keyframes is not None:
if len(keyframes.items) > 5:
raise ValueError("Aleph2 supports at most 5 keyframes.")
for item in keyframes.items:
image_url = await upload_image_to_comfyapi(cls, item.image, mime_type="image/png")
if item.mode == KEYFRAME_MODE_SECONDS:
_check_seconds(item.value, "Keyframe timestamp")
keyframe_models.append(RunwayAleph2KeyframeSeconds(seconds=item.value, uri=image_url))
else:
keyframe_models.append(RunwayAleph2KeyframeAt(at=item.value, uri=image_url))

prompt_image_models: list[RunwayAleph2PromptImage] = []
if prompt_images is not None:
if len(prompt_images.items) > 5:
raise ValueError("Aleph2 supports at most 5 prompt images.")
for item in prompt_images.items:
image_url = await upload_image_to_comfyapi(cls, item.image, mime_type="image/png")
position: RunwayAleph2TimestampPosition | RunwayAleph2RelativePosition
if item.mode == PROMPT_IMAGE_MODE_TIMESTAMP:
_check_seconds(item.value, "Prompt image timestamp")
position = RunwayAleph2TimestampPosition(timestampSeconds=item.value)
else:
position = RunwayAleph2RelativePosition(positionPercentage=item.value)
prompt_image_models.append(RunwayAleph2PromptImage(position=position, uri=image_url))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Finish validating Aleph2 inputs before the first upload.

Line 789 uploads the source video, and Lines 796/808 upload guidance images, before this method rejects too many items or out-of-range timestamps. Invalid requests currently pay the full upload cost for assets that will never be used.

♻️ Suggested flow
-        video_url = await upload_video_to_comfyapi(cls, video)
-
-        keyframe_models: list[RunwayAleph2KeyframeSeconds | RunwayAleph2KeyframeAt] = []
-        if keyframes is not None:
-            if len(keyframes.items) > 5:
-                raise ValueError("Aleph2 supports at most 5 keyframes.")
+        if keyframes is not None and len(keyframes.items) > 5:
+            raise ValueError("Aleph2 supports at most 5 keyframes.")
+        if prompt_images is not None and len(prompt_images.items) > 5:
+            raise ValueError("Aleph2 supports at most 5 prompt images.")
+
+        for item in keyframes.items if keyframes is not None else []:
+            if item.mode == KEYFRAME_MODE_SECONDS:
+                _check_seconds(item.value, "Keyframe timestamp")
+        for item in prompt_images.items if prompt_images is not None else []:
+            if item.mode == PROMPT_IMAGE_MODE_TIMESTAMP:
+                _check_seconds(item.value, "Prompt image timestamp")
+
+        video_url = await upload_video_to_comfyapi(cls, video)
+
+        keyframe_models: list[RunwayAleph2KeyframeSeconds | RunwayAleph2KeyframeAt] = []
+        if keyframes is not None:
             for item in keyframes.items:
                 image_url = await upload_image_to_comfyapi(cls, item.image, mime_type="image/png")
-                if item.mode == KEYFRAME_MODE_SECONDS:
-                    _check_seconds(item.value, "Keyframe timestamp")
+                if item.mode == KEYFRAME_MODE_SECONDS:
                     keyframe_models.append(RunwayAleph2KeyframeSeconds(seconds=item.value, uri=image_url))

As per coding guidelines, comfy_api_nodes/** reviews should focus on proper error handling for API failures.

🤖 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_runway.py` around lines 789 - 815, Validate all Aleph2
inputs (keyframes and prompt_images) before calling upload_video_to_comfyapi or
upload_image_to_comfyapi: first check keyframes is not None and enforce
len(keyframes.items) <= 5 and call _check_seconds for each KEYFRAME_MODE_SECONDS
item, and similarly validate prompt_images length and timestamps/percentages for
PROMPT_IMAGE_MODE_TIMESTAMP before any uploads; only after these validations
pass, call upload_video_to_comfyapi and then upload_image_to_comfyapi for each
item to build keyframe_models and prompt_image_models so failed/invalid requests
never trigger uploads. Ensure references to upload_video_to_comfyapi,
upload_image_to_comfyapi, keyframes, prompt_images, and _check_seconds are used
to locate and reorder the logic.

Source: Coding guidelines

@Kosinkadink Kosinkadink merged commit 28a40fb into master Jun 12, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants