diff --git a/src/features/production/components/KeyframeDialog.vue b/src/features/production/components/KeyframeDialog.vue index 2682227..f0146bf 100644 --- a/src/features/production/components/KeyframeDialog.vue +++ b/src/features/production/components/KeyframeDialog.vue @@ -4,6 +4,9 @@ import { NFormItem } from 'naive-ui' import { sizeRules } from '../../../lib/form-rules' import { NAlert, NButton, NCheckbox, NCollapse, NCollapseItem, NInputNumber, NTag } from 'naive-ui' import { computed, ref, watch } from 'vue' +import { generationConfigApi } from '../../generation-config/api' +import type { CreativeProfileAspectRatio, GenerationModelCatalog, GenerationOptions } from '../../generation-config/types' +import GenerationModelControls from '../../generation-config/components/GenerationModelControls.vue' import { AppDialog } from '../../../components/ui' import { errorMessage } from '../../../lib/http' import { productionApi } from '../api' @@ -14,6 +17,7 @@ import type { GenerateKeyframeInput, KeyframeGenerationPreview } from '../types' const props = defineProps<{ shotId: string shotTitle: string + projectId: string disabled: boolean replacePrimary?: boolean }>() @@ -25,17 +29,37 @@ const confirmed = ref(false) const preview = ref(null) const previewError = ref('') const previewPending = ref(false) +const generationCatalog = ref(null) +const generationCatalogError = ref('') +const imageProvider = ref('') +const imageGenerationOptions = ref({}) +const projectAspectRatio = ref('9:16') const sizeValid = computed(() => validOptionalSize(width.value, height.value)) const canSubmit = computed(() => !props.disabled && sizeValid.value && confirmed.value) /** 切换镜头或重新打开时清空费用确认;新图一律先作为候选。 */ -function reset() { +async function reset() { width.value = '' height.value = '' confirmed.value = false preview.value = null previewError.value = '' previewPending.value = false + generationCatalogError.value = '' + if (!open.value) return + try { + const [catalog, profile] = await Promise.all([ + generationConfigApi.catalog(), + generationConfigApi.profile(props.projectId) + ]) + generationCatalog.value = catalog + projectAspectRatio.value = profile?.aspectRatio ?? '9:16' + imageProvider.value = profile?.imageProvider || catalog.defaults.imageProvider + const selected = catalog.images.find(item => item.provider === imageProvider.value) + imageGenerationOptions.value = { ...selected?.defaults, ...profile?.imageOptions } + } catch (cause) { + generationCatalogError.value = errorMessage(cause) + } } watch([() => props.shotId, open], reset, { immediate: true }) @@ -44,6 +68,8 @@ function submit() { if (!canSubmit.value) return emit('generate', { ...(width.value === '' ? {} : { width: width.value, height: height.value as number }), + provider: imageProvider.value || undefined, + generationOptions: imageGenerationOptions.value, setPrimary: false }) open.value = false @@ -87,6 +113,24 @@ async function loadPreview() { 当前主首帧使用的主体参考资产已经变化。新图成功后应设为主首帧,旧图会继续保留为历史候选。 +
+

本次生成设置

+

仅覆盖当前镜头本次首帧生成,不修改项目默认图片模型。

+ +
+ + 生成模型目录读取失败:{{ generationCatalogError }} +
预览实际生成输入 只读取参考图规划与最终 Prompt,不调用图片模型。