feat(image): 支持真 16:9(1536x864)+ 人物/商品三视图/场景默认 16:9

- gpt-image-2 实测支持 16:9(宽高需被 16 整除):真 16:9 = 1536x864(长边封顶 1536);
  原来「16:9」误给成 1536x1024(实为 3:2)。修正 _RATIO_TO_SIZE 与 _ratio_to_image_size
- admin「提示词」页比例按钮新增「宽 16:9」
- 迁移 0015/0016:scene + product_triview + person_triview 默认比例设为 16:9;
  分镜图(storyboard_frame)/立绘/视频保持竖屏不动

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
seaislee1209
2026-06-24 00:56:33 +08:00
co-authored by Claude Opus 4.8
parent dee269aeda
commit fd596776e2
4 changed files with 43 additions and 4 deletions
+4 -3
View File
@@ -723,13 +723,13 @@ def _find_entity_group(project, kind: str, label: str, group_id: str | None):
def _ratio_to_image_size(ratio: str) -> str:
"""前端比例(1:1 / 3:4 / 9:16)→ gpt-image 支持的尺寸。竖屏统一 1024x1536,横屏 1536x1024。"""
"""前端比例 → gpt-image 支持的尺寸(宽高均需被 16 整除)。16:9 用真 16:9 的 1536x864,4:3 用 1536x1024。"""
return {
"1:1": "1024x1024",
"3:4": "1024x1536",
"9:16": "1024x1536",
"4:3": "1536x1024",
"16:9": "1536x1024",
"16:9": "1536x864", # 真 16:9(原来误用 1536x1024 = 3:2)
}.get((ratio or "").strip(), "1024x1024")
@@ -768,7 +768,8 @@ def quality_suffix(stage: str, fallback: str, slot: str = "quality", sep: str =
_PROMPT_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}", re.UNICODE)
_RATIO_TO_SIZE = {"1:1": "1024x1024", "portrait": "1024x1536", "landscape": "1536x1024"}
# gpt-image 要求宽高都能被 16 整除;1536x864 = 真 16:9(长边封顶 1536),1536x1024 = 3:2
_RATIO_TO_SIZE = {"1:1": "1024x1024", "portrait": "1024x1536", "landscape": "1536x1024", "16:9": "1536x864"}
def _prompt_template_row(key: str):