164 lines
5.0 KiB
JavaScript
164 lines
5.0 KiB
JavaScript
/**
|
|
* Models Configuration | 模型配置
|
|
* Centralized model configuration | 集中模型配置
|
|
*/
|
|
|
|
// SKG backend image size options | SKG 后端图片尺寸选项
|
|
export const SEEDREAM_SIZE_OPTIONS = [
|
|
{ label: '自动', key: 'auto' },
|
|
{ label: '竖图 2:3', key: '1024x1536' },
|
|
{ label: '方图 1:1', key: '1024x1024' },
|
|
{ label: '横图 3:2', key: '1536x1024' }
|
|
]
|
|
|
|
// Kept for compatibility with upstream model helpers.
|
|
export const SEEDREAM_4K_SIZE_OPTIONS = SEEDREAM_SIZE_OPTIONS
|
|
|
|
// SKG backend currently exposes model choice and size; quality is retained as a no-op UI field.
|
|
export const SEEDREAM_QUALITY_OPTIONS = [
|
|
{ label: '标准', key: 'standard' }
|
|
]
|
|
|
|
export const BANANA_SIZE_OPTIONS = [
|
|
{ label: '16:9', key: '16x9' },
|
|
{ label: '4:3', key: '4x3' },
|
|
{ label: '3:2', key: '3x2' },
|
|
{ label: '1:1', key: '1x1' },
|
|
{ label: '2:3', key: '2x3' },
|
|
{ label: '3:4', key: '3x4' },
|
|
{ label: '9:16', key: '9x16' },
|
|
]
|
|
|
|
// Image generation models | 图片生成模型
|
|
export const IMAGE_MODELS = [
|
|
{
|
|
label: '自动',
|
|
key: 'auto',
|
|
provider: ['chatfire'],
|
|
sizes: SEEDREAM_SIZE_OPTIONS.map(s => s.key),
|
|
qualities: SEEDREAM_QUALITY_OPTIONS,
|
|
defaultParams: {
|
|
size: '1024x1536',
|
|
quality: 'standard',
|
|
style: 'vivid'
|
|
}
|
|
},
|
|
{
|
|
label: 'GPT Image 2',
|
|
key: 'gpt-image-2',
|
|
provider: ['chatfire'],
|
|
sizes: SEEDREAM_SIZE_OPTIONS.map(s => s.key),
|
|
qualities: SEEDREAM_QUALITY_OPTIONS,
|
|
defaultParams: {
|
|
size: '1024x1536',
|
|
quality: 'standard',
|
|
style: 'vivid'
|
|
}
|
|
},
|
|
{
|
|
label: 'Gemini 图片',
|
|
key: 'gemini-3-pro-image-preview',
|
|
provider: ['chatfire'],
|
|
sizes: SEEDREAM_SIZE_OPTIONS.map(s => s.key),
|
|
qualities: SEEDREAM_QUALITY_OPTIONS,
|
|
defaultParams: {
|
|
size: '1024x1536',
|
|
quality: 'standard',
|
|
style: 'vivid'
|
|
}
|
|
},
|
|
|
|
]
|
|
|
|
// Video ratio options | 视频比例选项
|
|
export const VIDEO_RATIO_LIST = [
|
|
{ label: '竖屏 9:16', key: '720x1280' },
|
|
{ label: '横屏 16:9', key: '1280x720' },
|
|
{ label: '方形 1:1', key: '1024x1024' },
|
|
{ label: '竖屏 3:4', key: '960x1280' }
|
|
]
|
|
|
|
// Video resolution options for Seedance | Seedance 分辨率选项
|
|
export const SEEDANCE_RESOLUTION_OPTIONS = [
|
|
{ label: '480p', key: '480p' },
|
|
{ label: '720p', key: '720p' },
|
|
{ label: '1080p', key: '1080p' }
|
|
]
|
|
|
|
// Video generation models | 视频生成模型
|
|
export const VIDEO_MODELS = [
|
|
{
|
|
label: 'Seedance 2.0 Fast',
|
|
key: 'seedance',
|
|
provider: ['chatfire'],
|
|
type: 't2v+i2v',
|
|
ratios: ['720x1280', '1280x720', '1024x1024', '960x1280'],
|
|
durs: [
|
|
{ label: '5 秒', key: 5 },
|
|
{ label: '8 秒', key: 8 },
|
|
{ label: '10 秒', key: 10 },
|
|
{ label: '12 秒', key: 12 },
|
|
{ label: '15 秒', key: 15 }
|
|
],
|
|
resolutions: ['720p'],
|
|
defaultResolution: '720p',
|
|
defaultParams: { ratio: '720x1280', duration: 10, resolution: '720p' }
|
|
},
|
|
]
|
|
|
|
// Chat/LLM models | 对话模型
|
|
export const CHAT_MODELS = [
|
|
{ label: 'GPT-4o Mini', key: 'gpt-4o-mini', provider: ['openai'] },
|
|
{ label: 'GPT-4o', key: 'gpt-4o', provider: ['openai'] },
|
|
{ label: 'GPT-5.2', key: 'gpt-5.2', provider: ['openai'] },
|
|
{ label: 'DeepSeek Chat', key: 'deepseek-chat', provider: ['openai', 'chatfire'] },
|
|
{ label: '豆包 Seed Flash', key: 'doubao-seed-1-6-flash-250615', provider: ['chatfire'] },
|
|
{ label: 'Gemini 3 Pro', key: 'gemini-3-pro', provider: ['openai'] }
|
|
]
|
|
|
|
// Image size options | 图片尺寸选项
|
|
export const IMAGE_SIZE_OPTIONS = [
|
|
{ label: '自动', key: 'auto' },
|
|
{ label: '竖图 2:3', key: '1024x1536' },
|
|
{ label: '方图 1:1', key: '1024x1024' },
|
|
{ label: '横图 3:2', key: '1536x1024' }
|
|
]
|
|
|
|
// Image quality options | 图片质量选项
|
|
export const IMAGE_QUALITY_OPTIONS = [
|
|
{ label: '标准', key: 'standard' },
|
|
{ label: '高清', key: 'hd' }
|
|
]
|
|
|
|
// Image style options | 图片风格选项
|
|
export const IMAGE_STYLE_OPTIONS = [
|
|
{ label: '生动', key: 'vivid' },
|
|
{ label: '自然', key: 'natural' }
|
|
]
|
|
|
|
// Video ratio options | 视频比例选项
|
|
export const VIDEO_RATIO_OPTIONS = VIDEO_RATIO_LIST
|
|
|
|
// Video duration options | 视频时长选项
|
|
export const VIDEO_DURATION_OPTIONS = [
|
|
{ label: '5 秒', key: 5 },
|
|
{ label: '8 秒', key: 8 },
|
|
{ label: '10 秒', key: 10 },
|
|
{ label: '12 秒', key: 12 },
|
|
{ label: '15 秒', key: 15 }
|
|
]
|
|
|
|
// Default values | 默认值
|
|
export const DEFAULT_IMAGE_MODEL = 'auto'
|
|
export const DEFAULT_VIDEO_MODEL = 'seedance'
|
|
export const DEFAULT_CHAT_MODEL = 'gpt-4o-mini'
|
|
export const DEFAULT_IMAGE_SIZE = '1024x1536'
|
|
export const DEFAULT_VIDEO_RATIO = '720x1280'
|
|
export const DEFAULT_VIDEO_DURATION = 10
|
|
|
|
// Get model by key | 根据 key 获取模型
|
|
export const getModelByName = (key) => {
|
|
const allModels = [...IMAGE_MODELS, ...VIDEO_MODELS, ...CHAT_MODELS]
|
|
return allModels.find(m => m.key === key)
|
|
}
|