修复种草图生成:以三合一主图为参考 img2img 生成,按颜色分配(每色优先、超出随机补足);新增 BR/CA/DE/ES/IT/PL/SA 七国配置与提示词;删除验证用测试脚本

This commit is contained in:
2026-08-24 14:02:19 +08:00
parent f493bde8a9
commit 3c341d2e78
51 changed files with 2571 additions and 514 deletions
+4 -1
View File
@@ -34,7 +34,7 @@ def _cache_key(country: str, provider: str, cfg: Dict[str, Any]) -> str:
避免命中旧参数生成的种子;旧文件保留(不删缓存,取最新)。"""
fp = hashlib.md5(
json.dumps(
{k: cfg.get(k) for k in ("max_style_seeds", "max_related_seeds",
{k: cfg.get(k) for k in ("max_seeds", "max_style_seeds", "max_related_seeds",
"trending_context_limit", "history_limit")},
sort_keys=True, ensure_ascii=False,
).encode("utf-8")
@@ -72,6 +72,7 @@ def seed_node(state: Dict[str, Any]) -> Dict[str, Any]:
cfg = config.get("seed_provider_cfg") or {}
trending_limit = int(cfg.get("trending_context_limit", 15))
history_limit = int(cfg.get("history_limit", 20))
max_seeds = int(cfg.get("max_seeds", 0))
max_style = int(cfg.get("max_style_seeds", 12))
max_related = int(cfg.get("max_related_seeds", 12))
guard = COMMON_RISK_WORDS + [b.lower() for b in (config.get("blacklist") or [])]
@@ -84,6 +85,7 @@ def seed_node(state: Dict[str, Any]) -> Dict[str, Any]:
res = cached
context: Dict[str, Any] = {
"country": country,
"max_seeds": max_seeds,
"max_style_seeds": max_style,
"max_related_seeds": max_related,
}
@@ -91,6 +93,7 @@ def seed_node(state: Dict[str, Any]) -> Dict[str, Any]:
# 1) 收集上下文
context: Dict[str, Any] = {
"country": country,
"max_seeds": max_seeds,
"max_style_seeds": max_style,
"max_related_seeds": max_related,
}