203 lines
6.4 KiB
TypeScript
203 lines
6.4 KiB
TypeScript
/**
|
||
* 火山引擎视频模型预设配置
|
||
* 用于快速添加常用模型
|
||
*/
|
||
|
||
export interface VolcanoVideoModelPreset {
|
||
modelId: string;
|
||
displayName: string;
|
||
description: string;
|
||
supportsVision: boolean;
|
||
supportsImageGen: boolean;
|
||
isSubModel?: boolean; // 🆕 是否为子模型
|
||
parentModelId?: string; // 🆕 父模型ID
|
||
capabilities: {
|
||
supportedModes: string[];
|
||
supportedResolutions: string[];
|
||
supportedRatios: string[];
|
||
durationRange: { min: number; max: number };
|
||
supportWatermark: boolean;
|
||
supportCameraFixed: boolean;
|
||
supportSeed: boolean;
|
||
supportReturnLastFrame: boolean;
|
||
maxReferenceImages?: number;
|
||
};
|
||
defaultParams: {
|
||
resolution: string;
|
||
ratio: string;
|
||
duration: number;
|
||
watermark: boolean;
|
||
cameraFixed: boolean;
|
||
};
|
||
sortOrder: number;
|
||
recommendedFor: string[];
|
||
}
|
||
|
||
/**
|
||
* 火山引擎视频模型预设列表
|
||
*/
|
||
export const VOLCANO_VIDEO_MODEL_PRESETS: VolcanoVideoModelPreset[] = [
|
||
// 🆕 主模型(虚拟模型,用于前端显示,不实际调用)
|
||
{
|
||
modelId: 'volcano-video-master',
|
||
displayName: '🎬 火山引擎视频',
|
||
description: '支持文生视频、图生视频等多种模式,自动选择最佳模型',
|
||
supportsVision: true,
|
||
supportsImageGen: false,
|
||
isSubModel: false, // 主模型
|
||
capabilities: {
|
||
supportedModes: ['text-to-video', 'first-frame', 'first-last-frame', 'reference-images'],
|
||
supportedResolutions: ['480p', '720p', '1080p'],
|
||
supportedRatios: ['16:9', '4:3', '1:1', '3:4', '9:16', '21:9', 'adaptive'],
|
||
durationRange: { min: 2, max: 12 },
|
||
supportWatermark: true,
|
||
supportCameraFixed: true,
|
||
supportSeed: true,
|
||
supportReturnLastFrame: true,
|
||
maxReferenceImages: 4,
|
||
},
|
||
defaultParams: {
|
||
resolution: '720p',
|
||
ratio: '16:9',
|
||
duration: 5,
|
||
watermark: true,
|
||
cameraFixed: false,
|
||
},
|
||
sortOrder: 0,
|
||
recommendedFor: ['视频生成', '智能选择', '自动匹配'],
|
||
},
|
||
|
||
// 子模型1:Pro版本
|
||
{
|
||
modelId: 'doubao-seedance-1-0-pro-250528',
|
||
displayName: '豆包 Seedance Pro 250528',
|
||
description: '全功能专业版,支持文生视频、图生视频(首帧/首尾帧),最高支持1080p',
|
||
supportsVision: true,
|
||
supportsImageGen: false,
|
||
isSubModel: true, // 🆕 标记为子模型
|
||
parentModelId: 'volcano-video-master', // 🆕 指定父模型
|
||
capabilities: {
|
||
supportedModes: ['text-to-video', 'first-frame', 'first-last-frame'],
|
||
supportedResolutions: ['480p', '720p', '1080p'],
|
||
supportedRatios: ['16:9', '4:3', '1:1', '3:4', '9:16', '21:9'],
|
||
durationRange: { min: 2, max: 12 },
|
||
supportWatermark: true,
|
||
supportCameraFixed: true,
|
||
supportSeed: true,
|
||
supportReturnLastFrame: true,
|
||
},
|
||
defaultParams: {
|
||
resolution: '720p',
|
||
ratio: '16:9',
|
||
duration: 5,
|
||
watermark: true,
|
||
cameraFixed: false,
|
||
},
|
||
sortOrder: 10,
|
||
recommendedFor: ['高质量视频', '首尾帧过渡', '专业创作'],
|
||
},
|
||
// 子模型2:Pro Fast版本
|
||
{
|
||
modelId: 'doubao-seedance-1-0-pro-fast-251015',
|
||
displayName: '豆包 Seedance Pro Fast 251015',
|
||
description: '快速生成版本,支持文生视频、图生视频(首帧),生成速度更快',
|
||
supportsVision: true,
|
||
supportsImageGen: false,
|
||
isSubModel: true, // 🆕 标记为子模型
|
||
parentModelId: 'volcano-video-master', // 🆕 指定父模型
|
||
capabilities: {
|
||
supportedModes: ['text-to-video', 'first-frame'],
|
||
supportedResolutions: ['480p', '720p', '1080p'],
|
||
supportedRatios: ['16:9', '4:3', '1:1', '3:4', '9:16', '21:9'],
|
||
durationRange: { min: 2, max: 12 },
|
||
supportWatermark: true,
|
||
supportCameraFixed: false,
|
||
supportSeed: false,
|
||
supportReturnLastFrame: true,
|
||
},
|
||
defaultParams: {
|
||
resolution: '720p',
|
||
ratio: '16:9',
|
||
duration: 5,
|
||
watermark: true,
|
||
cameraFixed: false,
|
||
},
|
||
sortOrder: 20,
|
||
recommendedFor: ['快速生成', '批量创作', '内容预览'],
|
||
},
|
||
// 子模型3:Lite I2V版本
|
||
{
|
||
modelId: 'doubao-seedance-1-0-lite-i2v-250428',
|
||
displayName: '豆包 Seedance Lite I2V 250428',
|
||
description: '图生视频轻量版,支持首帧、首尾帧、参考图(1-4张)模式',
|
||
supportsVision: true,
|
||
supportsImageGen: false,
|
||
isSubModel: true, // 🆕 标记为子模型
|
||
parentModelId: 'volcano-video-master', // 🆕 指定父模型
|
||
capabilities: {
|
||
supportedModes: ['first-frame', 'first-last-frame', 'reference-images'],
|
||
supportedResolutions: ['480p', '720p'], // 参考图模式不支持1080p
|
||
supportedRatios: ['16:9', '4:3', '1:1', '3:4', '9:16', '21:9', 'adaptive'],
|
||
durationRange: { min: 2, max: 12 },
|
||
supportWatermark: true,
|
||
supportCameraFixed: true,
|
||
supportSeed: true,
|
||
supportReturnLastFrame: false,
|
||
maxReferenceImages: 4,
|
||
},
|
||
defaultParams: {
|
||
resolution: '720p',
|
||
ratio: '16:9',
|
||
duration: 5,
|
||
watermark: true,
|
||
cameraFixed: false,
|
||
},
|
||
sortOrder: 30,
|
||
recommendedFor: ['参考图融合', '图片动态化', '多元素组合'],
|
||
},
|
||
// 子模型4:Lite T2V版本
|
||
{
|
||
modelId: 'doubao-seedance-1-0-lite-t2v-250428',
|
||
displayName: '豆包 Seedance Lite T2V 250428',
|
||
description: '文生视频轻量版,专注于文本转视频,成本更低',
|
||
supportsVision: false,
|
||
supportsImageGen: false,
|
||
isSubModel: true, // 🆕 标记为子模型
|
||
parentModelId: 'volcano-video-master', // 🆕 指定父模型
|
||
capabilities: {
|
||
supportedModes: ['text-to-video'],
|
||
supportedResolutions: ['480p', '720p', '1080p'],
|
||
supportedRatios: ['16:9', '4:3', '1:1', '3:4', '9:16', '21:9'],
|
||
durationRange: { min: 2, max: 12 },
|
||
supportWatermark: true,
|
||
supportCameraFixed: true,
|
||
supportSeed: true,
|
||
supportReturnLastFrame: false,
|
||
},
|
||
defaultParams: {
|
||
resolution: '720p',
|
||
ratio: '16:9',
|
||
duration: 5,
|
||
watermark: true,
|
||
cameraFixed: false,
|
||
},
|
||
sortOrder: 40,
|
||
recommendedFor: ['轻量级应用', '文本转视频', '成本控制'],
|
||
},
|
||
];
|
||
|
||
/**
|
||
* 根据模型ID获取预设配置
|
||
*/
|
||
export function getModelPresetById(modelId: string): VolcanoVideoModelPreset | undefined {
|
||
return VOLCANO_VIDEO_MODEL_PRESETS.find(preset => preset.modelId === modelId);
|
||
}
|
||
|
||
/**
|
||
* 获取所有模型预设
|
||
*/
|
||
export function getAllModelPresets(): VolcanoVideoModelPreset[] {
|
||
return VOLCANO_VIDEO_MODEL_PRESETS;
|
||
}
|
||
|