feat: 单镜视频生成支持手动选择模型参数
This commit is contained in:
1 parent
0f5464465d
commit
23de200cfd
1 file changed
+50
-1
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import ProviderInputInspector from './ProviderInputInspector.vue'
|
||||
import { NAlert, NButton, NCollapse, NCollapseItem, NTag } from 'naive-ui'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { ExternalLink, ImagePlus, RefreshCw } from '@lucide/vue'
|
||||
import { AssetImage, StatusBadge } from '../../../components/ui'
|
||||
import { usePolling } from '../../../composables/usePolling'
|
||||
@@ -37,6 +37,9 @@ import { AppDialog } from '../../../components/ui'
|
||||
import ModelCapabilities from './ModelCapabilities.vue'
|
||||
import type { QualityTarget } from '../quality.types'
|
||||
import { sessionKeyframePassed, sessionVideoValidation } from '../quality'
|
||||
import { generationConfigApi } from '../../generation-config/api'
|
||||
import type { CreativeProfileAspectRatio, GenerationModelCatalog, GenerationOptions } from '../../generation-config/types'
|
||||
import GenerationModelControls from '../../generation-config/components/GenerationModelControls.vue'
|
||||
|
||||
/** 单镜头生产面板只负责正式资产,不修改上游导演设计与即时状态。 */
|
||||
const props = defineProps<{
|
||||
@@ -112,6 +115,31 @@ const qualityOpen = ref(false)
|
||||
const candidatesOpen = ref(false)
|
||||
const qualityTarget = ref<QualityTarget | null>(null)
|
||||
const specsOpen = ref(false)
|
||||
const generationCatalog = ref<GenerationModelCatalog | null>(null)
|
||||
const generationCatalogError = ref('')
|
||||
const videoProvider = ref('')
|
||||
const videoGenerationOptions = ref<GenerationOptions>({})
|
||||
const projectAspectRatio = ref<CreativeProfileAspectRatio>('9:16')
|
||||
|
||||
/** 单镜手动生成默认继承项目配置,用户修改只作用于本次请求。 */
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const [catalog, profile] = await Promise.all([
|
||||
generationConfigApi.catalog(),
|
||||
generationConfigApi.profile(props.projectId)
|
||||
])
|
||||
generationCatalog.value = catalog
|
||||
projectAspectRatio.value = profile?.aspectRatio ?? '9:16'
|
||||
videoProvider.value = profile?.videoProvider || catalog.defaults.videoProvider
|
||||
const selected = catalog.videos.find(item => item.provider === videoProvider.value)
|
||||
videoGenerationOptions.value = {
|
||||
...(selected?.defaults ?? {}),
|
||||
...(profile?.videoOptions ?? {})
|
||||
}
|
||||
} catch (cause) {
|
||||
generationCatalogError.value = errorMessage(cause)
|
||||
}
|
||||
})
|
||||
|
||||
/** 从实际候选打开质量面板,保留单镜头主操作。 */
|
||||
function openQuality(kind: 'keyframe' | 'video', assetId: string) {
|
||||
@@ -229,6 +257,9 @@ async function generateVideo() {
|
||||
const shotId = props.shot.shotId
|
||||
await runOperation(props.projectId, `提交镜头 ${props.shot.shotNo} 视频质量任务`, async () => {
|
||||
const result = await productionApi.generateQualityVideo(shotId, {
|
||||
provider: videoProvider.value || undefined,
|
||||
inputMode: videoInputPlan.value?.inputMode,
|
||||
generationOptions: videoGenerationOptions.value,
|
||||
maxRepairAttempts: 2,
|
||||
allowedTexts: []
|
||||
})
|
||||
@@ -613,6 +644,24 @@ async function inspectSpecs() {
|
||||
<p v-if="videos.some(item => !item.isPrimary)" class="mt-3 text-xs text-muted">
|
||||
质量链状态来自后端持久化记录;手动晋升候选仍需在当前页面完成一次视觉校验。自动质量任务通过后会直接更新主视频。
|
||||
</p>
|
||||
<section v-if="generationCatalog" class="surface-inset mt-4 p-4" aria-label="本次视频生成模型设置">
|
||||
<p class="text-xs font-medium">本次生成设置</p>
|
||||
<p class="mt-1 text-xs text-muted">仅覆盖当前镜头本次生成,不修改项目默认模型。</p>
|
||||
<GenerationModelControls
|
||||
class="mt-4"
|
||||
type="video"
|
||||
:catalog="generationCatalog"
|
||||
:provider="videoProvider"
|
||||
:options="videoGenerationOptions"
|
||||
:aspect-ratio="projectAspectRatio"
|
||||
:disabled="assetBlocked"
|
||||
@update:provider="videoProvider = $event"
|
||||
@update:options="videoGenerationOptions = $event"
|
||||
/>
|
||||
</section>
|
||||
<NAlert v-else-if="generationCatalogError" type="warning" :show-icon="false" class="mt-4 text-xs">
|
||||
生成模型目录读取失败:{{ generationCatalogError }}
|
||||
</NAlert>
|
||||
<div class="production-stage-actions">
|
||||
<ConfirmAction
|
||||
:label="
|
||||
|
||||
Reference in new issue
Block a user