feat: 检索词表 + 表情技能 + 海报字重编排 三向增强
- 中文语义词表 425 → 619 条(+194),新增行业细分/商业指标/技术工程/合规风控/节日节气/生活服务等 17 组场景词;对 11.8 万图标名语料复核覆盖率 99.0% - 表情技能 12 → 20(motion 11→13 新增循环接缝/多元素错峰;emotion 1→7 新增强度匹配/场景克制/覆盖度/可读性/调性一致/情绪跳变) - 共享技能 54 → 55:新增头像向技能 avatar-safe-zone(圆/方裁切安全区),映射到方案评审步骤 - 海报字体层级:新增 TYPE_SCALES 四档白名单(impact/editorial/steady/quiet),AI 决策 JSON 增加 typeScaleId,渲染层按预设输出 400/700/800 与字号比;非法值回退默认 - 修复 audit-emojis.html 技能数量断言过期(12→20);emoji-smoke 62/62 通过,audit-emojis 27 通过 0 失败 - 版本联动 20261108e(cn-tags / skills core+layout / sticker skills / poster-generator+ai)
This commit is contained in:
+14
-5
@@ -10,16 +10,20 @@ const HGB_PosterAI = (function () {
|
||||
function buildPrompt(opt) {
|
||||
const layoutList = HGB_PosterGenerator.LAYOUTS.map(l => `${l.id}:${l.name}`).join('\n');
|
||||
const paletteList = HGB_PosterGenerator.PALETTES.map(p => `${p.id}:${p.name}(背景 ${p.bg})`).join('\n');
|
||||
const sys = `你是顶级的海报设计师。请基于用户提供的主题信息,从白名单中选择版式与配色,设计多套专业海报方案。
|
||||
const scaleList = HGB_PosterGenerator.TYPE_SCALES
|
||||
.map(s => `${s.id}:${s.name}(标题 ${s.titleWeight} / 副标题 ${s.subWeight},标题占画布宽 ${Math.round(s.titleRatio * 1000) / 10}%)— ${s.note}`)
|
||||
.join('\n');
|
||||
const sys = `你是顶级的海报设计师。请基于用户提供的主题信息,从白名单中选择版式、配色与字体层级,设计多套专业海报方案。
|
||||
|
||||
设计原则:
|
||||
1. 标题(title)精炼有力、突出主题;副标题(subtitle)补充说明(可空)。
|
||||
2. 版式 layoutId 与配色 paletteId 必须从白名单中选择,不得编造。
|
||||
3. 多套方案尽量使用不同的版式与配色,呈现不同设计方向。
|
||||
4. 每套方案给出贴切的中文方案名(name)与设计理念(concept)。
|
||||
2. 版式 layoutId、配色 paletteId、字体层级 typeScaleId 必须从白名单中选择,不得编造。
|
||||
3. 字体层级按信息调性选择:促销/活动用强冲击,文化/品牌叙事用编辑感,政务/金融用稳健均衡,高端/极简用克制留白。
|
||||
4. 多套方案尽量使用不同的版式、配色与字体层级,呈现不同设计方向。
|
||||
5. 每套方案给出贴切的中文方案名(name)与设计理念(concept)。
|
||||
|
||||
只输出 JSON,不要输出任何其他文字。JSON 结构:
|
||||
{ "overallConcept": "整体理念", "plans": [ { "name": "方案名", "title": "主标题", "subtitle": "副标题(可空)", "paletteId": "indigo", "layoutId": "centered", "concept": "设计理念" } ] }
|
||||
{ "overallConcept": "整体理念", "plans": [ { "name": "方案名", "title": "主标题", "subtitle": "副标题(可空)", "paletteId": "indigo", "layoutId": "centered", "typeScaleId": "impact", "concept": "设计理念" } ] }
|
||||
其中 plans 数组包含 ${opt.count || 5} 套方案。`;
|
||||
const user = `【主题信息】
|
||||
- 行业/主题:${opt.industry || '通用'}
|
||||
@@ -33,6 +37,9 @@ ${layoutList}
|
||||
【配色白名单】
|
||||
${paletteList}
|
||||
|
||||
【字体层级白名单】
|
||||
${scaleList}
|
||||
|
||||
请设计 ${opt.count || 5} 套海报方案。`;
|
||||
return [
|
||||
{ role: 'system', content: sys },
|
||||
@@ -54,6 +61,7 @@ ${paletteList}
|
||||
for (const p of data.plans) {
|
||||
if (!HGB_PosterGenerator.PALETTES.some(x => x.id === p.paletteId)) p._paletteInvalid = true;
|
||||
if (!HGB_PosterGenerator.LAYOUTS.some(x => x.id === p.layoutId)) p._layoutInvalid = true;
|
||||
if (!HGB_PosterGenerator.TYPE_SCALES.some(x => x.id === p.typeScaleId)) p._scaleInvalid = true;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
@@ -63,6 +71,7 @@ ${paletteList}
|
||||
const decision = HGB_PosterGenerator.defaultDecision(p.title, p.subtitle);
|
||||
if (!p._paletteInvalid) decision.paletteId = p.paletteId;
|
||||
if (!p._layoutInvalid) decision.layoutId = p.layoutId;
|
||||
if (!p._scaleInvalid) decision.typeScaleId = p.typeScaleId;
|
||||
const elements = HGB_PosterGenerator.generate(spec, decision);
|
||||
return {
|
||||
id: 'poster_' + Date.now().toString(36) + idx.toString(36),
|
||||
|
||||
Reference in New Issue
Block a user