Skip to content

[Partner Nodes] feat: improve video references uploading for SeeDance 2#14098

Merged
Kosinkadink merged 3 commits into
masterfrom
feat/api-nodes/bytedance-reference-video
May 27, 2026
Merged

[Partner Nodes] feat: improve video references uploading for SeeDance 2#14098
Kosinkadink merged 3 commits into
masterfrom
feat/api-nodes/bytedance-reference-video

Conversation

@bigcat88
Copy link
Copy Markdown
Contributor

@bigcat88 bigcat88 commented May 25, 2026

Let's try to route the reference-video uploads in ByteDance2ReferenceNode through the virtual library, mirroring the image algorithm we already use.

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 May 25, 2026 15:14
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a new helper function _seedance_virtual_library_upload_video_asset to handle video uploads into Seedance's virtual library. The helper serializes input videos to MP4 format, computes a SHA-256 hash of the serialized bytes, uploads to ComfyAPI, registers a virtual-library asset with the computed hash, polls until the asset becomes active, and returns an asset:// URI. The imports are updated to include BytesIO and Types. In ByteDance2ReferenceNode, reference video uploads now use this new helper instead of direct ComfyAPI calls, so generated task content comes from virtual-library assets.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: improving video reference uploads for ByteDance 2 through virtual library routing, which directly corresponds to the changeset.
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 PR description clearly describes routing reference-video uploads through the virtual library to mirror existing image upload patterns.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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_bytedance.py`:
- Around line 318-321: The code computes video_hash by calling
hashlib.sha256(buf.getvalue()), which copies the whole encoded video into
memory; change this to hash the buffer without copying by using buf.getbuffer()
(e.g., pass buf.getbuffer() into hashlib.sha256) after the video.save_to call so
video_hash is computed efficiently; update the line that assigns video_hash in
comfy_api_nodes/nodes_bytedance.py to use buf.getbuffer() and keep the
subsequent call to upload_video_to_comfyapi unchanged.
🪄 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: 15e05c7d-5d8e-4be8-ba20-bd8a8b802d91

📥 Commits

Reviewing files that changed from the base of the PR and between 0077d78 and e3b8436.

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

Comment thread comfy_api_nodes/nodes_bytedance.py
bigcat88 added a commit that referenced this pull request May 25, 2026
getvalue() copies the BytesIO contents into a new bytes object before
sha256 consumes it; getbuffer() returns a memoryview that shares the
underlying buffer with no copy. Marginal but free win on memory peak.

Per coderabbit review on #14098.
Signed-off-by: bigcat88 <bigcat88@icloud.com>
@bigcat88 bigcat88 force-pushed the feat/api-nodes/bytedance-reference-video branch from 3d32e64 to bc1a218 Compare May 25, 2026 17:43
@Kosinkadink Kosinkadink merged commit 0cce76d into master May 27, 2026
22 checks passed
@bigcat88 bigcat88 deleted the feat/api-nodes/bytedance-reference-video branch May 27, 2026 08:02
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