auto-save 2026-05-27 23:01 (~5)
This commit is contained in:
@@ -123,10 +123,27 @@ export const VIDEO_MODELS = [
|
||||
{ label: '12 秒', key: 12 },
|
||||
{ label: '15 秒', key: 15 }
|
||||
],
|
||||
resolutions: ['720p'],
|
||||
resolutions: ['480p', '720p'],
|
||||
defaultResolution: '720p',
|
||||
defaultParams: { ratio: '720x1280', duration: 10, resolution: '720p' }
|
||||
},
|
||||
{
|
||||
label: 'Seedance 2.0 高清',
|
||||
key: 'seedance_hd',
|
||||
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: ['480p', '720p', '1080p'],
|
||||
defaultResolution: '1080p',
|
||||
defaultParams: { ratio: '720x1280', duration: 10, resolution: '1080p' }
|
||||
},
|
||||
]
|
||||
|
||||
// Chat/LLM models | 对话模型
|
||||
|
||||
@@ -149,7 +149,10 @@ export const getModelDurationOptions = (modelKey) => {
|
||||
* Returns options based on model's resolutions array
|
||||
*/
|
||||
export const getModelResolutionOptions = (modelKey) => {
|
||||
const model = VIDEO_MODELS.find(m => m.key === modelKey)
|
||||
const model = getModelConfig(modelKey) || VIDEO_MODELS.find(m => m.key === modelKey)
|
||||
if (model?.resolutionOptions) {
|
||||
return model.resolutionOptions
|
||||
}
|
||||
if (!model?.resolutions) return SEEDANCE_RESOLUTION_OPTIONS
|
||||
|
||||
return model.resolutions.map(res => {
|
||||
|
||||
@@ -153,11 +153,28 @@ const normalizeRuntimeDurationOptions = (items = []) => {
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
const normalizeRuntimeResolutionOptions = (items = []) => {
|
||||
if (!Array.isArray(items)) return []
|
||||
return items
|
||||
.map(item => {
|
||||
const key = typeof item === 'object' ? item?.value || item?.key || item?.id : item
|
||||
if (!key) return null
|
||||
return {
|
||||
label: typeof item === 'object' ? item.label || key : key,
|
||||
key
|
||||
}
|
||||
})
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
const normalizeRuntimeVideoModel = (item) => {
|
||||
const key = item?.id || item?.model
|
||||
if (!key) return null
|
||||
const sizeOptions = normalizeRuntimeSizeOptions(item.size_options)
|
||||
const durationOptions = normalizeRuntimeDurationOptions(item.duration_options)
|
||||
const resolutionOptions = normalizeRuntimeResolutionOptions(item.resolution_options)
|
||||
const resolutions = resolutionOptions.map(option => option.key)
|
||||
const defaultResolution = item.default_resolution || resolutions[0] || '720p'
|
||||
return {
|
||||
label: item.label || item.model || key,
|
||||
key,
|
||||
@@ -166,12 +183,13 @@ const normalizeRuntimeVideoModel = (item) => {
|
||||
model: item.model,
|
||||
ratios: sizeOptions.map(option => option.key),
|
||||
durs: durationOptions,
|
||||
resolutions: ['720p'],
|
||||
defaultResolution: '720p',
|
||||
resolutions,
|
||||
resolutionOptions,
|
||||
defaultResolution,
|
||||
defaultParams: {
|
||||
ratio: sizeOptions[0]?.key || '720x1280',
|
||||
duration: durationOptions[0]?.key || 5,
|
||||
resolution: '720p'
|
||||
resolution: defaultResolution
|
||||
},
|
||||
available: item.available !== false,
|
||||
isRuntime: true
|
||||
|
||||
Reference in New Issue
Block a user