- 新增韩国(KR)适配:countries/pinterest 种子词、K-pop 提示词、UI 国家列表 - 爬虫跨运行持久化已采集 URL(.collected_urls.json),同关键词重复搜索采新图 - 模板导出增强:SPU 商品属性列名前缀剥离匹配、尺码下拉框 INDIRECT 动态引用、 SPU 字段映射(袖长/门襟/胸垫等)、季节/印花图案女装映射、建议售价统一必填、 SKU 分类/数量/单位直接填默认值 - 自定义模式:多模态提示词独立(custom_analyze_*)、生图提示词模板可配置 - Pinterest:空选品守卫、连续空分析保护(max_empty_analyze)、flat_prompt 配置覆盖 - 生图可靠性:开始/完成进度日志、异步任务轮询超时 60s→300s
415 lines
40 KiB
YAML
415 lines
40 KiB
YAML
# ===== POD 热点抓取 Agent 配置(LangGraph 工程化版)=====
|
||
|
||
# 目标国家(Google Trends 地区代码:US / GB / JP / AU / MX / DE / BR / SA / PL / ES / IT / CA ...)
|
||
countries:
|
||
- US
|
||
- GB
|
||
- JP
|
||
- AU
|
||
- MX
|
||
- DE
|
||
- BR
|
||
- SA
|
||
- PL
|
||
- ES
|
||
- IT
|
||
- CA
|
||
- KR
|
||
|
||
# —— 可插拔数据源 ——
|
||
# 在 graph/sources/ 注册表里登记;这里列出要启用的。
|
||
# 每个国家的具体种子词/limit 写在 configs/countries/<country>.yaml。
|
||
sources:
|
||
- google_trends
|
||
# - pinterest # 需要 Pinterest 商业 token + API Review 通过后才启用
|
||
|
||
# —— 动态种子词(seed 节点,在 fetch 之前运行)——
|
||
# 收集「trending 派生 + 上一轮 safe 历史热点 + 月份/节日」上下文,
|
||
# 由 LLM 后端生成动态种子词,与 yaml 静态种子合并后注入 style.seeds / related.seed_keywords。
|
||
# 只适配 OpenAI 兼容协议:openai(真 LLM,自定义 model/base_url/api_key 见 llm_screen)/ mock(规则生成,零 API 成本)。
|
||
# static: 仅用 yaml 写死种子,零动态(保留兼容,UI 未列出)。
|
||
seed_provider: mock
|
||
seed_provider_cfg:
|
||
max_seeds: 24 # 种子总数上限(不再按类型分:从全部种子词统一池随机抽取,均分 style/related)
|
||
trending_context_limit: 15
|
||
history_limit: 20
|
||
|
||
# —— Pinterest 参考模式(独立于 Google Trends 采集,UI「Pinterest 参考模式」入口)——
|
||
# 流程:各国独立种子词池(configs/pinterest/<CC>.yaml) → LLM 按需生成搜索词(json_schema+防重复)
|
||
# → 爬图 → LLM 分析图片 → 构造提示词 → 生成设计
|
||
# 按需搜索:每次只生成 1 个搜索词,用完(爬取成功)才标记已用;简报不足时循环再搜,直到满足 SPU 数量。
|
||
pinterest:
|
||
enabled: true
|
||
mode: "scrape" # Pinterest 模式:scrape=在线爬图引用(原流程);custom=自定义本地图片文件夹直接送多模态分析
|
||
# custom 模式:无需采集/搜索,把 custom_image_dir 文件夹内所有有效图片直接进多模态分析,沿用 Pinterest 后续所有步骤
|
||
custom_image_dir: "" # 自定义模式图片文件夹路径(必须填写;文件夹内所有有效图片 jpg/jpeg/png/webp 都会进入分析)
|
||
# 数量校验:有效图片数必须 ≥ 选品清单(spu_tasks 展开后)总数,否则任务不启动
|
||
provider: openai # 搜索词/图片分析用 LLM 提供商(openai / mock)
|
||
search_mode: direct # 搜索词生成方式:direct=跳过LLM,直接搜「种子词+后缀」;llm=LLM按需生成搜索词
|
||
search_term_suffix: " t-shirt design" # Pinterest 搜索词自动追加的自定义后缀(可编辑;留空=不追加),保证 Pinterest 返回真正的印花图
|
||
search_terms_per_run: 1 # 每次搜索词数量(direct 模式=从种子池随机取 N 个直接拼后缀;llm 模式=每次生成 1 个)
|
||
max_search_rounds: 0 # 搜索轮次上限(0=自动:目标 SPU 数×2,至少 5;防网络故障无限循环)
|
||
max_empty_analyze: 0 # 连续图片分析无新增简报的轮次上限(0=自动:目标SPU数+2,至少3;防"逐一取下一张参考图"空转)
|
||
seed_sample: 40 # 每次从国家种子池随机抽取多少个种子词给 LLM
|
||
max_used_terms_in_prompt: 100 # 已用搜索词最多注入 LLM 提示词的个数(防 token 超限)
|
||
images_per_term: 40 # 每个搜索词爬取图片数量
|
||
analyze_per_term: 1 # 固定每次调用分析 1 张图(一次 API 请求一张,利于 LLM 注意力;简报带 brief_id uuid4 全局校验防错位)
|
||
analyze_concurrency: 6 # 并发分析线程数(多并发提取简报)
|
||
analyze_batch: 0 # 每轮从图池取多少张图分析(0=自动:一次最多分析 max_designs 张;搜集完一批→生成一批简报,不够用了才主动采集)
|
||
max_designs: 10 # 每个搜索词最多生成多少个设计简报
|
||
ref_images_per_design: 1 # 生图时每个设计附带几张爬取图作为参考(发给生图模型)
|
||
supply_attempts: 3 # 设计生成失败/侵权时,从图池取新图重新分析的最多尝试次数
|
||
err400_limit: 15 # 每个种子词累计 400(且错误含「内容/图片」)超限后放弃该种子词(多模态+生图合计)
|
||
scrape_concurrency: 1 # 同时爬取几个搜索词(共享 .chrome_session 登录态,Chrome 单例,必须=1)
|
||
headless: false # 爬取时是否无头(false=显示 Chrome 窗口,首次需手动登录)
|
||
proxy: "" # 图片下载代理(空=自动探测系统代理/VPN,默认走代理;配了如 http://127.0.0.1:7890 则用指定代理)
|
||
login_check: true # 爬取前静态检测 Pinterest 登录态(只读 .chrome_session cookies,不启动 Chrome;未登录则跳过本轮爬取并告警)
|
||
login_wait: true # 运行时检测到未登录时:false=跳过并告警(不阻塞);true=弹出 Chrome 等待手动登录
|
||
# —— Pinterest 模式生图提示词的固定段(可编辑;留空=回退代码内置默认)——
|
||
# 拼装顺序:image_prompt + print_suffix + spelling_rule(仅含文字时)
|
||
# 凡 review 简报额外追加 review_rebrand_hint。
|
||
prompt_pieces:
|
||
print_suffix: >-
|
||
standalone pure print design on a pure white background, the print artwork is SMALL and
|
||
CENTERED with clearly larger white margins around it, print area between about 15x18 cm and
|
||
26x32 cm, do NOT fill the entire canvas, do NOT force full-bleed, do NOT add any gradient,
|
||
texture or background color behind the artwork, no garment, no shirt, no model, no mannequin,
|
||
no watermark
|
||
spelling_rule: >-
|
||
Render every phrase shown in quotes exactly as written, correctly spelled.
|
||
review_rebrand_hint: >-
|
||
IMPORTANT: this theme is ONLY a loose stylistic reference. Do NOT reproduce any brand logo,
|
||
trademark, character, mascot, copyrighted artwork or real person. Create a fully ORIGINAL
|
||
design with a different name and distinct visual details and colors — a generic, non-infringing
|
||
homage in the same mood, clearly distinct from the original.
|
||
|
||
# 自定义模式(pinterest.mode=custom)专属配置:多模态提示词与生图固定段独立于 Pinterest 参考模式。
|
||
custom:
|
||
# 自定义模式生图提示词的固定段(可编辑;留空=回退代码内置默认)。
|
||
# 自定义模式生图正向提示词 = image_prompt_template({image_prompt} 替换为分析模型产出的新设计描述);
|
||
# 负向 = negative_prompt(compose 生图时作为负向参数传给图像后端)。
|
||
# 凡 review 简报额外追加 review_rebrand_hint。
|
||
prompt_pieces:
|
||
image_prompt_template: >-
|
||
Use the attached bestseller product photo only as loose inspiration for
|
||
overall mood, theme, era and style genre — do NOT reproduce, trace,
|
||
rearrange, recolor or closely imitate its printed artwork, characters,
|
||
layout or text, and do NOT render a shirt, garment, model, hanger, photo
|
||
scene, product mockup or background of any kind. First, carefully examine
|
||
the printed artwork on the garment in the attached photo: zoom in mentally
|
||
on the print area, identify its subject, technique, palette and layout,
|
||
and base the new design on THOSE observed traits. Ignore the model,
|
||
background and photo quality. Then: {image_prompt}
|
||
negative_prompt: >-
|
||
copy of reference artwork, lookalike of the bestseller print, characters,
|
||
mascots, likenesses, logos, trademarks, watermark, photorealistic shirt,
|
||
apparel, product mockup, model, garment, hanger, busy background
|
||
print_suffix: >-
|
||
standalone pure print design on a pure white background, the print artwork is SMALL and
|
||
CENTERED with clearly larger white margins around it, print area between about 15x18 cm and
|
||
26x32 cm, do NOT fill the entire canvas, do NOT force full-bleed, do NOT add any gradient,
|
||
texture or background color behind the artwork, no garment, no shirt, no model, no mannequin,
|
||
no watermark
|
||
spelling_rule: >-
|
||
Render every phrase shown in quotes exactly as written, correctly spelled.
|
||
review_rebrand_hint: >-
|
||
IMPORTANT: this theme is ONLY a loose stylistic reference. Do NOT reproduce any brand logo,
|
||
trademark, character, mascot, copyrighted artwork or real person. Create a fully ORIGINAL
|
||
design with a different name and distinct visual details and colors — a generic, non-infringing
|
||
homage in the same mood, clearly distinct from the original.
|
||
|
||
# 跨源融合权重(按 source 标签,无需和为 1)
|
||
# 已下调 gt_trending(泛国家热点只作微弱信号),主力偏向 style+related(可印花型词)。
|
||
weights:
|
||
gt_trending: 0.15
|
||
gt_style: 0.55
|
||
gt_related: 0.30
|
||
pinterest: 0.0
|
||
|
||
# —— 成分映射表(可配置,仅作用于 component_1/2/3,绝不作用于 material)——
|
||
# 女装模板下拉框是「中文+英文」格式,db 存中文,需映射到下拉选项;找不到映射保留原值。
|
||
# 男装模板保留 db 原值(不查此表,不在此配置)。key=db 成分值,value=模板下拉框精确选项(一个字都不能错)。
|
||
component_map:
|
||
female:
|
||
棉: 棉Cotton
|
||
聚酯纤维: 聚酯纤维(涤纶)Polyester
|
||
涤纶: 聚酯纤维(涤纶)Polyester
|
||
再生聚酯纤维: 聚酯纤维(涤纶)Polyester
|
||
聚酯纤维(涤纶): 聚酯纤维(涤纶)Polyester
|
||
氨纶: 氨纶Elastane
|
||
锦纶: 锦纶(尼龙)Polyamide
|
||
尼龙: 尼龙Nylon
|
||
腈纶: 腈纶Acrylic
|
||
蚕丝: 蚕丝Silk
|
||
亚麻: 亚麻Linen
|
||
莫代尔: 莫代尔Modal
|
||
粘纤: 粘胶(人棉)Viscose
|
||
粘胶: 粘胶(人棉)Viscose
|
||
粘胶纤维: 粘胶(人棉)Viscose
|
||
人棉: 人棉Rayon
|
||
碳纤维: 碳纤维Carbon
|
||
金属: 金属Metal
|
||
羊毛: 羊毛Wool
|
||
羊绒: 羊绒Cashmere
|
||
马海毛: 马海毛Mohair
|
||
兔毛: 兔毛Rabbit Hair
|
||
牛皮革: 牛皮革Bovine Leather
|
||
羊皮革: 羊皮革Sheep Leather
|
||
猪皮革: 猪皮革Pig Leather
|
||
PU: PU Polyurethane
|
||
PVC: PVC Polyvinyl Chloride
|
||
铜氨纤维: 铜氨纤维Cupro
|
||
莱赛尔: 莱赛尔(天丝)Lyocell
|
||
天丝: 莱赛尔(天丝)Lyocell
|
||
醋酸纤维: 醋酸纤维Acetate
|
||
醋酯纤维: 醋酸纤维Acetate
|
||
羽绒: 羽绒Down
|
||
羽毛: 羽毛Feather
|
||
羊驼毛: 羊驼毛Alpaca
|
||
苎麻: 苎麻
|
||
竹纤维: 竹纤维
|
||
三醋酯纤维: 三醋酯纤维Triacetate
|
||
金属镀膜纤维(金银丝): 金属镀膜纤维(金银丝)
|
||
聚丙烯纤维: 聚丙烯纤维
|
||
其他纤维: 其他纤维
|
||
|
||
# 季节值映射表(女装模板专用):key=db 季节值,value=模板下拉框精确选项。
|
||
# 男装模板保留 db 原值(不查此表,不在此配置)。缺失/留空回退内置默认(四季→ALL/全球/所有)。
|
||
season_map:
|
||
female:
|
||
四季: ALL/全球/所有
|
||
|
||
# 印花图案值映射表(女装模板专用):key=db pattern 值,value=模板下拉框精确选项。
|
||
# 男装模板保留 db 原值(不查此表,不在此配置)。缺失/留空回退内置默认(印花→卡通)。
|
||
pattern_map:
|
||
female:
|
||
印花: 卡通
|
||
|
||
# 合规黑名单(全局,生效于所有国家;各国专属侵权盲区写在 prompts/<country>/aesthetics.yaml 的 extra_blacklist)
|
||
blacklist:
|
||
- disney
|
||
- marvel
|
||
- nfl
|
||
- nba
|
||
- mlb
|
||
- nhl
|
||
- fifa
|
||
- olympics
|
||
- bernie sanders
|
||
|
||
# —— 真实人物过滤(肖像权 right of publicity)——
|
||
# 显式名单(子串匹配)+ Firstname Lastname 模式(仅对 gt_trending 源,避免误删风格词)。
|
||
name_filter:
|
||
enabled: true
|
||
exemptions: [] # 留空用内置默认豁免(new album / red cross 等)
|
||
|
||
# —— 设计相关性过滤(让关键词更聚焦可印主体,剔除泛新闻/科技/赛事词)——
|
||
relevance:
|
||
enabled: true
|
||
drop_patterns:
|
||
- "iphone|ipad|android|ps5|xbox|macbook|windows|samsung|pixel|tesla"
|
||
- "pro max|firmware|software version|os update|app update"
|
||
- "election|debate|summit|treaty|sanction|parliament|congress|prime minister"
|
||
- "stock|crypto|bitcoin|earnings|inflation|interest rate|market crash|nasdaq"
|
||
- "score|vs |quarter-final|semi-final|final match|match result|fixture|grand prix"
|
||
- "episode|trailer|release date|box office|watch online|full movie|streaming"
|
||
- "breaking news|headline|live update|press conference"
|
||
keep_patterns: []
|
||
|
||
# —— 查询噪声过滤(问句/命名清单/损坏碎片/模糊名词,非可印花设计概念)——
|
||
# 这些词进入 screen 会被 Mock 误标 safe,故在过滤阶段直接丢弃。
|
||
query_noise:
|
||
enabled: true
|
||
|
||
# —— LLM 筛选(印花设计合规筛 + 生图提示词构造,第二阶段)——
|
||
# 只适配 OpenAI 兼容协议:自定义 model / base_url / api_key(UI 的「OpenAI 配置」区或此处均可填)。
|
||
llm_screen:
|
||
enabled: true
|
||
provider: openai # openai(真 LLM,需 key)/ mock(无 key 启发式兜底)
|
||
api_key: "ark-607f7194-f253-4c55-a421-237317d7683e-2bf08" # 留空则自动读取环境变量 LLM_API_KEY / OPENAI_API_KEY(推荐,避免密钥入库)
|
||
base_url: "https://ark.cn-beijing.volces.com/api/v3" # 自定义网关地址,也可用环境变量 LLM_BASE_URL 覆盖
|
||
model: "doubao-seed-2-0-lite-260215" # 自定义模型名(任意 OpenAI 兼容模型)
|
||
temperature: 0.6
|
||
max_topics_per_call: 12
|
||
min_score: 0.0
|
||
keep_review: false # false = 待复核(review)直接过滤、不生成设计提示词,只留 safe
|
||
max_briefs: 0 # 简报数量上限(0=自动:按扩展后总任务数/SPU数,用多少生成多少)
|
||
|
||
# —— 固定提示词模板(规则写死,保证每条一致)——
|
||
# 由 motif + art_style + color_palette + composition 四要素按模板确定性拼出。
|
||
# v3:countries.<CODE> 按国家覆盖 image_prompt(每国设计风格不同),顶层为兜底。
|
||
# 文字规则统一:英文可加可不加、适配印花即可;任何文字严禁政治/宗教/仇恨/暴力/性/品牌/商标/真实人物等敏感内容。
|
||
prompt_templates:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, US-market aesthetic: bold confident statement graphic, high contrast, clean modern vector, sporty or humorous mood, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a small slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
wearable_prompt: "{motif}, {art_style}, {color_palette}, {composition}, printed centered on the chest of a flat-lay plain white t-shirt, print sized freely between about 15x18 cm and a max of 26x32 cm, scaled naturally to the artwork, not stretched, not full-bleed, studio lighting, e-commerce product photo, no human model"
|
||
composite_prompt: "【图片角色,按提交顺序】图1=模特实拍图(基底);图2=纯印花设计稿;图3=平铺衣服底图(只取衣服本身的底色与面料材质,忽略平铺图背景/桌面/场景,只保留面料颜色与质感)。
|
||
TASK: 把图2的印花设计印到图3底色的衣服上,并让图1的模特穿上“图3底色+图2印花”的衣服。
|
||
RULES:/n1.底色锁定:从图3提取衣服底色与面料,最终合成中必须100%保持不变,严禁偏色。
|
||
2.印花提取:从图2精准提取纯印花图案(线条/色号/比例),叠加到图3底色上形成合成面料。3.印花尺寸适配:印花整体尺寸与衣服面料面积成合理比例,居中印在胸/背/衣身主体区域,占衣身面积约30%-45%,四周留白,严禁过大撑满整件或过小(低于20%)。
|
||
3.主体遮罩:识别图1模特服装穿着区域(忽略皮肤/头发/背景/配饰),用合成面料完整覆盖,清除原衣服颜色与图案。
|
||
4.精准贴合:合成面料严格跟随图1衣服立体结构,褶皱/扭转处印花相应变形,杜绝“贴纸感”与“平面涂色感”。
|
||
5.光影融合:按图1环境光方向调整亮度/对比度,印花受光影响产生明暗变化但色号不偏移。
|
||
6.纯净输出:仅输出一张最终合成图;图1背景/人物/构图/光影100%不变,仅替换衣服印花与底色。"
|
||
composite_negative: "garment changed, wrong color, distorted print, blurry, low-res, human model, body, extra objects, watermark, glow, 3d render, text unless part of design"
|
||
countries:
|
||
US:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, US-market aesthetic: bold confident statement graphic, high contrast, clean modern vector, sporty or humorous mood, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a small slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
GB:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, UK-market aesthetic: witty understated British charm, heritage-inspired motifs, retro sportswear or punk-zine mood, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a small slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
JP:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, JP-market aesthetic: kawaii cute or clean minimal, soft pastel-friendly, polished neat lines, small cute mascot mood, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a small slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
AU:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, AU-market aesthetic: laid-back coastal and outdoor vibe, nature-inspired, bright fresh energy, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a small slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
MX:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, MX-market aesthetic: vibrant mexican folk art, sugar skull / loteria / aztec motifs, fiesta colors, festive cultural pride mood, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a Spanish slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
DE:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, DE-market aesthetic: bavarian-alpine folk charm, berlin street-art edge, bauhaus minimalism, cozy beer-garden and christmas-market mood, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a German slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
BR:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, BR-market aesthetic: vibrant tropical carnival energy, samba rhythm, football passion, bold beach and street-art colors, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a Portuguese slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
SA:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, SA-market aesthetic: elegant desert minimalism, arabian geometric patterns, falconry and starry-night calm, refined and conservative mood, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or an Arabic slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
PL:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, PL-market aesthetic: highland folk embroidery charm, wycinanki paper-cut patterns, slavic forest mystique, retro polish poster mood, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a Polish slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
ES:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, ES-market aesthetic: flamenco passion, andalusian tile patterns, mediterranean sunshine, festive fiesta energy, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a Spanish slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
IT:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, IT-market aesthetic: renaissance elegance, roman heritage, tuscan countryside warmth, la dolce vita retro charm, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or an Italian slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
CA:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, CA-market aesthetic: maple-leaf pride, northern-lights wonder, rocky-mountain outdoors, cozy cottage and hockey spirit, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a French slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
KR:
|
||
image_prompt: "{motif}, {art_style}, {color_palette}, {composition}, standalone pure print design, print-ready artwork, isolated on pure white background, no background, no scene, no texture, no frame, no border, flat vector-like graphic, crisp clean edges, high resolution, ultra sharp, high contrast, KR-market aesthetic: trendy K-pop street culture, Seoul neon nightlife, Y2K retro-futurism, cute-hip aesthetic, bold typography with hangul accents, size: the print artwork must be SMALL and CENTERED with clearly larger white margins around it, print area between about 15x18 cm and 26x32 cm, keep proportions, scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, do NOT force full-bleed, leave wide balanced white margins around the artwork, no garment, no shirt, no model, no mannequin, no watermark, text: optional - add short original English words or a Korean slogan ONLY if they fit the print, or keep it text-free; any text must be safe, short and original; no brand names, no logos, no trademarked phrases, no real people names"
|
||
|
||
# —— 第三阶段 compose:生成纯印花设计稿 + 导出简报包(在 product 之前)——
|
||
# 用前 N 个 safe 简报的 image_prompt 调图像后端文生图,产物 output/<country>/designs/,
|
||
# product 节点取第一张设计稿作为图2 复用(多款号共用同一设计)。
|
||
# backend 留空则不生成设计稿(product 节点会自行回退生成)。
|
||
compose:
|
||
backend: "openai" # 生成设计稿的图像后端:openai(需 api_key)/ mock(占位);留空=不生成
|
||
api_key: "sk-1CicJFACR4JCeLe6LTdsqSd0ffSrybMgmdfRiNfIlKok8MbS"
|
||
base_url: "https://img.yunfei.best/v1" # 自定义图像网关地址(默认 OpenAI)——填 API 根路径(含 /v1),不要带 /images/edits 后缀,否则拼接路径 404
|
||
model: "gpt-image-2"
|
||
size: "1536x2048" # 合成图/种草图等非设计图的统一尺寸(3:4)
|
||
design_size: "1024x1024" # 纯印花设计稿尺寸(1:1)
|
||
execution_mode: "" # 网关异步/同步模式参数(仅 ai-media 等网关需要,如 "sync");yunfei 等标准 OpenAI 网关不认识该参数,留空=不传
|
||
seed: 0 # 随机种子:>0=固定(相同 seed 可复现,需网关支持);0/留空=每次随机
|
||
design_count: 1 # 用前 N 个 safe 简报生成设计稿(product 取第一个复用)
|
||
design_workers: 5 # 设计稿并发生成线程数(仅热点采集模式 compose 节点用;Pinterest 模式走 pipeline 总并发 product.concurrency)
|
||
|
||
# —— 第五阶段 oss_upload:压缩(3:4 / ≥1340×1785 / <2MB)+ 上传阿里云 OSS 图床 ——
|
||
# 产物(composite/printed/design/basemap)逐个压缩上传,URL 写回 *_url 字段。
|
||
# key_id/key_secret 也可用环境变量 OSS_ACCESS_KEY_ID / OSS_ACCESS_KEY_SECRET 覆盖。
|
||
oss:
|
||
oss_bucket: "image-taotu"
|
||
oss_endpoint: "oss-cn-beijing.aliyuncs.com"
|
||
oss_key_id: "LTAI5t6tN2k2dznmdBmDJebh"
|
||
oss_key_secret: "2Q25JohOI4GmovszvIw1NuVvUzM6PB"
|
||
enabled: true # false = 跳过上传(本地仅压缩或完全跳过)
|
||
|
||
# —— 第六阶段 seed_shot:种草图选取(在 oss_upload 之后)——
|
||
# 种草图不再用 AI 重新生成,而是从 product 已生成的三合一主图(每颜色一张)中按 count 随机选取:
|
||
# - count <= 颜色数:随机取 count 个不同颜色(优先保证每色主图都有一张)
|
||
# - count > 颜色数:每色一张 + 从全部主图中随机补足(可重复)
|
||
# 选取的种草图压缩上传 OSS(货号计数与 oss_upload 共用续接),URL 写入模板「详情图文」列。
|
||
seed_shot:
|
||
enabled: true
|
||
count: 1 # 每个产品选取几张种草图(从三合一主图中随机取,传入数量即可)
|
||
size: "1536x2048" # 种草图生成尺寸(3:4,与合成图一致)
|
||
|
||
# —— 第四阶段 product:热点 → SPU/颜色选品 → 底图 → 三图合成(图1模特+图2设计稿+图3底图)→ 模板 ——
|
||
# 数据关系:SPU.code=款号,SKU.code="款号-颜色编码"(如 DG004-BL01),
|
||
# 底图在 basemap/<款号>/<SKU.code>/,模特图在 material_library/<品类>/。
|
||
# 设计稿优先用 compose 节点生成的(compose.backend),本节点 backend 负责三图/两图合成。
|
||
# backend: openai(真合成,需 compose.api_key) / mock(Pillow 占位,无 key 演示) / 留空=仅导出模板。
|
||
product:
|
||
enabled: true
|
||
db_path: "db/spu_sku.db"
|
||
basemap_dir: "basemap"
|
||
material_library_dir: "material_library"
|
||
model_category: "T-shirt" # 备用模特目录优先品类;为空/无图时取 material_library 第一个有图的子目录;SPU.mark==1 才启用试穿/平铺合成
|
||
# 三方关系映射:SPU.mark → material_library 下的图文件夹 + 对应提示词。
|
||
# 每个 mark 可配置两个图源(模特图文件夹 / 平铺图文件夹),运行时在「有图的文件夹」间随机抽图:
|
||
# - 抽到 model_dir(模特图)→ 用 model_prompt(模特三图:图1模特+图2印花+图3底图)
|
||
# - 抽到 flat_dir(平铺图) → 用 flat_prompt(平铺三图:图1平铺实拍+图2印花+图3底图)
|
||
# model_prompt/flat_prompt 留空则用内置默认提示词(MODEL_WEAR_PROMPT / FLAT_LAY_PROMPT)。
|
||
# 该映射完全可配置、不写死在代码里。
|
||
mark_dirs:
|
||
"1":
|
||
model_dir: "模特图" # 模特图文件夹名(material_library 下)
|
||
flat_dir: "平铺图" # 平铺图文件夹名(material_library 下)
|
||
model_prompt: "" # 留空=内置模特三图提示词 MODEL_WEAR_PROMPT
|
||
flat_prompt: |-
|
||
|
||
**你是一个专业的电商AI视觉合成工具**,核心任务是执行"高保真印花与色彩移植/印花替换"。
|
||
|
||
## 1. 图片角色定义
|
||
* **图1 (基底图):** 衣服平铺实拍图。
|
||
* **功能:** 仅提供版型、轮廓、褶皱形态、光影结构、拍摄角度与构图。
|
||
* **限制:** 输出必须保留图1的摆放角度、背景和光影逻辑,但**彻底摒弃**其原有的面料颜色。
|
||
* **图2 (设计稿):** 纯印花设计稿。
|
||
* **功能:** 仅提供“图案元素”(线条、色号、比例)。
|
||
* **限制:** 提取图案时必须**完全去除**图2自带的背景色。
|
||
* **图3 (底图):** 平铺衣服底图。
|
||
* **功能:** 仅作为“皮肤”,提供衣服的**唯一基底颜色**与面料材质纹理。
|
||
* **限制:** 忽略其背景/场景,100%保留其衣服底色与质感。
|
||
|
||
## 2. 核心任务
|
||
构建一张最终合成的平铺图,必须同时满足:
|
||
1. **结构:** 保留图1的版型与褶皱细节。
|
||
2. **底色:** 强制应用图3的颜色与材质。
|
||
3. **图案:** 叠加图2的印花设计。
|
||
|
||
**最终效果 = 图1版型光影 + 图3底色材质 + 图2印花图案**
|
||
|
||
## 3. 执行规则 (严格执行,权重由高到低)
|
||
|
||
### 0. 禁止人物
|
||
* 严禁出现任何人体、模特、头颈、手臂或穿着效果。
|
||
* 必须保持纯平铺俯拍商品图形式。
|
||
|
||
### 1. 底色强制锁定 (Color Lock - 最高优先级)
|
||
* **基底替换:** 必须强制使用**图3的颜色**作为衣服的**唯一**基底色。
|
||
* **100%覆盖:** 彻底清除图1原有的面料颜色,严禁图1旧底色透出、混合或泛灰。
|
||
* **色调一致性:** 最终成衣的固有色必须与图3肉眼完全一致,不得因光影合成而发生色相偏移。
|
||
|
||
### 2. 纯印花剥离与叠加
|
||
* **去底处理:** 从图2中**仅提取**设计元素、线条、色块,**完全丢弃/移除**图2自身可能存在的任何背景色或画布底色。
|
||
* **叠加逻辑:** 将提取的纯图案,以“纹理融合”的方式叠加在图3的底色之上。印花必须依附于图3的底色,不可遮盖或改变图3的底色范围。
|
||
|
||
### 3. 印花尺寸适配
|
||
* 将提取的印花居中印在胸/背/衣身主体区域。
|
||
* 印花面积占比严格控制在衣身主体的30%-45%。
|
||
* 四周必须留白,严禁印花过大撑满衣服,或过小(<20%)。
|
||
|
||
### 4. 主体遮罩重建
|
||
* 精准识别图1的衣服本体完整区域(包含领口到下摆、袖子)。
|
||
* 用“图3底色+图2印花”合成出的新面料,完全覆盖图1的原有面料区域。
|
||
* 清除原区域的所有旧色和旧图案,只保留图1的边缘轮廓形态。
|
||
|
||
### 5. 精准形态贴合
|
||
* 合成后的面料必须严格遵循图1的平铺形态。
|
||
* 领口、袖口、下摆、侧缝等结构必须清晰。
|
||
* **自然变形:** 印花在遇到褶皱、翻折处时,必须随面料纹理发生自然的拉伸、挤压和变形,杜绝僵硬的“贴纸感”。
|
||
|
||
### 6. 光影重塑与色相锁定
|
||
* **借用光影:** 仅借用图1的光照方向、明暗对比度和投影位置。
|
||
* **色相锁定:** 在应用明暗变化时,只调整亮度和对比度,**严禁改变色相(Hue)**。
|
||
* 确保阴影处依然是图3颜色的深色版,高光处是图3颜色的亮色版,保持投影与图1完全一致。
|
||
|
||
### 7. 纯净输出
|
||
* 仅输出一张最终合成的平铺图。
|
||
* 背景环境、桌面、构图、拍摄角度必须与图1保持100%一致。
|
||
* 画面中不得出现人像、肢体、人台。
|
||
#留空=内置平铺三图提示词 FLAT_LAY_PROMPT
|
||
brief_index: 0 # 用第几个 safe 简报的提示词生成(0=第一个)
|
||
spu_code: "" # 款号(留空自动选第一个有本地底图的)
|
||
sku_code: "" # 颜色编码(留空自动选该款第一个有底图的);多个颜色用逗号分隔(如 "DG015-VT01,DG015-DARK HEATHER")
|
||
spu_per_color: # 留空自动判定:单色=每色一SPU;多色=单SPU多色(UI 不选择模板模式);CLI --single-spu 可显式覆盖
|
||
markup_percent: 0 # 加价百分比(按 SKU 最低价,供后续定价使用)
|
||
suggested_price_ratio: 30 # 建议售价比例(%):建议售价 = 申报价格 × (1+此比例/100);模板「建议售价」必填时才填
|
||
code_prefix: "DG" # 货号前缀(OSS 上传 key:{国家}/{时间戳}/{前缀+3位计数}_{4位随机}.jpg,000 起最多 999)
|
||
backend: "mock" # openai / mock / 留空=跳过生成
|
||
template_dir: "templates" # template_router.py 所在目录(项目内自包含)
|
||
template_path: "templates/商品上传模版.xlsx" # 商品上传模板(可改为自由上传)
|
||
concurrency: 5 # Pinterest 模式 pipeline 总并发(设计生成→三合一→种草图→标题 同一管道串行,总并发=此值)
|
||
|