[Partner Nodes] feat: improve video references uploading for SeeDance 2#14098
Conversation
Signed-off-by: bigcat88 <bigcat88@icloud.com>
📝 WalkthroughWalkthroughThis PR adds a new helper function 🚥 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: 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
⛔ Files ignored due to path filters (1)
comfy_api_nodes/apis/bytedance.pyis excluded by!comfy_api_nodes/apis/**
📒 Files selected for processing (1)
comfy_api_nodes/nodes_bytedance.py
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>
3d32e64 to
bc1a218
Compare
Let's try to route the reference-video uploads in
ByteDance2ReferenceNodethrough the virtual library, mirroring the image algorithm we already use.API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms