fix: 同步串联生产视频参数与数量限制
This commit is contained in:
1 parent
a85a740cd5
commit
112ff719ce
6 files changed
+68
-9
No files matched your search
@@ -24,7 +24,8 @@ export async function checkPipeline(projectId: string, scope: ProductionStartInp
|
||||
? {
|
||||
imageProvider: profile.imageProvider,
|
||||
videoProvider: profile.videoProvider,
|
||||
imageGenerationOptions: { ...profile.imageOptions }
|
||||
imageGenerationOptions: { ...profile.imageOptions },
|
||||
videoGenerationOptions: { ...profile.videoOptions }
|
||||
}
|
||||
: undefined
|
||||
const [project, checkpoints, forms, plan, status] = await Promise.all([
|
||||
@@ -116,6 +117,8 @@ export function useAdvancedProduction() {
|
||||
const subjectImageLimit = ref<number | null>(1)
|
||||
/** 本轮视频提示词上限。 */
|
||||
const videoPromptLimit = ref<number | null>(1)
|
||||
/** 本轮视频候选镜头上限,默认只处理一镜。 */
|
||||
const videoLimit = ref<number | null>(1)
|
||||
/** 可供界面和确认描述共用的生产范围。 */
|
||||
const scope = computed<ProductionStartInput>(() => ({
|
||||
...(startFrom.value ? { startFrom: startFrom.value } : {}),
|
||||
@@ -123,7 +126,8 @@ export function useAdvancedProduction() {
|
||||
stableIdentityAnchorLimit: stableIdentityAnchorLimit.value ?? 0,
|
||||
subjectImageLimit: subjectImageLimit.value ?? 0,
|
||||
keyframeLimit: testKeyframeLimit.value ?? 0,
|
||||
videoPromptLimit: videoPromptLimit.value ?? 0
|
||||
videoPromptLimit: videoPromptLimit.value ?? 0,
|
||||
videoLimit: videoLimit.value ?? 0
|
||||
}))
|
||||
/** 阶段顺序与后端正整数约束。 */
|
||||
const scopeError = computed(() => validateProductionScope(scope.value))
|
||||
@@ -208,7 +212,7 @@ export function useAdvancedProduction() {
|
||||
return
|
||||
if (JSON.stringify(result.input) !== confirmedInput) {
|
||||
check.value = null
|
||||
throw new Error('项目模型或图片参数已变化,请重新预检并确认费用。')
|
||||
throw new Error('项目模型或图片、视频参数已变化,请重新预检并确认费用。')
|
||||
}
|
||||
check.value = result
|
||||
if (result.issues.length) throw new Error('提交前预检发现条件变化,未启动生产。请处理下方问题。')
|
||||
@@ -271,6 +275,7 @@ export function useAdvancedProduction() {
|
||||
stableIdentityAnchorLimit,
|
||||
subjectImageLimit,
|
||||
videoPromptLimit,
|
||||
videoLimit,
|
||||
scope,
|
||||
scopeError,
|
||||
preflight,
|
||||
@@ -304,9 +309,13 @@ export function validateProductionScope(input: ProductionStartInput): string {
|
||||
if (input.startFrom && input.stopAfter && stages.indexOf(input.startFrom) > stages.indexOf(input.stopAfter))
|
||||
return '结束阶段不能早于起始阶段。'
|
||||
if (
|
||||
[input.stableIdentityAnchorLimit, input.subjectImageLimit, input.keyframeLimit, input.videoPromptLimit].some(
|
||||
value => value !== undefined && (!Number.isInteger(value) || value <= 0)
|
||||
)
|
||||
[
|
||||
input.stableIdentityAnchorLimit,
|
||||
input.subjectImageLimit,
|
||||
input.keyframeLimit,
|
||||
input.videoPromptLimit,
|
||||
input.videoLimit
|
||||
].some(value => value !== undefined && (!Number.isInteger(value) || value <= 0))
|
||||
)
|
||||
return '所有生成上限必须是大于 0 的整数。'
|
||||
return ''
|
||||
|
||||
Reference in new issue
Block a user