用途:解决多 SKU 出图风格漂移问题。把模特、光位、色调、背景、构图、留白、字体与禁止项集中写进一份 brand.yaml,各生图技能按需读取相关段落,避免每次重写 prompt 导致第 200 个 SKU 与第 1 个不像同一家店。
主要能力:一处定义、全部技能共用;通过 model.reference 锁定同一张脸参考图;色温、光位、背景写死在规范里;改调性只需改一行 yaml;支持按技能过滤字段,例如详情页技能读 layout 不读 model,去水印技能两者都不读。
使用方式: node scripts/brand.mjs --init > brand.yaml node scripts/brand.mjs --brand examples/brand.yaml --for flat-lay node scripts/gen.mjs --task flat-lay --brand examples/brand.yaml --prompt '...' --images garment.jpg pose.jpg --save out/sku001.jpg --brand 对 gen.mjs / run_loop.mjs / batch.mjs / video.mjs 均有效。
字段结构:brand(name、tone)、model(reference、description、body)、photography(background、lighting、camera、grade、crop)、layout(margin、typeface)、forbid、compliance(platform)。
经验与限制:画面约束建议用英文写、备注用中文;写物理量而非形容词,如 neutral white balance around 5200K;forbid 比 tone 更硬。锁脸需正脸、清晰、光线均匀、无复杂背景、至少 512×512,全店固定一张;找不到参考图只警告不报错,脸由 prompt 描述决定。规范过细可能导致 prompt 被截断;描述互相矛盾会适得其反。建议规范进版本库、一店一份、换季可分支命名。