Skip to content

feat: doubao add first and last image to video - #2756

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/bae1c6025ed4c65bf72572ff8684dd7ef068e576
Feb 2, 2026
Merged

feat: doubao add first and last image to video#2756
seefs001 merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/bae1c6025ed4c65bf72572ff8684dd7ef068e576

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Jan 27, 2026

Copy link
Copy Markdown
Member

豆包视频支持首尾帧生视频, 增加role字段
文档: https://www.volcengine.com/docs/82379/1520757
image

Summary by CodeRabbit

  • New Features
    • Enhanced content items with role identification to better handle different media types (e.g., reference images, first frame, last frame).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

A new Role string field has been added to the ContentItem struct in the Doubao adaptor module. This field uses the JSON tag role,omitempty to support serialization of role values (such as reference_image, first_frame, or last_frame) for content items.

Changes

Cohort / File(s) Summary
Struct field addition
relay/channel/task/doubao/adaptor.go
Added Role string field with JSON tag role,omitempty to ContentItem struct to support role identification in content serialization

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • creamlike1024

Poem

🐰 A role for each item, so fine and so clear,
With a humble omitempty, no need to fear,
The ContentItem hops with new purpose today,
Reference or frame—now it has its way! 🎬✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding support for first and last image frames in the doubao video feature through a new 'role' field.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
relay/channel/task/doubao/adaptor.go (1)

224-244: Add validation to prevent data: URLs from being used as image inputs.

Images from req.Images (lines 226-233) should be validated to prevent data: URLs, consistent with the pattern used in controller/task_video.go and vertex/adaptor.go. Data: URLs containing base64-encoded data should not be processed through the doubao API.

Additionally, the new Role field enables first/last frame video generation, but images added via req.Images don't have their Role set. Since metadata is unmarshaled directly into the requestPayload struct (line 241), users must specify content items with explicit role values through metadata rather than using req.Images.

@seefs001
seefs001 merged commit 2d9b408 into QuantumNous:main Feb 2, 2026
1 check passed
ennnnny pushed a commit to ennnnny/new-api that referenced this pull request Mar 17, 2026
…65bf72572ff8684dd7ef068e576

feat: doubao add first and last image to video
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