- app.py: Streamlit UI for video generation workflow - main_flow.py: CLI tool with argparse support - modules/: Business logic modules (script_gen, image_gen, video_gen, composer, etc.) - config.py: Configuration with API keys and paths - requirements.txt: Python dependencies - docs/: System prompt documentation
77 lines
2.2 KiB
Python
77 lines
2.2 KiB
Python
"""
|
|
花字样式预设库
|
|
供 Design Agent 和 Renderer 使用
|
|
"""
|
|
|
|
STYLES = {
|
|
# 1. 醒目强调 (黄色高亮)
|
|
"highlight": {
|
|
"font_size": 60,
|
|
"font_color": "#FFE66D", # 亮黄
|
|
"stroke": {"color": "#000000", "width": 4},
|
|
"shadow": {"color": "#000000", "blur": 8, "offset": [4, 4], "opacity": 0.6}
|
|
},
|
|
|
|
# 2. 警告/痛点 (红色/黑色背景)
|
|
"warning": {
|
|
"font_size": 55,
|
|
"font_color": "#FFFFFF",
|
|
"stroke": {"color": "#FF0000", "width": 0}, # 无描边
|
|
"background": {
|
|
"type": "box",
|
|
"color": "#FF4D4F", # 红色背景
|
|
"corner_radius": 12,
|
|
"padding": [15, 25, 15, 25] # t, r, b, l
|
|
},
|
|
"shadow": {"color": "#990000", "blur": 0, "offset": [0, 6], "opacity": 0.4} # 立体感阴影
|
|
},
|
|
|
|
# 3. 价格/促销 (大号红色)
|
|
"price": {
|
|
"font_size": 90,
|
|
"font_color": "#FF2E2E", # 鲜红
|
|
"stroke": {"color": "#FFFFFF", "width": 6}, # 白边
|
|
"shadow": {"color": "#FF9999", "blur": 15, "offset": [0, 0], "opacity": 0.8} # 发光效果
|
|
},
|
|
|
|
# 4. 对话/气泡 (黑字白底圆角)
|
|
"bubble": {
|
|
"font_size": 48,
|
|
"font_color": "#333333",
|
|
"background": {
|
|
"type": "box",
|
|
"color": "#FFFFFF",
|
|
"corner_radius": 40, # 大圆角
|
|
"padding": [20, 40, 20, 40]
|
|
},
|
|
"shadow": {"color": "#000000", "blur": 10, "offset": [2, 5], "opacity": 0.2}
|
|
},
|
|
|
|
# 5. 时尚/极简 (细黑体+白字)
|
|
"minimal": {
|
|
"font_size": 65,
|
|
"font_color": "#FFFFFF",
|
|
"stroke": {"color": "#000000", "width": 2},
|
|
"shadow": {"color": "#000000", "blur": 2, "offset": [2, 2], "opacity": 0.8},
|
|
"font_family": "NotoSansSC-Regular.otf" # 假设有这个字体,或者回退
|
|
},
|
|
|
|
# 6. 科技/未来 (青色+发光)
|
|
"tech": {
|
|
"font_size": 60,
|
|
"font_color": "#00FFFF",
|
|
"stroke": {"color": "#003333", "width": 3},
|
|
"shadow": {"color": "#00FFFF", "blur": 20, "offset": [0, 0], "opacity": 0.9}
|
|
}
|
|
}
|
|
|
|
def get_style(style_name: str) -> dict:
|
|
"""获取样式配置,支持回退"""
|
|
return STYLES.get(style_name, STYLES["highlight"])
|
|
|
|
|
|
|
|
|
|
|
|
|