feat: 分镜自动读取主体参考图

This commit is contained in:
GouJ committed 2026-09-25 00:20:58 +08:00
1 parent 70fc636195
commit 61c14ec22e
1 file changed
+10 -5
@@ -35,9 +35,16 @@ function reset() {
busy.value = { references: false, spec: false }
}
watch(() => JSON.stringify([props.projectId, props.shot.shotId, props.shot.direction, props.shot.visualState]), reset)
watch(
() => [props.projectId, props.shot.shotId] as const,
() => {
void load('references')
},
{ immediate: true }
)
onScopeDispose(reset)
/** 只在用户点击后读取参考图或编译规格;两种 GET 均不调用生成模型。 */
/** 参考图进入镜头时自动读取;生成规格仍由用户显式编译,两种 GET 均不调用生成模型。 */
async function load(kind: 'references' | 'spec') {
if (busy.value[kind] || locked.value || (kind === 'spec' && (!props.shot.direction || !props.shot.visualState)))
return
@@ -108,13 +115,11 @@ function exportResult(kind: 'spec' | 'prompt') {
<div class="flex flex-wrap items-center justify-between gap-3">
<h3 class="text-sm font-semibold">主体参考图</h3>
<NButton :disabled="busy.references || locked" @click="load('references')"
><RefreshCw :size="13" :class="{ 'animate-spin': busy.references }" />{{
references ? '刷新参考图' : '读取参考图'
}}</NButton
><RefreshCw :size="13" :class="{ 'animate-spin': busy.references }" />刷新参考图</NButton
>
</div>
<p class="mt-2 text-xs leading-6 text-muted">
读取镜头已绑定形态的图片,不生成新图。参考图缺失会影响视频提示词生成。
自动读取镜头当前绑定形态的主参考图,不生成新图。切换镜头会同步刷新,参考图缺失会影响后续生成。
</p>
<NAlert v-if="errors.references" role="alert" type="error" :show-icon="false" class="mt-3">{{
errors.references