🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🐛 fix: migrate Seedance video models to Dreamina (#14144)
YuTengjing35c43fb58037
diff --git a/locales/en-US/models.json b/locales/en-US/models.jsonindex 25b2275eba9..0f523bf27a7 100644--- a/locales/en-US/models.json+++ b/locales/en-US/models.json@@ -506,6 +506,8 @@"doubao-seedream-4-0-250828.description": "Seedream 4.0 is an image generation model from ByteDance Seed, supporting text and image inputs with highly controllable, high-quality image generation. It generates images from text prompts.","doubao-seedream-4-5-251128.description": "Seedream 4.5 is ByteDance’s latest multimodal image model, integrating text-to-image, image-to-image, and batch image generation capabilities, while incorporating commonsense and reasoning abilities. Compared to the previous 4.0 version, it delivers significantly improved generation quality, with better editing consistency and multi-image fusion. It offers more precise control over visual details, producing small text and small faces more naturally, and achieves more harmonious layout and color, enhancing overall aesthetics.","doubao-seedream-5-0-260128.description": "Doubao-Seedream-5.0-lite is ByteDance’s latest image-generation model. For the first time, it integrates online retrieval capabilities, allowing it to incorporate real-time web information and enhance the timeliness of generated images. The model’s intelligence has also been upgraded, enabling precise interpretation of complex instructions and visual content. Additionally, it offers improved global knowledge coverage, reference consistency, and generation quality in professional scenarios, better meeting enterprise-level visual creation needs.",+ "dreamina-seedance-2-0-260128.description": "Seedance 2.0 by ByteDance is the most powerful video generation model, supporting multimodal reference video generation, video editing, video extension, text-to-video, and image-to-video with synchronized audio.",+ "dreamina-seedance-2-0-fast-260128.description": "Seedance 2.0 Fast by ByteDance offers the same capabilities as Seedance 2.0 with faster generation speeds at a more competitive price.","emohaa.description": "Emohaa is a mental health model with professional counseling abilities to help users understand emotional issues.","ernie-4.5-0.3b.description": "ERNIE 4.5 0.3B is an open-source lightweight model for local and customized deployment.","ernie-4.5-21b-a3b-thinking.description": "ERNIE-4.5-21B-A3B-Thinking is a text MoE (Mixture-of-Experts) post-trained model with a total of 21B parameters and 3B active parameters, offering significantly enhanced reasoning quality and depth.",diff --git a/locales/zh-CN/models.json b/locales/zh-CN/models.jsonindex 21a622e7634..8fb588442b6 100644--- a/locales/zh-CN/models.json+++ b/locales/zh-CN/models.json@@ -506,6 +506,8 @@"doubao-seedream-4-0-250828.description": "Seedream 4.0 是字节跳动 Seed 推出的图像生成模型,支持文本与图像输入,具备高度可控的高质量图像生成能力。可根据文本提示生成图像。","doubao-seedream-4-5-251128.description": "Seedream 4.5是字节跳动最新的多模态图像模型,集成了文本生成图像、图像生成图像和批量图像生成功能,同时具备常识和推理能力。与之前的4.0版本相比,生成质量显著提升,编辑一致性和多图融合效果更好。它对视觉细节的控制更加精确,能够更自然地生成小文字和小面部,并实现更和谐的布局和色彩,提升整体美感。","doubao-seedream-5-0-260128.description": "Doubao-Seedream-5.0-lite是字节跳动最新的图像生成模型。首次集成在线检索功能,能够结合实时网络信息,提升生成图像的时效性。模型智能性也得到升级,能够精确解析复杂指令和视觉内容。此外,它在专业场景中的全球知识覆盖、参考一致性和生成质量方面均有提升,更好地满足企业级视觉创作需求。",+ "dreamina-seedance-2-0-260128.description": "字节跳动的 Seedance 2.0 是最强大的视频生成模型,支持多模态参考视频生成、视频编辑、视频扩展、文本转视频和图像转视频,并同步音频。",+ "dreamina-seedance-2-0-fast-260128.description": "字节跳动的 Seedance 2.0 Fast 提供与 Seedance 2.0 相同的功能,但生成速度更快,价格更具竞争力。","emohaa.description": "Emohaa 是一款心理健康模型,具备专业咨询能力,帮助用户理解情绪问题。","ernie-4.5-0.3b.description": "ERNIE 4.5 0.3B 是一款开源轻量级模型,适用于本地和定制化部署。","ernie-4.5-21b-a3b-thinking.description": "ERNIE-4.5-21B-A3B-Thinking是一个拥有21B总参数和3B活跃参数的文本专家混合模型,提供显著增强的推理质量和深度。",diff --git a/packages/model-bank/src/aiModels/lobehub/index.ts b/packages/model-bank/src/aiModels/lobehub/index.tsindex 44585dfbe2d..3e50d3fce34 100644--- a/packages/model-bank/src/aiModels/lobehub/index.ts+++ b/packages/model-bank/src/aiModels/lobehub/index.ts@@ -7,7 +7,12 @@ export { lobehubChatModels } from './chat';export { lobehubEmbeddingModels } from './embedding';export { lobehubImageModels } from './image';export * from './utils';-export { lobehubVideoModels, seedance15ProParams, seedance20Params } from './video';+export {+ lobehubVideoModels,+ seedance15ProParams,+ seedance20FastParams,+ seedance20Params,+} from './video';export const allModels = [...lobehubChatModels,diff --git a/packages/model-bank/src/aiModels/lobehub/video.ts b/packages/model-bank/src/aiModels/lobehub/video.tsindex 46724d3cbd6..25b538e7c56 100644--- a/packages/model-bank/src/aiModels/lobehub/video.ts+++ b/packages/model-bank/src/aiModels/lobehub/video.ts@@ -24,17 +24,26 @@ export const seedance20Params: VideoModelParamsSchema = {aspectRatio: { max: 2.5, min: 0.4 },default: [],height: { max: 6000, min: 300 },+ maxCount: 9,maxFileSize: 30 * 1024 * 1024,width: { max: 6000, min: 300 },},prompt: { default: '' },resolution: {default: '720p',- enum: ['480p', '720p'],+ enum: PRESET_VIDEO_RESOLUTIONS,},seed: { default: null },};+export const seedance20FastParams: VideoModelParamsSchema = {+ ...seedance20Params,+ resolution: {+ default: '720p',+ enum: ['480p', '720p'],+ },+};+export const seedance15ProParams: VideoModelParamsSchema = {aspectRatio: {default: 'adaptive',@@ -72,16 +81,19 @@ export const lobehubVideoModels: AIVideoModelCard[] = ['Seedance 2.0 by ByteDance is the most powerful video generation model, supporting multimodal reference video generation, video editing, video extension, text-to-video, and image-to-video with synchronized audio.',displayName: 'Seedance 2.0',enabled: true,- id: 'doubao-seedance-2-0-260128',+ id: 'dreamina-seedance-2-0-260128',organization: 'ByteDance',parameters: seedance20Params,pricing: {- approximatePricePerVideo: 0.82,+ approximatePricePerVideo: 0.76,units: [{+ lookup: {+ pricingParams: ['resolution'],+ prices: { '1080p': 7.7, '480p': 7, '720p': 7 },+ },name: 'videoGeneration',- rate: 7.56,- strategy: 'fixed',+ strategy: 'lookup',unit: 'millionTokens',},],@@ -94,15 +106,15 @@ export const lobehubVideoModels: AIVideoModelCard[] = ['Seedance 2.0 Fast by ByteDance offers the same capabilities as Seedance 2.0 with faster generation speeds at a more competitive price.',displayName: 'Seedance 2.0 Fast',enabled: true,- id: 'doubao-seedance-2-0-fast-260128',+ id: 'dreamina-seedance-2-0-fast-260128',organization: 'ByteDance',- parameters: seedance20Params,+ parameters: seedance20FastParams,pricing: {- approximatePricePerVideo: 0.66,+ approximatePricePerVideo: 0.6,units: [{name: 'videoGeneration',- rate: 6.08,+ rate: 5.6,strategy: 'fixed',unit: 'millionTokens',},diff --git a/packages/model-runtime/src/core/usageConverters/utils/computeVideoCost.ts b/packages/model-runtime/src/core/usageConverters/utils/computeVideoCost.tsindex d49195f5798..1043534b9b7 100644--- a/packages/model-runtime/src/core/usageConverters/utils/computeVideoCost.ts+++ b/packages/model-runtime/src/core/usageConverters/utils/computeVideoCost.ts@@ -5,8 +5,9 @@ import type { FixedPricingUnit, LookupPricingUnit, Pricing } from 'model-bank';const log = debug('lobe-cost:computeVideoCost');export interface VideoGenerationParams {- [key: string]: any;+ [key: string]: unknown;generateAudio?: boolean;+ resolution?: string;}export interface VideoCostResult {@@ -36,7 +37,7 @@ export const computeVideoCost = (}const currency = pricing.currency || 'USD';- let pricePerMillionTokens = 0;+ let pricePerMillionTokens: number;let lookupKey: string | undefined;switch (videoGenUnit.strategy) {@@ -76,7 +77,9 @@ export const computeVideoCost = (}pricePerMillionTokens = lookupPrice;- log(`Lookup pricing for key "${lookupKey}": ${pricePerMillionTokens} per million tokens (${currency})`);+ log(+ `Lookup pricing for key "${lookupKey}": ${pricePerMillionTokens} per million tokens (${currency})`,+ );break;}default: {diff --git a/src/app/(backend)/api/webhooks/video/[provider]/route.ts b/src/app/(backend)/api/webhooks/video/[provider]/route.tsindex ae72af5c027..cf8cfea759a 100644--- a/src/app/(backend)/api/webhooks/video/[provider]/route.ts+++ b/src/app/(backend)/api/webhooks/video/[provider]/route.ts@@ -231,6 +231,7 @@ export const POST = async (req: Request, { params }: { params: Promise<{ provideawait chargeAfterGenerate({computePriceParams: {generateAudio: (batch?.config as RuntimeVideoGenParams)?.generateAudio,+ resolution: (batch?.config as RuntimeVideoGenParams)?.resolution,},latency: duration,metadata: {diff --git a/src/business/server/video-generation/chargeAfterGenerate.ts b/src/business/server/video-generation/chargeAfterGenerate.tsindex 0619ef2cbdf..c1f3a632079 100644--- a/src/business/server/video-generation/chargeAfterGenerate.ts+++ b/src/business/server/video-generation/chargeAfterGenerate.ts@@ -1,5 +1,5 @@interface ChargeParams {- computePriceParams?: { generateAudio?: boolean };+ computePriceParams?: { generateAudio?: boolean; resolution?: string };isError?: boolean;/** Total time from task submission to webhook callback (ms) */latency?: number;diff --git a/src/routes/(main)/home/features/InputArea/StarterList.tsx b/src/routes/(main)/home/features/InputArea/StarterList.tsxindex 857e2a90add..7ebb96c9f1b 100644--- a/src/routes/(main)/home/features/InputArea/StarterList.tsx+++ b/src/routes/(main)/home/features/InputArea/StarterList.tsx@@ -102,7 +102,7 @@ const StarterList = memo(() => {const handleClick = useCallback((key: StarterMode) => {if (key === 'video') {- navigate('/video?model=doubao-seedance-2-0-260128');+ navigate('/video?model=dreamina-seedance-2-0-260128');return;}diff --git a/src/server/routers/async/video.ts b/src/server/routers/async/video.tsindex c02ba1e7488..1b6ba01c890 100644--- a/src/server/routers/async/video.ts+++ b/src/server/routers/async/video.ts@@ -209,6 +209,7 @@ export const videoRouter = router({await chargeAfterGenerate({computePriceParams: {generateAudio: (batch?.config as any)?.generateAudio,+ resolution: (batch?.config as any)?.resolution,},latency: duration,metadata: {diff --git a/src/store/video/slices/createVideo/action.ts b/src/store/video/slices/createVideo/action.tsindex d047187f345..6395ff69330 100644--- a/src/store/video/slices/createVideo/action.ts+++ b/src/store/video/slices/createVideo/action.ts@@ -52,7 +52,8 @@ export class CreateVideoActionImpl {'requiresImageUrl' in endImageUrlSchema &&endImageUrlSchema.requiresImageUrl &¶meters.endImageUrl &&- !parameters.imageUrl+ !parameters.imageUrl &&+ !parameters.imageUrls?.length) {message.warning({content: t('generation.validation.endFrameRequiresStartFrame', { ns: 'video' }),diff --git a/src/store/video/slices/generationConfig/initialState.ts b/src/store/video/slices/generationConfig/initialState.tsindex 5d89ff18780..d2f0c5b4de4 100644--- a/src/store/video/slices/generationConfig/initialState.ts+++ b/src/store/video/slices/generationConfig/initialState.ts@@ -8,7 +8,7 @@ import {import { seedance20Params } from 'model-bank/lobehub';export const DEFAULT_AI_VIDEO_PROVIDER = ModelProvider.LobeHub;-export const DEFAULT_AI_VIDEO_MODEL = 'doubao-seedance-2-0-260128';+export const DEFAULT_AI_VIDEO_MODEL = 'dreamina-seedance-2-0-260128';export interface VideoGenerationConfigState {parameters: RuntimeVideoGenParams;