From 6e3a0c6d2db876d1e8396b7dcebb72e6314fa6d9 Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Tue, 7 Apr 2026 03:56:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=E7=94=9F=E6=88=90=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=8F=90=E7=A4=BA=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workbench/generateVideoPrompt.ts | 47 +------------------ 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/src/routes/production/workbench/generateVideoPrompt.ts b/src/routes/production/workbench/generateVideoPrompt.ts index 7e453f6..a0bf5ca 100644 --- a/src/routes/production/workbench/generateVideoPrompt.ts +++ b/src/routes/production/workbench/generateVideoPrompt.ts @@ -50,29 +50,6 @@ export default router.post( } }), ); - const assetsIds = images.map((i) => { - if (i._type == "storyboard") { - return i.associateAssetsIds; - } - }); - const setIds = new Set(assetsIds.filter(Boolean).flat()); - - const assetsData = await u - .db("o_assets") - .leftJoin("o_image", "o_assets.imageId", "o_image.id") - .where("o_assets.id", "in", Array.from(setIds)) - .select("o_assets.id", "o_image.filePath", "o_assets.name", "o_assets.type"); - await Promise.all( - assetsData.map(async (i) => { - if (i.filePath) { - i.filePath = await u.oss.getFileUrl(i.filePath); - } - }), - ); - const assetsRecord: Record = {}; - assetsData.forEach((i) => { - assetsRecord[i.id] = i; - }); // 拆分 assets 和 storyboard const assets: any[] = []; @@ -85,7 +62,7 @@ export default router.post( type: item.type, name: item.name, }); - if (item._type === "storyboard") { + if (item._type === "storyboard") storyboard.push({ videoDesc: item.videoDesc, prompt: item.prompt, @@ -94,30 +71,10 @@ export default router.post( associateAssetsIds: item.associateAssetsIds, shouldGenerateImage: item.shouldGenerateImage, }); - if (item.associateAssetsIds && item.associateAssetsIds.length) { - item.associateAssetsIds.forEach((i: number) => { - const data = assetsRecord[i]; - const extingIndex = assets.find((sub) => sub.id == data.id); - if (data && !extingIndex) { - assets.push({ - id: data.id, - type: data.type, - name: data.name, - }); - } - }); - } - } } const [id, modelData] = model.split(":"); const projectData = await u.db("o_project").select("*").where({ id: projectId }).first(); const videoPrompt = await u.db("o_prompt").where("type", "videoPromptGeneration").first(); - let videoPromptGeneration = "" as string | undefined; - if (videoPrompt && videoPrompt.useData) { - videoPromptGeneration = videoPrompt.useData; - } else { - videoPromptGeneration = videoPrompt?.data ?? undefined; - } const artStyle = projectData?.artStyle || "无"; const visualManual = u.getArtPrompt(artStyle, "art_skills", "art_storyboard_video"); const content = ` @@ -137,7 +94,7 @@ export default router.post( try { const { text } = await u.Ai.Text("universalAi").invoke({ - system: videoPromptGeneration, + system: videoPrompt?.data!, messages: [ { role: "assistant",