feat(short-drama-agent-front): 接入摄影审核与首帧制作
This commit is contained in:
1 parent
3503926d62
commit
751106985e
32 files changed
+1970
-153
No files matched your search
@@ -28,6 +28,7 @@ import type {
|
||||
GenerateKeyframeInput,
|
||||
KeyframeReadinessItem,
|
||||
KeyframeSpec,
|
||||
KeyframeGenerationPreview,
|
||||
PromptReadinessItem,
|
||||
VideoGenerationSpec,
|
||||
VideoReadinessItem
|
||||
@@ -47,6 +48,8 @@ import KeyframeValidationHistory from './KeyframeValidationHistory.vue'
|
||||
import { AppDialog } from '../../../components/ui'
|
||||
import ModelCapabilities from './ModelCapabilities.vue'
|
||||
import type { QualityTarget } from '../quality.types'
|
||||
import ImageGenerationPreview from '../../subject-images/components/ImageGenerationPreview.vue'
|
||||
import { visionState } from '../keyframe-vision'
|
||||
import { clearVideoConflict, clearVideoQualification, sessionKeyframePassed, sessionVideoValidation } from '../quality'
|
||||
import { useProjectGenerationRevision } from '../../generation-config/context'
|
||||
import { generationConfigApi } from '../../generation-config/api'
|
||||
@@ -98,6 +101,8 @@ const props = defineProps<{
|
||||
keyframeReadiness?: KeyframeReadinessItem
|
||||
/** 视频就绪项。 */
|
||||
videoReadiness?: VideoReadinessItem
|
||||
/** 分镜工作台只展示单镜头首帧,不进入项目级制作。 */
|
||||
keyframeOnly?: boolean
|
||||
/** 是否从深链接打开首帧生成。 */
|
||||
openKeyframe?: boolean
|
||||
/** 页面上游状态是否阻断操作。 */
|
||||
@@ -136,6 +141,18 @@ const assetPollInterval = computed(() => {
|
||||
query = usePolling(
|
||||
key,
|
||||
async (shotId, signal) => {
|
||||
if (props.keyframeOnly) {
|
||||
const keyframes = await productionApi.listKeyframes(shotId, signal)
|
||||
if (keyframes.some(item => item.shotId !== shotId)) throw new Error('候选与当前镜头不匹配。')
|
||||
return {
|
||||
keyframes,
|
||||
videos: [],
|
||||
qualityStatus: null,
|
||||
qualityStatusError: '',
|
||||
inputPlan: null,
|
||||
inputPlanError: ''
|
||||
}
|
||||
}
|
||||
const [keyframes, videos, qualityState, inputPlanState] = await Promise.all([
|
||||
productionApi.listKeyframes(shotId, signal),
|
||||
productionApi.listVideos(shotId, signal),
|
||||
@@ -164,10 +181,19 @@ query = usePolling(
|
||||
assetPollInterval
|
||||
)
|
||||
/** 单独读取已保存的提示词,查询失败不影响首帧和视频资产展示。 */
|
||||
const promptQuery = usePolling(key, (shotId, signal) => storyboardApi.videoPrompt(shotId, signal), false)
|
||||
const promptQuery = usePolling(
|
||||
key,
|
||||
(shotId, signal) => (props.keyframeOnly ? Promise.resolve(null) : storyboardApi.videoPrompt(shotId, signal)),
|
||||
false
|
||||
)
|
||||
const savedPrompt = computed(() => (promptQuery.data.value?.shotId === key.value ? promptQuery.data.value : null))
|
||||
/** 当前视频生成规格的首帧和主体参考图,独立查询避免影响资产列表。 */
|
||||
const videoInputQuery = usePolling(key, (shotId, signal) => productionApi.videoGenerationSpec(shotId, signal), false)
|
||||
const videoInputQuery = usePolling(
|
||||
key,
|
||||
(shotId, signal) =>
|
||||
props.keyframeOnly ? Promise.resolve(null) : productionApi.videoGenerationSpec(shotId, signal),
|
||||
false
|
||||
)
|
||||
/** 素材查询问题与就绪检查使用同一中文说明,避免重复展示后端术语。 */
|
||||
const videoInputError = computed(() => productionMessage(videoInputQuery.error.value))
|
||||
/** 视频准备问题按实际含义去重,保留所有不同的处理建议。 */
|
||||
@@ -322,6 +348,30 @@ function openShotKeyframeQuality() {
|
||||
}
|
||||
/** 当前查看历史的候选 ID;历史记录在独立弹窗内按候选隔离。 */
|
||||
const historyKeyframeId = ref('')
|
||||
/** 当前会话保留最近一次真实正式预览,只用于相同候选输入的证据展示。 */
|
||||
const latestKeyframePreview = ref<KeyframeGenerationPreview | null>(null)
|
||||
/** 历史候选的实际输入只有指纹完全一致时才能显示。 */
|
||||
const historyInput = computed(() => {
|
||||
const preview = latestKeyframePreview.value
|
||||
const item = keyframes.value.find(candidate => candidate.id === historyKeyframeId.value)
|
||||
return preview &&
|
||||
item &&
|
||||
item.shotId === preview.shotId &&
|
||||
preview.previewFingerprint === item.providerInputFingerprint
|
||||
? preview
|
||||
: null
|
||||
})
|
||||
/** 历史候选画幅或来源失效时保留浏览、禁止人工采用。 */
|
||||
const historyBlocked = computed(() => {
|
||||
const item = keyframes.value.find(candidate => candidate.id === historyKeyframeId.value)
|
||||
return (
|
||||
assetBlocked.value ||
|
||||
!item ||
|
||||
item.canvasDiagnosis?.status === 'mismatch' ||
|
||||
item.inputSnapshotStatus === 'invalid' ||
|
||||
(item.isPrimary && keyframeStale.value)
|
||||
)
|
||||
})
|
||||
/** 首帧校验历史弹窗的显示状态。 */
|
||||
const historyOpen = ref(false)
|
||||
/**
|
||||
@@ -341,6 +391,7 @@ const videoSpec = ref<VideoGenerationSpec | null>(null)
|
||||
const canGeneratePrompt = computed(
|
||||
() => !assetBlocked.value && !!props.promptReadiness && props.promptReadiness.issues.length === 0
|
||||
)
|
||||
/** 付费生成同时要求当前镜头就绪和有效正式预览。 */
|
||||
const canGenerateKeyframe = computed(
|
||||
() =>
|
||||
!assetBlocked.value &&
|
||||
@@ -518,14 +569,28 @@ async function setPrimaryKeyframe() {
|
||||
if (
|
||||
assetBlocked.value ||
|
||||
!keyframeId ||
|
||||
keyframes.value.find(item => item.id === keyframeId)?.source === 'provider_variant'
|
||||
!keyframes.value.some(
|
||||
item =>
|
||||
item.id === keyframeId &&
|
||||
item.source !== 'provider_variant' &&
|
||||
item.status === 'completed' &&
|
||||
!!item.imageUrl &&
|
||||
item.canvasDiagnosis?.status !== 'mismatch' &&
|
||||
item.inputSnapshotStatus !== 'invalid' &&
|
||||
!item.recoveryRequired
|
||||
)
|
||||
)
|
||||
return
|
||||
const shotId = props.shot.shotId
|
||||
confirmingKeyframe.value = ''
|
||||
await runOperation(props.projectId, `设置镜头 ${props.shot.shotNo} 主首帧`, async () => {
|
||||
// 晋升前重新读取持久化质量结论,刷新页面后也认可真实历史通过。
|
||||
const review = await qualityApi.keyframeQualityReview(shotId, keyframeId)
|
||||
const [review, history] = await Promise.all([
|
||||
qualityApi.keyframeQualityReview(shotId, keyframeId),
|
||||
qualityApi.keyframeHistory(shotId, keyframeId)
|
||||
])
|
||||
const vision = visionState(history)
|
||||
if (vision.active || vision.unknown || vision.resumable) throw new Error('审核尚未结算,暂不能设为主首帧。')
|
||||
if (!['passed', 'manual_accepted'].includes(review.effectiveQualityStatus))
|
||||
throw new Error('此候选尚未通过当前质量要求,请先完成质量检查或有效人工复核。')
|
||||
const result = await productionApi.setPrimaryKeyframe(shotId, keyframeId)
|
||||
@@ -620,7 +685,8 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
>{{ query.error.value }} 当前保留上次成功读取的资产,操作已暂停。
|
||||
</ContextNotice>
|
||||
|
||||
<div class="production-stage">
|
||||
<!-- 以下是项目制作中的视频提示词模块 -->
|
||||
<div v-if="!keyframeOnly" class="production-stage">
|
||||
<div class="production-stage-heading">
|
||||
<div>
|
||||
<h5 class="text-sm font-medium">01 · 视频提示词</h5>
|
||||
@@ -681,7 +747,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
<div class="production-stage">
|
||||
<div class="production-stage-heading">
|
||||
<div>
|
||||
<h5 class="text-sm font-medium">02 · 首帧</h5>
|
||||
<h5 class="text-sm font-medium">{{ keyframeOnly ? '本镜首帧' : '02 · 首帧' }}</h5>
|
||||
</div>
|
||||
<!-- 以下是首帧状态与对应原因入口模块,过期使用警告色 -->
|
||||
<ProductionStageStatus
|
||||
@@ -709,6 +775,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
@quality="openQuality('keyframe', currentKeyframe.id)"
|
||||
@edit="openEdit(currentKeyframe)"
|
||||
@history="openKeyframeHistory(currentKeyframe.id)"
|
||||
@settled="refreshAfterReview"
|
||||
/>
|
||||
</div>
|
||||
<p v-else class="mt-4 text-xs text-muted">尚无已确认主首帧。请生成候选,完成质量检查后再设为主首帧。</p>
|
||||
@@ -729,7 +796,10 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
视频质量链状态暂时无法读取;视频资产仍可查看。请稍后刷新。
|
||||
</ContextNotice>
|
||||
<div class="production-stage-actions">
|
||||
<NButton :disabled="!episodeNo || !canGenerateKeyframe" @click="openShotKeyframeQuality"
|
||||
<NButton
|
||||
v-if="!keyframeOnly"
|
||||
:disabled="!episodeNo || !canGenerateKeyframe"
|
||||
@click="openShotKeyframeQuality"
|
||||
>本镜首帧质量重跑</NButton
|
||||
>
|
||||
<NButton v-if="keyframeCandidates.length" @click="candidatesOpen = true">
|
||||
@@ -741,7 +811,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
</NTag>
|
||||
<NButton
|
||||
:loading="isOperationRunning(getOperation(projectId), `生成镜头 ${shot.shotNo} 首帧`)"
|
||||
:disabled="!canGenerateKeyframe"
|
||||
:disabled="!query.data.value"
|
||||
@click="keyframeOpen = true"
|
||||
><ImagePlus :size="14" />{{
|
||||
keyframeStale ? '生成替代候选' : currentKeyframe ? '再生成一张候选' : '生成首帧候选'
|
||||
@@ -750,7 +820,8 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="production-stage">
|
||||
<!-- 以下是项目制作中的视频资产模块 -->
|
||||
<div v-if="!keyframeOnly" class="production-stage">
|
||||
<div class="production-stage-heading">
|
||||
<div>
|
||||
<h5 class="text-sm font-medium">03 · 视频</h5>
|
||||
@@ -1039,6 +1110,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
@quality="openQuality('keyframe', item.id)"
|
||||
@edit="openEdit(item)"
|
||||
@history="openKeyframeHistory(item.id)"
|
||||
@settled="refreshAfterReview"
|
||||
@select="confirmingKeyframe = item.id"
|
||||
@confirm="setPrimaryKeyframe"
|
||||
@cancel="confirmingKeyframe = ''"
|
||||
@@ -1094,17 +1166,33 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
</AppDialog>
|
||||
<AppDialog
|
||||
v-model:open="historyOpen"
|
||||
title="首帧校验历史"
|
||||
description="查看当前候选的质量证据、历史记录和人工复核操作。"
|
||||
title="首帧记录"
|
||||
description="核对当前候选的生成输入、视觉审核与人工复核。"
|
||||
wide
|
||||
>
|
||||
<!-- 以下是同指纹的实际输入,历史无法取得时如实说明 -->
|
||||
<NCollapse v-if="historyOpen" class="mb-4">
|
||||
<NCollapseItem name="generation" title="当次参考图和画面描述">
|
||||
<ImageGenerationPreview
|
||||
v-if="historyInput"
|
||||
:preview="historyInput"
|
||||
:loading="false"
|
||||
error=""
|
||||
stale-notice=""
|
||||
display-only
|
||||
/>
|
||||
<p v-else class="text-xs text-muted">
|
||||
当前无法读取这张图的原始生成输入。可查看候选原图和已有审核记录。
|
||||
</p>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
<KeyframeValidationHistory
|
||||
v-if="historyOpen && historyKeyframeId"
|
||||
:key="historyKeyframeId"
|
||||
:project-id="projectId"
|
||||
:shot-id="shot.shotId"
|
||||
:keyframe-id="historyKeyframeId"
|
||||
:disabled="assetBlocked"
|
||||
:disabled="historyBlocked"
|
||||
initial-open
|
||||
@reviewed="refreshAfterReview"
|
||||
/>
|
||||
@@ -1120,6 +1208,7 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
:disabled="!canGenerateKeyframe"
|
||||
:previous-candidate-ids="keyframes.map(item => item.id)"
|
||||
:submit-generation="generateKeyframe"
|
||||
@previewed="latestKeyframePreview = $event"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
Reference in new issue
Block a user