Files
pod_trend_agent/graph/backends/__init__.py
T
3218485270 f493bde8a9 POD 趋势感知 Agent:缓存热点模式 + 三图合成 + 热点去重/风格去重 + review 兜底
- 缓存热点批量流程(有采集缓存不触发 Google)
- 简报不足直接从采集缓存生成(轻量补齐)
- 三图合成(模特/印花/底图)+ 底图压缩 <2MB
- 热点去重→风格去重自动切换 + 不适合类目 review 兜底
- 透明背景(background=transparent)+ 提示词清洗(敏感词/背景描述)
- 任务前 basemap 校验 + 模板国家校验 + 模特任务级分配
2026-08-22 14:14:01 +08:00

23 lines
778 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""图像后端注册表(可插拔:印到底图 / 模特试穿 / 占位)。
compose_node / product_node 在配置 backend 时调用。默认未配置则跳过,仅导出提示词。
新增图像后端:实现 graph/backends/base.ImageBackend,在此登记。
"""
from typing import Dict
from .base import ImageBackend
from .openai_image_backend import OpenAIImageBackend
from .mock_image_backend import MockImageBackend
IMAGE_BACKENDS: Dict[str, type] = {
"openai": OpenAIImageBackend, # 真生图(images/edits img2img,需 api_key
"mock": MockImageBackend, # 占位图(Pillow,无 key 也能端到端演示)
}
def get_image_backend(name: str):
cls = IMAGE_BACKENDS.get(name)
if cls is None:
return None
return cls()