feat: 接入持久化工作流执行状态
This commit is contained in:
1 parent
7d2900c705
commit
3caea26924
14 files changed
+532
-44
No files matched your search
@@ -32,6 +32,7 @@ import QualityDialog from './components/QualityDialog.vue'
|
||||
import DetailDisclosure from '../../components/ui/DetailDisclosure.vue'
|
||||
import CreativeProfileSettings from '../generation-config/components/CreativeProfileSettings.vue'
|
||||
import EpisodeAssemblyPanel from './components/EpisodeAssemblyPanel.vue'
|
||||
import WorkflowExecutionPanel from '../workflows/WorkflowExecutionPanel.vue'
|
||||
const qualityOpen = ref(false)
|
||||
|
||||
/** 镜头生产页将项目批处理与单镜头资产管理放在同一条可核验链路中。 */
|
||||
@@ -55,13 +56,17 @@ const {
|
||||
keyframeLimit,
|
||||
keyframeWidth,
|
||||
keyframeHeight,
|
||||
promptLimit,
|
||||
videoLimit,
|
||||
videoRepairAttempts,
|
||||
keyframeValid,
|
||||
promptValid,
|
||||
videoQualityValid,
|
||||
batchValid,
|
||||
blocked,
|
||||
run
|
||||
run,
|
||||
promptExecution,
|
||||
videoExecution
|
||||
} = useProduction()
|
||||
const route = inject(routeLocationKey, undefined)
|
||||
/** 从素材页返回时恢复到指定剧集与正式镜头,不按重复的 Shot 编号定位。 */
|
||||
@@ -84,6 +89,19 @@ const openRequestedKeyframe = computed(
|
||||
() => queryText(route?.query.action) === 'keyframe' && queryText(route?.query.shotId) === shot.value?.shotId
|
||||
)
|
||||
const staleVideos = computed(() => query.data.value?.videos.stalePrimaryVideo ?? 0)
|
||||
const episodePromptReadiness = computed(() => {
|
||||
const source = query.data.value?.prompts
|
||||
if (!source) return undefined
|
||||
const items = source.items.filter(item => item.episodeNo === episodeNo.value)
|
||||
return {
|
||||
...source,
|
||||
items,
|
||||
total: items.length,
|
||||
ready: items.filter(item => item.status === 'ready').length,
|
||||
skipped: items.filter(item => item.status === 'skipped').length,
|
||||
blocked: items.filter(item => item.status === 'blocked').length
|
||||
}
|
||||
})
|
||||
const stages = computed(() => {
|
||||
const data = query.data.value
|
||||
return [
|
||||
@@ -93,8 +111,8 @@ const stages = computed(() => {
|
||||
title: '视频提示词',
|
||||
description: '校验 GenerationSpec 与主体参考图后,由模型生成视频运动描述。',
|
||||
icon: MessageSquareText,
|
||||
data: data?.prompts,
|
||||
done: data?.prompts.skipped ?? 0,
|
||||
data: episodePromptReadiness.value,
|
||||
done: episodePromptReadiness.value?.skipped ?? 0,
|
||||
action: force.value ? '重生成全部提示词' : '补齐视频提示词'
|
||||
},
|
||||
{
|
||||
@@ -190,12 +208,14 @@ const keyframeModel = computed(() => ({
|
||||
keyframeWidth: keyframeWidth.value,
|
||||
keyframeHeight: keyframeHeight.value
|
||||
}))
|
||||
const promptModel = computed(() => ({ promptLimit: promptLimit.value }))
|
||||
const dimensionRules = sizeRules(() => ({ width: keyframeWidth.value, height: keyframeHeight.value }))
|
||||
const keyframeRules = {
|
||||
keyframeLimit: integerRule('本批上限', 1, true),
|
||||
keyframeWidth: dimensionRules.width,
|
||||
keyframeHeight: dimensionRules.height
|
||||
}
|
||||
const promptRules = { promptLimit: integerRule('本批镜头上限') }
|
||||
const videoModel = computed(() => ({ videoLimit: videoLimit.value, videoRepairAttempts: videoRepairAttempts.value }))
|
||||
const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairAttempts: integerRule('每镜最多自动修复') }
|
||||
</script>
|
||||
@@ -340,6 +360,24 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
个主视频已过期。它们使用的主首帧或主体参考图已经变化;非覆盖模式批量生成时会只重建这些过期主视频。
|
||||
</NAlert>
|
||||
<ProductionReceipt v-if="session.receipt" :receipt="session.receipt" />
|
||||
<WorkflowExecutionPanel
|
||||
v-if="promptExecution.executionId.value"
|
||||
title="视频提示词后台任务"
|
||||
:execution="promptExecution.query.data.value"
|
||||
:loading="promptExecution.query.loading.value"
|
||||
:error="promptExecution.query.error.value"
|
||||
@refresh="promptExecution.query.refresh"
|
||||
@dismiss="promptExecution.dismiss"
|
||||
/>
|
||||
<WorkflowExecutionPanel
|
||||
v-if="videoExecution.executionId.value"
|
||||
title="视频质量后台任务"
|
||||
:execution="videoExecution.query.data.value"
|
||||
:loading="videoExecution.query.loading.value"
|
||||
:error="videoExecution.query.error.value"
|
||||
@refresh="videoExecution.query.refresh"
|
||||
@dismiss="videoExecution.dismiss"
|
||||
/>
|
||||
<div v-if="query.data.value" class="production-pipeline mt-5">
|
||||
<article
|
||||
v-for="stage in stages"
|
||||
@@ -430,6 +468,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
:disabled="
|
||||
blocked ||
|
||||
!batchValid ||
|
||||
(stage.key === 'prompts' && !promptValid) ||
|
||||
(stage.key === 'keyframes' && !keyframeValid) ||
|
||||
(stage.key === 'videos' && !videoQualityValid) ||
|
||||
!(stage.data?.ready ?? 0)
|
||||
@@ -442,11 +481,28 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
: `只为至多 ${videoLimit || '—'} 个就绪镜头启动严格质量流水线。任务创建后由后端自动校验,最多修复 ${videoRepairAttempts || '—'} 次,通过后才晋升主视频。`
|
||||
: stage.key === 'keyframes'
|
||||
? `处理缺失或过期主首帧。过期首帧成功后自动接替旧主图(覆盖模式也如此),其余已有主图只新增候选。本批上限:${keyframeLimit || '不限制'};尺寸:${keyframeWidth && keyframeHeight ? `${keyframeWidth} × ${keyframeHeight}` : '后端默认'}。`
|
||||
: '只处理通过视频提示词就绪检查的镜头;覆盖模式会重写已有提示词。'
|
||||
: `只处理第 ${episodeNo} 集中通过就绪检查的镜头,本批最多 ${promptLimit || '—'} 镜;覆盖模式会重写已有提示词。`
|
||||
"
|
||||
:primary="stage.key === 'videos'"
|
||||
@confirm="run(stage.key)"
|
||||
/>
|
||||
<AppForm
|
||||
v-if="stage.key === 'prompts'"
|
||||
:model="promptModel"
|
||||
:rules="promptRules"
|
||||
:disabled="operation.pending"
|
||||
validate-on-change
|
||||
class="mt-4 grid gap-3"
|
||||
>
|
||||
<NFormItem path="promptLimit" label="本批镜头上限"
|
||||
><NInputNumber
|
||||
v-model:value="promptLimit"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:disabled="operation.pending"
|
||||
:input-props="{ 'aria-label': '视频提示词本批镜头上限' }"
|
||||
/></NFormItem>
|
||||
</AppForm>
|
||||
<AppForm
|
||||
v-if="stage.key === 'keyframes'"
|
||||
:model="keyframeModel"
|
||||
|
||||
@@ -17,6 +17,7 @@ import type {
|
||||
RetryVideosResult,
|
||||
ShotKeyframe,
|
||||
ShotVideo,
|
||||
ShotVideoQualityStatus,
|
||||
ShotVideoQualityResult,
|
||||
VideoQualityBatchResult,
|
||||
VideoQualityConfig,
|
||||
@@ -25,6 +26,7 @@ import type {
|
||||
ProjectAssemblyReadiness,
|
||||
EpisodeAssemblyResult
|
||||
} from './types'
|
||||
import type { WorkflowExecutionStart } from '../workflows/execution.types'
|
||||
|
||||
/** 项目路径统一编码,避免业务组件手工拼接 ID。 */
|
||||
function projectPath(id: string) {
|
||||
@@ -78,6 +80,12 @@ export const productionApi = {
|
||||
body: input,
|
||||
timeoutMs: 0
|
||||
}),
|
||||
/** 后台生成视频提示词;刷新页面后可凭 executionId 继续观察。 */
|
||||
startPromptExecution: (projectId: string, input: StoryboardBatchInput) =>
|
||||
request<WorkflowExecutionStart>(`${projectPath(projectId)}/video-prompts/generate/start`, {
|
||||
method: 'POST',
|
||||
body: input
|
||||
}),
|
||||
keyframeReadiness: (projectId: string, force: boolean, signal?: AbortSignal) =>
|
||||
request<KeyframeReadiness>(`${projectPath(projectId)}/keyframes/readiness?force=${force}`, { signal }),
|
||||
generateKeyframes: (projectId: string, input: GenerateKeyframesInput) =>
|
||||
@@ -95,8 +103,17 @@ export const productionApi = {
|
||||
body: input,
|
||||
timeoutMs: 0
|
||||
}),
|
||||
/** 后台启动项目级视频质量任务;后续状态通过 WorkflowExecution 查询。 */
|
||||
startQualityVideoExecution: (projectId: string, input: GenerateQualityVideosInput) =>
|
||||
request<WorkflowExecutionStart>(`${projectPath(projectId)}/videos/generate-quality/start`, {
|
||||
method: 'POST',
|
||||
body: input
|
||||
}),
|
||||
projectVideoStatus: (projectId: string, signal?: AbortSignal) =>
|
||||
request<ProjectVideoStatus>(`${projectPath(projectId)}/videos/status`, { signal }),
|
||||
/** 读取单镜头已持久化的质量链状态,不触发新的视觉校验。 */
|
||||
videoQualityStatus: (shotId: string, signal?: AbortSignal) =>
|
||||
request<ShotVideoQualityStatus>(`${shotPath(shotId)}/videos/quality-status`, { signal }),
|
||||
retryVideos: (projectId: string, concurrency: number) =>
|
||||
request<RetryVideosResult>(`${projectPath(projectId)}/videos/retry-failed`, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -13,7 +13,14 @@ import { storyboardApi } from '../../storyboard/api'
|
||||
import ConfirmAction from '../../workflows/ConfirmAction.vue'
|
||||
import { getOperation, runOperation } from '../../workflows/operations'
|
||||
import { productionApi } from '../api'
|
||||
import { isActiveVideo, issueLabel, primaryKeyframe, primaryVideo, productionStatusLabel } from '../model'
|
||||
import {
|
||||
isActiveVideo,
|
||||
issueLabel,
|
||||
primaryKeyframe,
|
||||
primaryVideo,
|
||||
productionStatusLabel,
|
||||
videoQualityStatusLabel
|
||||
} from '../model'
|
||||
import type {
|
||||
GenerateKeyframeInput,
|
||||
KeyframeReadinessItem,
|
||||
@@ -47,18 +54,24 @@ const key = computed(() => props.shot.shotId)
|
||||
const query = usePolling(
|
||||
key,
|
||||
async (shotId, signal) => {
|
||||
const [keyframes, videos] = await Promise.all([
|
||||
const [keyframes, videos, qualityState] = await Promise.all([
|
||||
productionApi.listKeyframes(shotId, signal),
|
||||
productionApi.listVideos(shotId, signal)
|
||||
productionApi.listVideos(shotId, signal),
|
||||
productionApi
|
||||
.videoQualityStatus(shotId, signal)
|
||||
.then(data => ({ data, error: '' }))
|
||||
.catch(cause => ({ data: null, error: errorMessage(cause) }))
|
||||
])
|
||||
if (keyframes.some(item => item.shotId !== shotId) || videos.some(item => item.shotId !== shotId))
|
||||
throw new Error('资产记录与当前镜头不匹配,请刷新后重试。')
|
||||
return { keyframes, videos }
|
||||
const qualityStatus = qualityState.data?.shotId === shotId ? qualityState.data : null
|
||||
return { keyframes, videos, qualityStatus, qualityStatusError: qualityState.error }
|
||||
},
|
||||
false
|
||||
)
|
||||
const keyframes = computed(() => query.data.value?.keyframes ?? [])
|
||||
const videos = computed(() => query.data.value?.videos ?? [])
|
||||
const videoQualityStatus = computed(() => query.data.value?.qualityStatus ?? null)
|
||||
const currentKeyframe = computed(() => primaryKeyframe(keyframes.value))
|
||||
const currentVideo = computed(() => primaryVideo(videos.value))
|
||||
const activeVideo = computed(() => videos.value.find(isActiveVideo))
|
||||
@@ -358,6 +371,9 @@ async function inspectSpecs() {
|
||||
>
|
||||
当前主首帧在本次质量检查中未通过,已阻止继续生成视频。请从候选中选择质量通过的图片。
|
||||
</NAlert>
|
||||
<NAlert v-if="query.data.value?.qualityStatusError" type="warning" :show-icon="false" class="mt-3 text-xs">
|
||||
视频质量链状态暂时无法读取;视频资产仍可查看。请稍后刷新。
|
||||
</NAlert>
|
||||
<div class="production-stage-actions">
|
||||
<NButton v-if="keyframeCandidates.length" @click="candidatesOpen = true">
|
||||
管理候选({{ keyframeCandidates.length }})
|
||||
@@ -389,6 +405,26 @@ async function inspectSpecs() {
|
||||
{{ issueLabel(issue.code) }}:{{ issue.reason }}
|
||||
</li>
|
||||
</ul>
|
||||
<NAlert
|
||||
v-if="videoQualityStatus && videoQualityStatus.status !== 'not_started'"
|
||||
:type="
|
||||
videoQualityStatus.status === 'passed'
|
||||
? 'success'
|
||||
: videoQualityStatus.status === 'exhausted'
|
||||
? 'error'
|
||||
: 'info'
|
||||
"
|
||||
:show-icon="false"
|
||||
class="mt-3 text-xs"
|
||||
>
|
||||
{{ videoQualityStatusLabel(videoQualityStatus.status) }}
|
||||
<template v-if="videoQualityStatus.maxRepairAttempts !== null">
|
||||
· 修复 {{ videoQualityStatus.repairAttempt }} / {{ videoQualityStatus.maxRepairAttempts }}
|
||||
</template>
|
||||
<template v-if="videoQualityStatus.status === 'exhausted'">
|
||||
。请检查候选视频和校验结果,调整提示词或参考资产后再重新生成。
|
||||
</template>
|
||||
</NAlert>
|
||||
<div v-if="videos.length" class="mt-4 space-y-3">
|
||||
<article v-for="item in videos" :key="item.id" class="video-record">
|
||||
<video
|
||||
@@ -464,7 +500,7 @@ async function inspectSpecs() {
|
||||
</div>
|
||||
<p v-else class="mt-4 text-xs text-muted">尚无视频任务记录。</p>
|
||||
<p v-if="videos.some(item => !item.isPrimary)" class="mt-3 text-xs text-muted">
|
||||
候选视频的历史质量结果未公开;手动设为主视频前需在本会话完成视觉校验。自动质量任务的晋升结果以刷新后的主视频标记为准。
|
||||
质量链状态来自后端持久化记录;手动晋升候选仍需在当前页面完成一次视觉校验。自动质量任务通过后会直接更新主视频。
|
||||
</p>
|
||||
<div class="production-stage-actions">
|
||||
<ConfirmAction
|
||||
|
||||
@@ -74,3 +74,16 @@ export function productionStatusLabel(status: string): string {
|
||||
}
|
||||
return labels[status] ?? status
|
||||
}
|
||||
|
||||
/** 视频质量链状态标签与后端状态机保持一致。 */
|
||||
export function videoQualityStatusLabel(status: string): string {
|
||||
const labels: Record<string, string> = {
|
||||
not_started: '尚未开始质量流程',
|
||||
generating: '正在生成候选视频',
|
||||
validating: '正在执行质量校验',
|
||||
repairing: '正在自动修复',
|
||||
passed: '质量校验通过',
|
||||
exhausted: '自动修复次数已用完'
|
||||
}
|
||||
return labels[status] ?? status
|
||||
}
|
||||
@@ -25,6 +25,7 @@ export interface ProductionIssue {
|
||||
/** 视频提示词就绪检查的逐镜结果。 */
|
||||
export interface PromptReadinessItem {
|
||||
shotId: string
|
||||
episodeNo: number
|
||||
shotNo: number
|
||||
status: Exclude<ProductionReadinessStatus, 'in_progress'>
|
||||
stalePrompt?: boolean
|
||||
@@ -328,6 +329,28 @@ export interface ProjectVideoStatus {
|
||||
items: ProjectVideoStatusItem[]
|
||||
}
|
||||
|
||||
/** 单镜头严格质量链的持久化状态;读取不会重新调用模型。 */
|
||||
export interface ShotVideoQualityStatus {
|
||||
shotId: string
|
||||
status: 'not_started' | 'generating' | 'validating' | 'repairing' | 'passed' | 'exhausted'
|
||||
primaryVideoId: string | null
|
||||
latestVideoId: string | null
|
||||
repairAttempt: number
|
||||
maxRepairAttempts: number | null
|
||||
validationPassed: boolean | null
|
||||
issues: unknown[]
|
||||
chain: {
|
||||
videoId: string
|
||||
providerStatus: ShotVideo['status']
|
||||
isPrimary: boolean
|
||||
repairAttempt: number
|
||||
maxRepairAttempts: number | null
|
||||
validationPassed: boolean | null
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}[]
|
||||
}
|
||||
|
||||
/** 失败视频批量重试回执。 */
|
||||
export interface RetryVideosResult {
|
||||
totalFailed: number
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { computed, ref } from 'vue'
|
||||
import { useQuery } from '../../composables/useQuery'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { usePolling } from '../../composables/usePolling'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
import { mergeDesignedShots } from '../storyboard/model'
|
||||
import { storyboardApi } from '../storyboard/api'
|
||||
import { breakdownSnapshot } from '../workflows/selectors'
|
||||
import { getOperation, runOperation } from '../workflows/operations'
|
||||
import { useWorkflowExecution } from '../workflows/execution'
|
||||
import { productionApi } from './api'
|
||||
import { getProductionSession, validOptionalSize } from './model'
|
||||
|
||||
@@ -22,6 +23,7 @@ export function useProduction() {
|
||||
const keyframeLimit = ref<number | ''>('')
|
||||
const keyframeWidth = ref<number | ''>('')
|
||||
const keyframeHeight = ref<number | ''>('')
|
||||
const promptLimit = ref<number | null>(1)
|
||||
const videoLimit = ref<number | null>(1)
|
||||
const videoRepairAttempts = ref<number | null>(2)
|
||||
const snapshot = computed(() => breakdownSnapshot(context.checkpoints.value))
|
||||
@@ -45,20 +47,24 @@ export function useProduction() {
|
||||
)
|
||||
const queryKey = computed(() => JSON.stringify([id.value, episodeNo.value, force.value]))
|
||||
/** 生产页已有刷新按钮,就绪状态改为手动更新。 */
|
||||
const query = useQuery(queryKey, async (key, signal) => {
|
||||
const [projectId, number, overwrite] = JSON.parse(key) as [string, number, boolean]
|
||||
if (!projectId || !number) return null
|
||||
const [directions, prompts, keyframes, videos, videoStatus] = await Promise.all([
|
||||
storyboardApi.directions(projectId, number, signal),
|
||||
productionApi.promptReadiness(projectId, overwrite, signal),
|
||||
productionApi.keyframeReadiness(projectId, overwrite, signal),
|
||||
productionApi.videoReadiness(projectId, overwrite, signal),
|
||||
productionApi.projectVideoStatus(projectId, signal)
|
||||
])
|
||||
if (directions.projectId !== projectId || directions.episodeNo !== number)
|
||||
throw new Error('镜头生产查询返回了不匹配的项目或剧集,请刷新后重试。')
|
||||
return { directions, prompts, keyframes, videos, videoStatus }
|
||||
})
|
||||
const query = usePolling(
|
||||
queryKey,
|
||||
async (key, signal) => {
|
||||
const [projectId, number, overwrite] = JSON.parse(key) as [string, number, boolean]
|
||||
if (!projectId || !number) return null
|
||||
const [directions, prompts, keyframes, videos, videoStatus] = await Promise.all([
|
||||
storyboardApi.directions(projectId, number, signal),
|
||||
productionApi.promptReadiness(projectId, overwrite, signal),
|
||||
productionApi.keyframeReadiness(projectId, overwrite, signal),
|
||||
productionApi.videoReadiness(projectId, overwrite, signal),
|
||||
productionApi.projectVideoStatus(projectId, signal)
|
||||
])
|
||||
if (directions.projectId !== projectId || directions.episodeNo !== number)
|
||||
throw new Error('镜头生产查询返回了不匹配的项目或剧集,请刷新后重试。')
|
||||
return { directions, prompts, keyframes, videos, videoStatus }
|
||||
},
|
||||
false
|
||||
)
|
||||
const source = computed(() => sourceEpisodes.value.find(item => item.episodeNo === episodeNo.value))
|
||||
const shots = computed(() => mergeDesignedShots(query.data.value?.directions ?? null, null, source.value))
|
||||
const shot = computed(() => shots.value.find(item => item.shotId === selectedShot.value) ?? shots.value[0])
|
||||
@@ -72,7 +78,10 @@ export function useProduction() {
|
||||
)
|
||||
const operation = computed(() => getOperation(id.value))
|
||||
const session = computed(() => getProductionSession(id.value))
|
||||
const promptExecution = useWorkflowExecution(id, 'video-prompt')
|
||||
const videoExecution = useWorkflowExecution(id, 'video-quality')
|
||||
const batchValid = computed(() => Number.isSafeInteger(concurrency.value) && concurrency.value > 0)
|
||||
const promptValid = computed(() => Number.isSafeInteger(promptLimit.value) && (promptLimit.value ?? 0) > 0)
|
||||
const keyframeValid = computed(
|
||||
() =>
|
||||
(keyframeLimit.value === '' || (Number.isSafeInteger(keyframeLimit.value) && keyframeLimit.value > 0)) &&
|
||||
@@ -89,17 +98,34 @@ export function useProduction() {
|
||||
const blocked = computed(
|
||||
() =>
|
||||
operation.value.pending ||
|
||||
promptExecution.active.value ||
|
||||
videoExecution.active.value ||
|
||||
!!context.error.value ||
|
||||
!!query.error.value ||
|
||||
!query.data.value ||
|
||||
context.project.value?.status !== 'completed'
|
||||
)
|
||||
|
||||
/** 批量操作只向就绪镜头提交;最终资产状态由显式刷新确认。 */
|
||||
/** 后台质量任务收口后重新读取资产;失败也要保留已经成功的镜头状态。 */
|
||||
watch(
|
||||
() => videoExecution.query.data.value?.status,
|
||||
(status, previous) => {
|
||||
if ((status === 'completed' || status === 'failed') && status !== previous) void query.refresh()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => promptExecution.query.data.value?.status,
|
||||
(status, previous) => {
|
||||
if ((status === 'completed' || status === 'failed') && status !== previous) void query.refresh()
|
||||
}
|
||||
)
|
||||
|
||||
/** 批量操作只向就绪镜头提交;最终资产状态由轮询查询确认。 */
|
||||
async function run(command: ProductionCommand) {
|
||||
if (
|
||||
blocked.value ||
|
||||
!batchValid.value ||
|
||||
(command === 'prompts' && !promptValid.value) ||
|
||||
(command === 'keyframes' && !keyframeValid.value) ||
|
||||
(command === 'videos' && !videoQualityValid.value)
|
||||
)
|
||||
@@ -126,11 +152,12 @@ export function useProduction() {
|
||||
}
|
||||
await runOperation(projectId, labels[command], async () => {
|
||||
if (command === 'prompts') {
|
||||
target.receipt = {
|
||||
kind: 'prompts',
|
||||
title: labels[command],
|
||||
result: await productionApi.generatePrompts(projectId, input)
|
||||
}
|
||||
const started = await productionApi.startPromptExecution(projectId, {
|
||||
...input,
|
||||
episodeNo: episodeNo.value,
|
||||
limit: promptLimit.value ?? undefined
|
||||
})
|
||||
await promptExecution.track(started.executionId)
|
||||
} else if (command === 'keyframes') {
|
||||
target.receipt = {
|
||||
kind: 'keyframes',
|
||||
@@ -146,15 +173,12 @@ export function useProduction() {
|
||||
})
|
||||
}
|
||||
} else if (command === 'videos') {
|
||||
target.receipt = {
|
||||
kind: 'videos',
|
||||
title: labels[command],
|
||||
result: await productionApi.generateQualityVideos(projectId, {
|
||||
...input,
|
||||
limit: videoLimit.value ?? undefined,
|
||||
maxRepairAttempts: videoRepairAttempts.value ?? 0
|
||||
})
|
||||
}
|
||||
const started = await productionApi.startQualityVideoExecution(projectId, {
|
||||
...input,
|
||||
limit: videoLimit.value ?? undefined,
|
||||
maxRepairAttempts: videoRepairAttempts.value ?? 0
|
||||
})
|
||||
await videoExecution.track(started.executionId)
|
||||
} else {
|
||||
target.receipt = {
|
||||
kind: 'retry',
|
||||
@@ -186,12 +210,16 @@ export function useProduction() {
|
||||
keyframeLimit,
|
||||
keyframeWidth,
|
||||
keyframeHeight,
|
||||
promptLimit,
|
||||
videoLimit,
|
||||
videoRepairAttempts,
|
||||
keyframeValid,
|
||||
promptValid,
|
||||
videoQualityValid,
|
||||
batchValid,
|
||||
blocked,
|
||||
run
|
||||
run,
|
||||
promptExecution,
|
||||
videoExecution
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user