feat: display current video generation reference images inline
This commit is contained in:
1 parent
6d569e828e
commit
3496b472c4
1 file changed
+50
-2
@@ -3,7 +3,7 @@ import ProviderInputInspector from './ProviderInputInspector.vue'
|
||||
import { NAlert, NButton, NCollapse, NCollapseItem, NTag } from 'naive-ui'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { ExternalLink, ImagePlus, RefreshCw } from '@lucide/vue'
|
||||
import { StatusBadge } from '../../../components/ui'
|
||||
import { AssetImage, StatusBadge } from '../../../components/ui'
|
||||
import { usePolling } from '../../../composables/usePolling'
|
||||
import { mediaAssetUrl } from '../../../lib/assets'
|
||||
import { errorMessage } from '../../../lib/http'
|
||||
@@ -74,6 +74,11 @@ const promptQuery = usePolling(key, (shotId, signal) => storyboardApi.videoPromp
|
||||
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 currentVideoInput = computed(() =>
|
||||
videoInputQuery.data.value?.shotId === key.value ? videoInputQuery.data.value : null
|
||||
)
|
||||
const keyframes = computed(() => query.data.value?.keyframes ?? [])
|
||||
const videos = computed(() => query.data.value?.videos ?? [])
|
||||
const videoQualityStatus = computed(() => query.data.value?.qualityStatus ?? null)
|
||||
@@ -158,7 +163,7 @@ function safeVideoUrl(value: string | null): string | null {
|
||||
|
||||
/** 重新读取单镜头资产,并通知父页刷新项目就绪状态。 */
|
||||
async function refreshAll() {
|
||||
await Promise.all([query.refresh(), promptQuery.refresh()])
|
||||
await Promise.all([query.refresh(), promptQuery.refresh(), videoInputQuery.refresh()])
|
||||
emit('changed')
|
||||
}
|
||||
|
||||
@@ -433,6 +438,46 @@ async function inspectSpecs() {
|
||||
{{ issueLabel(issue.code) }}:{{ issue.reason }}
|
||||
</li>
|
||||
</ul>
|
||||
<section class="surface-inset mt-4 p-4" aria-label="当前视频生成素材引用">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<h6 class="text-xs font-medium">当前视频生成素材引用</h6>
|
||||
<span v-if="currentVideoInput" class="text-[11px] text-muted">
|
||||
主首帧 1 张 · 主体参考图 {{ currentVideoInput.references.length }} 张
|
||||
</span>
|
||||
</div>
|
||||
<p class="mt-2 text-xs text-muted">以下是当前镜头的生成输入;已生成的视频可能使用更早的素材。</p>
|
||||
<div v-if="currentVideoInput" class="video-input-grid mt-4">
|
||||
<article class="min-w-0 bg-(--app-subtle)">
|
||||
<AssetImage :src="currentVideoInput.providerInputKeyframe.imageUrl"
|
||||
:alt="`镜头 ${shot.shotNo} 视频输入首帧`" preview object-fit="contain" />
|
||||
<div class="p-2 text-xs">
|
||||
<p class="font-medium">视频输入首帧</p>
|
||||
<p v-if="currentVideoInput.providerInputKeyframe.source === 'provider_variant'"
|
||||
class="mt-1 text-[11px] text-muted">模型专用变体</p>
|
||||
</div>
|
||||
</article>
|
||||
<article v-for="reference in currentVideoInput.references"
|
||||
:key="`${reference.subjectId}:${reference.imageId}`" class="min-w-0 bg-(--app-subtle)">
|
||||
<AssetImage :src="reference.imageUrl" :alt="`${reference.subjectName} ${reference.subjectFormName} 参考图`"
|
||||
preview object-fit="contain" />
|
||||
<div class="min-w-0 p-2 text-xs">
|
||||
<p class="truncate font-medium" :title="reference.subjectName">{{ reference.subjectName }}</p>
|
||||
<p class="mt-1 truncate text-[11px] text-muted" :title="reference.subjectFormName">
|
||||
{{ reference.subjectFormName }} · {{ reference.subjectRef }}
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<p v-else-if="videoInputQuery.loading.value" role="status" class="mt-4 text-xs text-muted">
|
||||
正在读取视频生成素材…
|
||||
</p>
|
||||
<div v-else class="mt-4 text-xs text-muted">
|
||||
<p>当前生成规格尚未就绪,请检查视频提示词、主首帧与主体参考图。</p>
|
||||
<p v-if="videoInputQuery.error.value" class="mt-2 break-words">{{ videoInputQuery.error.value }}</p>
|
||||
<NButton v-if="videoInputQuery.error.value" text size="small" class="mt-2"
|
||||
@click="videoInputQuery.refresh">重新读取</NButton>
|
||||
</div>
|
||||
</section>
|
||||
<NAlert
|
||||
v-if="videoQualityStatus && videoQualityStatus.status !== 'not_started'"
|
||||
:type="
|
||||
@@ -675,6 +720,9 @@ async function inspectSpecs() {
|
||||
0 0 0 1px rgb(0 0 0 / 55%),
|
||||
0 2px 8px rgb(0 0 0 / 35%);
|
||||
}
|
||||
.video-input-grid {
|
||||
@apply grid grid-cols-[repeat(auto-fill,_minmax(min(160px,_100%),_1fr))] gap-3;
|
||||
}
|
||||
.video-grid {
|
||||
@apply grid grid-cols-[repeat(auto-fill,_minmax(min(260px,_100%),_1fr))] gap-3;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user