移除"从素材提取尾帧"功能(上游已实现类似功能)
- 移除 ExtractFrame handler 和路由 - 移除 AssetService 中的 ExtractFrameFromAsset 方法 - 移除 FFmpeg 中的 ExtractFrame 方法 - 移除前端 extractFrame API 和相关 UI Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -43,9 +43,5 @@ export const assetAPI = {
|
||||
|
||||
importFromVideo(videoGenId: number) {
|
||||
return request.post<Asset>(`/assets/import/video/${videoGenId}`)
|
||||
},
|
||||
|
||||
extractFrame(assetId: number, data: { position: string; storyboard_id: number; frame_type?: string }) {
|
||||
return request.post(`/assets/${assetId}/extract-frame`, data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,24 +239,6 @@
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<!-- 从素材提取尾帧 -->
|
||||
<div class="extract-frame-section" v-if="selectedFrameType === 'first'" style="margin: 12px 0; padding: 12px; background: #f5f7fa; border-radius: 8px;">
|
||||
<div class="section-label" style="margin-bottom: 8px;">从素材提取尾帧(用于画面连续性)</div>
|
||||
<div style="display: flex; gap: 10px; align-items: center;">
|
||||
<el-select v-model="selectedAssetForExtract" placeholder="选择视频素材" style="width: 300px;" size="small">
|
||||
<el-option
|
||||
v-for="asset in videoAssets"
|
||||
:key="asset.id"
|
||||
:label="`镜头 #${asset.storyboard_num || asset.id} - ${asset.name}`"
|
||||
:value="asset.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" :loading="extractingFrame" :disabled="!selectedAssetForExtract" @click="extractLastFrame">
|
||||
提取尾帧
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 提示词区域 -->
|
||||
<div class="prompt-section">
|
||||
<div class="section-label">
|
||||
@@ -1004,8 +986,6 @@ const generatingImage = ref(false)
|
||||
const generatedImages = ref<ImageGeneration[]>([])
|
||||
const isSwitchingFrameType = ref(false) // 标志位:是否正在切换帧类型
|
||||
const loadingImages = ref(false)
|
||||
const selectedAssetForExtract = ref<number | null>(null) // 选中的素材用于提取尾帧
|
||||
const extractingFrame = ref(false) // 是否正在提取尾帧
|
||||
let pollingTimer: any = null
|
||||
let pollingFrameType: FrameType | null = null // 记录正在轮询的帧类型
|
||||
|
||||
@@ -1722,35 +1702,6 @@ const generateFrameImage = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 从素材提取尾帧
|
||||
const extractLastFrame = async () => {
|
||||
if (!selectedAssetForExtract.value || !currentStoryboard.value) {
|
||||
ElMessage.warning('请先选择视频素材')
|
||||
return
|
||||
}
|
||||
|
||||
extractingFrame.value = true
|
||||
try {
|
||||
const result = await assetAPI.extractFrame(selectedAssetForExtract.value, {
|
||||
position: 'last',
|
||||
storyboard_id: currentStoryboard.value.id,
|
||||
frame_type: 'first' // 提取的尾帧用作当前分镜的首帧
|
||||
})
|
||||
|
||||
ElMessage.success('尾帧提取成功,已添加到首帧图片列表')
|
||||
|
||||
// 刷新图片列表
|
||||
await loadStoryboardImages(currentStoryboard.value!.id, 'first')
|
||||
|
||||
// 清空选择
|
||||
selectedAssetForExtract.value = null
|
||||
} catch (error: any) {
|
||||
ElMessage.error('提取失败: ' + (error.message || '未知错误'))
|
||||
} finally {
|
||||
extractingFrame.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 删除图片生成记录
|
||||
const deleteImage = async (imageId: number) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user