[PR #19] [MERGED] Add VIDEO input encoder to close the encode-side gap #18

Closed
opened 2026-10-26 22:28:57 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-remote-nodes/pull/19
Author: @Kosinkadink
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/17/2026
Merged by: @Kosinkadink

Base: main ← Head: feat/video-input-encoder


📝 Commits (1)

  • 04ca70a Add VIDEO input encoder to close the encode-side gap

📊 Changes

2 files changed (+60 additions, -1 deletions)

View changed files

📝 proxy_node.py (+4 -0)
📝 serialization.py (+56 -1)

📄 Description

Wires the VIDEO encode direction in the proxy_node, closing the gap noted at serialization.py:468 (# Video decode (encode lands when a remote node accepts VIDEO inputs)). Previously _encode_one only dispatched AUDIO + IMAGE + MASK, so any remote node declaring an IO.Video.Input would receive the raw VideoInput object as a non-JSON-serialisable value — most notably the shipped-but-broken GrokVideoEditProvider / GrokVideoExtendProvider paths.

Changes

  • serialization.py: added encode_video_input(video) (mirrors the AUDIO encoder — re-encodes to mp4/H.264 via the upstream comfy_api_nodes/util/conversions.video_to_base64_string, base64-encodes the result, populates duration_s from video.get_duration() so server-side _validate_video_duration_envelope can range-check without demuxing).
  • serialization.py: added is_video_input(value) (duck-types on the save_to + get_duration method pair — both defined on comfy_api.latest._input.VideoInput and present on every concrete subclass; avoids importing VideoInput at module load to keep the no-torch smoke-test pattern intact).
  • Both helpers added to __all__.
  • proxy_node.py: _encode_one gains a VIDEO branch right after the AUDIO branch (mirrors the AUDIO call shape). Docstring of _inputs_to_envelopes updated to mention the new VIDEO duck-type rule.

Why

Symmetric to the (still-open) MODEL_3D INPUT gap noted at serialization.py:484. AUDIO INPUT was already wired (ElevenLabs nodes exercise it end-to-end); IMAGE / MASK have always been wired; VIDEO INPUT closes today's last input-direction envelope gap for the existing capability vocabulary.

Unlocks:

  • Existing GrokVideoEditProvider / GrokVideoExtendProvider (server side already advertised VIDEO_MP4_BASE64 capability + input_serialization={"video": "mp4_base64"}).
  • New server-side Wan2VideoContinuationApi_RNP provider landing in the matching comfy-rnp-server PR (it consumes first_clip: VIDEO).
  • Future ByteDance / Wan / Kling VIDEO-input ports (~12 nodes total).

Verification

Imported serialization with stubbed comfy_remote_nodes package:

  • is_video_input(None) → False
  • is_video_input({}) → False
  • is_video_input(audio_dict) → False
  • is_video_input(stub with save_to + get_duration) → True
  • is_audio_input(audio_dict) → True (unchanged)

Additional end-to-end verification rides on the matching comfy-rnp-server PR which adds the first new VIDEO-input consumer (Wan2VideoContinuationApi_RNP).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-remote-nodes/pull/19 **Author:** [@Kosinkadink](https://github.com/Kosinkadink) **Created:** 5/17/2026 **Status:** ✅ Merged **Merged:** 5/17/2026 **Merged by:** [@Kosinkadink](https://github.com/Kosinkadink) **Base:** `main` ← **Head:** `feat/video-input-encoder` --- ### 📝 Commits (1) - [`04ca70a`](https://github.com/Comfy-Org/comfy-remote-nodes/commit/04ca70a853d9c71ec9ef6324fbb0209d1addb283) Add VIDEO input encoder to close the encode-side gap ### 📊 Changes **2 files changed** (+60 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `proxy_node.py` (+4 -0) 📝 `serialization.py` (+56 -1) </details> ### 📄 Description Wires the VIDEO encode direction in the proxy_node, closing the gap noted at `serialization.py:468` (`# Video decode (encode lands when a remote node accepts VIDEO inputs)`). Previously `_encode_one` only dispatched AUDIO + IMAGE + MASK, so any remote node declaring an `IO.Video.Input` would receive the raw `VideoInput` object as a non-JSON-serialisable value — most notably the shipped-but-broken `GrokVideoEditProvider` / `GrokVideoExtendProvider` paths. ## Changes - `serialization.py`: added `encode_video_input(video)` (mirrors the AUDIO encoder — re-encodes to mp4/H.264 via the upstream `comfy_api_nodes/util/conversions.video_to_base64_string`, base64-encodes the result, populates `duration_s` from `video.get_duration()` so server-side `_validate_video_duration_envelope` can range-check without demuxing). - `serialization.py`: added `is_video_input(value)` (duck-types on the `save_to` + `get_duration` method pair — both defined on `comfy_api.latest._input.VideoInput` and present on every concrete subclass; avoids importing `VideoInput` at module load to keep the no-torch smoke-test pattern intact). - Both helpers added to `__all__`. - `proxy_node.py`: `_encode_one` gains a VIDEO branch right after the AUDIO branch (mirrors the AUDIO call shape). Docstring of `_inputs_to_envelopes` updated to mention the new VIDEO duck-type rule. ## Why Symmetric to the (still-open) MODEL_3D INPUT gap noted at `serialization.py:484`. AUDIO INPUT was already wired (ElevenLabs nodes exercise it end-to-end); IMAGE / MASK have always been wired; VIDEO INPUT closes today's last input-direction envelope gap for the existing capability vocabulary. Unlocks: - Existing `GrokVideoEditProvider` / `GrokVideoExtendProvider` (server side already advertised `VIDEO_MP4_BASE64` capability + `input_serialization={"video": "mp4_base64"}`). - New server-side `Wan2VideoContinuationApi_RNP` provider landing in the matching `comfy-rnp-server` PR (it consumes `first_clip: VIDEO`). - Future ByteDance / Wan / Kling VIDEO-input ports (~12 nodes total). ## Verification Imported `serialization` with stubbed `comfy_remote_nodes` package: - `is_video_input(None)` → False - `is_video_input({})` → False - `is_video_input(audio_dict)` → False - `is_video_input(stub with save_to + get_duration)` → True - `is_audio_input(audio_dict)` → True (unchanged) Additional end-to-end verification rides on the matching `comfy-rnp-server` PR which adds the first new VIDEO-input consumer (`Wan2VideoContinuationApi_RNP`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:28:57 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-remote-nodes#18
No description provided.