🎬 火宝短剧 - 基于AI的一站式短剧生成平台 《一句话生成完整短剧,从剧本到成片全自动化》 Huobao Drama - An AI-Powered End-to-End Short Drama Generator "One Sentence to Complete Drama: Fully Automated from Script to Final Video"
TypeScript
feat(style-presets): 风格预设结构化长提示词(多维+禁忌项+一致性锚点)
Connorab855443192b
diff --git a/backend/src/db/sqlite-schema.ts b/backend/src/db/sqlite-schema.tsindex a2a9f7d..ac18882 100644--- a/backend/src/db/sqlite-schema.ts+++ b/backend/src/db/sqlite-schema.ts@@ -297,27 +297,101 @@ export const sqliteSchemaStatements = []/**- * 风格预设种子数据 — value 存入 dramas.style,prompt 注入生图提示词+ * 风格预设种子数据 — value 存入 dramas.style,prompt 注入生图提示词(作为前缀拼接)+ *+ * prompt 统一按多维结构书写,保证跨模型/跨镜头的风格控制力:+ * 核心媒介与渲染 → 线条/造型 → 上色/材质 → 光影 → 色彩调性 → 背景处理 → 画质锚点 → avoid 禁忌项*/export const stylePresetSeeds = [- { name: '3D 漫剧', value: '3d', sortOrder: 1, prompt: '3D CG animation style, game-engine quality render, semi-realistic stylized characters, refined facial features, detailed materials and textures, cinematic lighting, high detail', description: '游戏引擎级 3D 渲染,半写实角色,当前短剧主流的 3D 漫剧质感' },- { name: '日漫赛璐璐', value: 'anime', sortOrder: 2, prompt: 'Japanese anime style, cel shading, clean crisp line art, vivid saturated colors, expressive character designs, detailed painted backgrounds', description: '日式赛璐璐动画风格' },- { name: '吉卜力手绘', value: 'ghibli', sortOrder: 3, prompt: 'Studio Ghibli style, hand-drawn animation, soft watercolor painted backgrounds, warm nostalgic lighting, gentle natural palette, whimsical cozy atmosphere', description: '吉卜力手绘治愈风' },- { name: '水彩绘本', value: 'watercolor', sortOrder: 4, prompt: 'watercolor illustration style, soft translucent washes, visible paper texture, delicate fluid brushwork, light airy atmosphere, hand-painted storybook feel', description: '水彩插画质感' },- { name: '美式漫画', value: 'comic', sortOrder: 5, prompt: 'Western comic book style, bold black ink outlines, halftone dot shading, dynamic saturated colors, dramatic contrast lighting, flat graphic novel look', description: '美式漫画粗线条风格' },+ {+ name: '3D 漫剧', value: '3d', sortOrder: 1,+ prompt: 'high-quality 3D CG animation still, modern game-engine cinematic render, Unreal Engine and Pixar grade quality, semi-realistic stylized characters with refined facial features, clean sculpted anatomy, detailed skin shader with subtle subsurface scattering, PBR materials with crisp detailed textures, volumetric cinematic lighting with soft rim light, rich depth of field, polished film color grading, detailed environment art, sharp focus, consistent character design across shots, avoid flat lighting, avoid plastic waxy skin, avoid low-poly blurry look, avoid 2D flat cel shading, avoid anime line art',+ description: '游戏引擎级 3D 渲染,半写实角色,当前短剧主流的 3D 漫剧质感',+ },+ {+ name: '日漫赛璐璐', value: 'anime', sortOrder: 2,+ prompt: 'Japanese TV anime style, clean cel shading with hard-edged shadow shapes, crisp uniform black line art, vivid saturated color palette, expressive large-eyed character design with on-model proportions, detailed hand-painted anime backgrounds, dramatic anime key lighting with screentone highlights, key-visual poster quality, consistent character design across shots, avoid 3D CGI look, avoid painterly soft blending, avoid watercolor texture, avoid photorealism, avoid thick western comic outlines',+ description: '日式赛璐璐动画风格',+ },+ {+ name: '吉卜力手绘', value: 'ghibli', sortOrder: 3,+ prompt: 'Studio Ghibli hand-drawn animation style, soft painterly brushwork with organic hand-crafted line quality, lush warm watercolor painted backgrounds, gentle natural daylight with nostalgic warm glow, muted earthy natural color palette, whimsical cozy storybook atmosphere, subtle film-grain softness, theatrical background art quality, consistent character design across shots, avoid hard cel shading, avoid 3D render look, avoid neon over-saturated colors, avoid sharp digital edges, avoid photorealism',+ description: '吉卜力手绘治愈风',+ },+ {+ name: '水彩绘本', value: 'watercolor', sortOrder: 4,+ prompt: 'delicate watercolor storybook illustration, soft translucent color washes, visible cold-press paper texture, fluid hand-painted brushstrokes with gentle pigment bleeds, light airy atmosphere, harmonious pastel palette, whimsical children book charm, loose expressive edges, consistent character design across shots, avoid bold black outlines, avoid digital airbrush look, avoid harsh contrast, avoid 3D rendering, avoid photorealism',+ description: '水彩插画质感',+ },+ {+ name: '美式漫画', value: 'comic', sortOrder: 5,+ prompt: 'Western graphic-novel comic book style, bold confident black ink outlines, halftone dot shading and screentone gradients, dynamic saturated colors with dramatic contrast, dramatic spotlight lighting, flat graphic print look, sharp inking details, dynamic cinematic composition, consistent character design across shots, avoid painterly soft blending, avoid watercolor washes, avoid photorealistic rendering, avoid 3D CGI look, avoid anime cel shading',+ description: '美式漫画粗线条风格',+ },+ {+ name: '国风 2.5D', value: 'guofeng', sortOrder: 7,+ prompt: 'Chinese guofeng 2.5D illustration style, semi-realistic donghua-quality character art, elegant flowing line work, rich traditional Chinese aesthetic elements, layered ink-wash inspired atmospheric backgrounds, refined silk and fabric textures, soft luminous lighting with gentle haze, sophisticated muted jewel-tone palette, xianxia drama poster quality, consistent character design across shots, avoid flat cel shading, avoid western comic ink style, avoid photorealism, avoid plastic 3D look, avoid modern clothing and props unless specified',+ description: '国风动画/仙侠剧质感,2.5D 半写实',+ },+ {+ name: '韩系网漫', value: 'webtoon', sortOrder: 8,+ prompt: 'Korean webtoon manhwa style, clean digital painting with soft gradient shading, slim elegant character proportions, large expressive eyes with detailed highlights, soft glowing skin rendering, romantic dreamy lighting, modern pastel-to-vivid color palette, detailed fashion and fabric rendering, webtoon key visual quality, consistent character design across shots, avoid heavy black ink outlines, avoid halftone dots, avoid 3D render look, avoid watercolor paper texture, avoid chibi proportions',+ description: '韩国条漫/网漫精致上色风',+ },+ {+ name: '黑白漫画', value: 'noir', sortOrder: 9,+ prompt: 'black and white manga illustration, high-contrast monochrome ink work, dynamic hatching and cross-hatching shading, bold solid blacks with dramatic negative space, screentone gray gradation, expressive confident ink linework, cinematic noir lighting, professional manga page quality, consistent character design across shots, strictly no color, avoid grayscale blur smudging, avoid painterly soft edges, avoid photorealism, avoid 3D render look',+ description: '黑白漫/ Noir 高对比墨水风',+ },]+/**+ * 旧版种子 prompt(v1 一句话风格描述)— 用于内容寻址升级:+ * 仅当库中行的 prompt 仍等于旧种子值(未被用户在设置页编辑过)才覆盖为新 prompt+ */+const LEGACY_SEED_PROMPTS: Record<string, string> = {+ '3d': '3D CG animation style, game-engine quality render, semi-realistic stylized characters, refined facial features, detailed materials and textures, cinematic lighting, high detail',+ anime: 'Japanese anime style, cel shading, clean crisp line art, vivid saturated colors, expressive character designs, detailed painted backgrounds',+ ghibli: 'Studio Ghibli style, hand-drawn animation, soft watercolor painted backgrounds, warm nostalgic lighting, gentle natural palette, whimsical cozy atmosphere',+ watercolor: 'watercolor illustration style, soft translucent washes, visible paper texture, delicate fluid brushwork, light airy atmosphere, hand-painted storybook feel',+ comic: 'Western comic book style, bold black ink outlines, halftone dot shading, dynamic saturated colors, dramatic contrast lighting, flat graphic novel look',+}++/**+ * 已下架的种子预设 — 内容寻址删除:仅当库中行的 prompt 仍是种子原文+ * (未被用户编辑过)才删除;用户改过的同名行视为用户数据保留。+ * live(真人写实):真人影像过不了平台真人内容审核,下架。+ */+const REMOVED_SEED_PROMPTS: Record<string, string> = {+ live: 'ultra-realistic cinematic live-action look, professional film photography, natural skin tones with detailed pores and realistic texture, true human anatomy and proportions, shallow depth of field with creamy bokeh, cinematic three-point lighting, subtle film grain, 35mm lens cinematic framing, true-to-life color grading, detailed real-world environments, consistent actor appearance across shots, avoid cartoon or anime features, avoid 3D render look, avoid illustration style, avoid plastic waxy skin, avoid over-smoothing beauty filter',+}+// INSERT ... SELECT WHERE NOT EXISTS → 幂等:只补缺失行,不覆盖用户编辑// (SQLite 无 FROM DUAL,无 FROM 的 SELECT 合法)const SEED_SQL = 'INSERT INTO style_presets ("name", "value", "prompt", "description", "sort_order", "is_active", "created_at", "updated_at") SELECT ?, ?, ?, ?, ?, 1, ?, ? WHERE NOT EXISTS (SELECT 1 FROM style_presets WHERE value = ?)'+// 内容寻址升级:命中旧种子原文才更新(用户在设置页改过的行不动)+const UPGRADE_SQL = 'UPDATE style_presets SET "name" = ?, "prompt" = ?, "description" = ?, "sort_order" = ?, "updated_at" = ? WHERE "value" = ? AND "prompt" = ?'+// 内容寻址下架:命中下架种子原文才删除+const REMOVE_SQL = 'DELETE FROM style_presets WHERE "value" = ? AND "prompt" = ?'export function initSqliteSchema(sqlite: Database.Database) {for (const statement of sqliteSchemaStatements) {sqlite.exec(statement)}const insertSeed = sqlite.prepare(SEED_SQL)+ const upgradeSeed = sqlite.prepare(UPGRADE_SQL)+ const removeSeed = sqlite.prepare(REMOVE_SQL)for (const s of stylePresetSeeds) {const ts = new Date().toISOString()insertSeed.run(s.name, s.value, s.prompt, s.description, s.sortOrder, ts, ts, s.value)+ const legacyPrompt = LEGACY_SEED_PROMPTS[s.value]+ if (legacyPrompt) {+ const res = upgradeSeed.run(s.name, s.prompt, s.description, s.sortOrder, ts, s.value, legacyPrompt)+ if (res.changes > 0) console.log(`🎨 风格预设「${s.name}」已升级为结构化提示词`)+ }+ }+ for (const [value, prompt] of Object.entries(REMOVED_SEED_PROMPTS)) {+ const res = removeSeed.run(value, prompt)+ if (res.changes > 0) console.log(`🗑️ 风格预设「${value}」已下架`)}}