diff --git a/src/features/production/useAdvancedProduction.ts b/src/features/production/useAdvancedProduction.ts index 23afc09..d491b5e 100644 --- a/src/features/production/useAdvancedProduction.ts +++ b/src/features/production/useAdvancedProduction.ts @@ -79,6 +79,9 @@ export function useAdvancedProduction() { const session = computed(() => getProductionSession(id.value)) const checking = ref(false) const error = ref('') + /** 默认使用无视频测试模式,只有用户明确切换后才允许提交高费用视频任务。 */ + const safeMode = ref(true) + const testKeyframeLimit = ref(1) const check = ref> | null>(null) const blocked = computed( () => @@ -142,15 +145,20 @@ export function useAdvancedProduction() { if (result.issues.length) throw new Error('提交前预检发现条件变化,未启动生产。请处理下方问题。') target.pipelineReceipt = null submitted = true - const receipt = await productionApi.startPipeline( - projectId, - result.profile + const receipt = await productionApi.startPipeline(projectId, { + ...(result.profile ? { imageProvider: result.profile.imageProvider, videoProvider: result.profile.videoProvider } - : undefined - ) + : {}), + ...(safeMode.value + ? { + stopAfter: 'videoPrompts' as const, + ...(testKeyframeLimit.value ? { keyframeLimit: testKeyframeLimit.value } : {}) + } + : {}) + }) if (!receipt || receipt.projectId !== projectId) throw new Error('回执项目不匹配,请读取资产状态核对,不要直接重试。') target.pipelineReceipt = receipt @@ -160,5 +168,17 @@ export function useAdvancedProduction() { await context.refresh() } } - return { id, operation, session, checking, error, check, blocked, preflight, start } + return { + id, + operation, + session, + checking, + error, + check, + blocked, + safeMode, + testKeyframeLimit, + preflight, + start + } }