From ab8ddc83541fe177046acda9d0a6237e4ce4d53c Mon Sep 17 00:00:00 2001 From: chiyi Date: Wed, 14 Oct 2026 15:14:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(playground):=20custom=20=E4=B8=8A=E6=B8=B8?= =?UTF-8?q?=E7=9A=84=20seedance*=20=E6=A8=A1=E5=9E=8B=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E5=90=83=20seedance=20=E9=BB=98=E8=AE=A4=E4=B8=8A=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit isSeedanceModel 的正则把 custom provider 的自定义命名也算成了 leonardo seedance,导致音频上限兜底成 3、总张数被重复相加。provider=custom 也排除出 seedance 判定(videoCaps 同步)。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- frontend/src/videoCaps.js | 2 +- frontend/src/views/PlaygroundView.vue | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/videoCaps.js b/frontend/src/videoCaps.js index 58d4eee..6b7c19e 100644 --- a/frontend/src/videoCaps.js +++ b/frontend/src/videoCaps.js @@ -14,7 +14,7 @@ export function mediaCaps(model, preset) { if ((model?.type || model?.kind) !== 'video') return null // creativefabrica 上游只收图片参考(VIDEO_FRAME_TYPE_REFERENCE),不收视频/音频; // 它虽然叫 seedance,但要排除,否则会错误地显示「视频 3 音频 3」。 - const isSeedance = /^seedance/.test(model?.id || '') && (model?.provider || '') !== 'creativefabrica' + const isSeedance = /^seedance/.test(model?.id || '') && !['creativefabrica', 'custom'].includes(model?.provider || '') // preset 优先;custom 上游模型直接在模型字段里声明(max_reference_videos/audios)。 const videos = declared(preset?.max_videos) ?? declared(model?.max_reference_videos) ?? (isSeedance ? SEEDANCE_FALLBACK.videos : 0) const audios = declared(preset?.max_audios) ?? declared(model?.max_reference_audios) ?? (isSeedance ? SEEDANCE_FALLBACK.audios : 0) diff --git a/frontend/src/views/PlaygroundView.vue b/frontend/src/views/PlaygroundView.vue index 2a90fb8..72d4247 100644 --- a/frontend/src/views/PlaygroundView.vue +++ b/frontend/src/views/PlaygroundView.vue @@ -144,8 +144,10 @@ const maxAudiosRaw = computed(() => { return m > 0 ? m : null }) // creativefabrica 上游只收图片参考,没有首尾帧/视频/音频,虽叫 seedance 也要排除。 +// custom 上游模型 id 也可以 seedance 开头(管理员自定义命名),它们的上限 +// 由模型字段显式声明,不走 seedance 默认 3/3。 const isSeedanceModel = computed(() => - /^seedance/.test(model.value?.id || '') && (model.value?.provider || '') !== 'creativefabrica') + /^seedance/.test(model.value?.id || '') && !['creativefabrica', 'custom'].includes(model.value?.provider || '')) // 支持图片以外的参考资产(视频/音频)的模型:seedance 系 + 预设声明了音视频上限的 const supportsMediaRefs = computed(() => isSeedanceModel.value || maxVideosRaw.value > 0 || maxAudiosRaw.value > 0)