fix: enforce orthographic top bottom subject views
This commit is contained in:
26
api/main.py
26
api/main.py
@@ -2641,8 +2641,8 @@ SUBJECT_VIEW_LABELS: dict[str, str] = {
|
||||
"three_quarter_right": "右前 45°",
|
||||
"side": "侧面",
|
||||
"side_walk": "侧面走路",
|
||||
"top": "顶部视角",
|
||||
"bottom": "底部视角",
|
||||
"top": "正投影俯视图",
|
||||
"bottom": "正投影仰视图",
|
||||
"expression_neutral": "中性表情",
|
||||
"expression_smile": "微笑表情",
|
||||
"expression_happy": "开心表情",
|
||||
@@ -2691,11 +2691,27 @@ def _subject_view_labels(kind: SubjectKind, requested: list[str] | None = None)
|
||||
("back", "背面"),
|
||||
("left", "左侧"),
|
||||
("right", "右侧"),
|
||||
("top", "顶部"),
|
||||
("bottom", "底部"),
|
||||
("top", "正投影俯视图"),
|
||||
("bottom", "正投影仰视图"),
|
||||
]
|
||||
|
||||
|
||||
def _subject_view_projection_clause(view: str) -> str:
|
||||
if view == "top":
|
||||
return (
|
||||
"Patent-style orthographic top view: look straight down from directly above the product, "
|
||||
"with the viewing direction perpendicular to the top face. No perspective, no tilt, no 3/4 angle, "
|
||||
"no oblique overhead camera, no visible front/side depth unless it is true product thickness in orthographic projection. "
|
||||
)
|
||||
if view == "bottom":
|
||||
return (
|
||||
"Patent-style orthographic bottom view: look straight up at the underside/bottom face, "
|
||||
"with the viewing direction perpendicular to the bottom face. No perspective, no tilt, no 3/4 angle, "
|
||||
"no low-angle perspective camera, no visible front/side depth unless it is true product thickness in orthographic projection. "
|
||||
)
|
||||
return ""
|
||||
|
||||
|
||||
def _attach_temporal_metrics(items: list[dict]) -> None:
|
||||
"""相邻低清帧差异:转场 / 动作目标依赖它,不需要逐帧高分辨率扫描。"""
|
||||
for i, it in enumerate(items):
|
||||
@@ -6910,11 +6926,13 @@ def _generate_subject_assets_sync(job_id: str, idx: int, element_id: str, req: G
|
||||
else:
|
||||
view_prompt = f"complete object/product reference, {view_label} view"
|
||||
view_name = view.replace("_", " ")
|
||||
projection_clause = _subject_view_projection_clause(view)
|
||||
single_view_clause = (
|
||||
f"Single-image output rule: this output file is ONLY for the {view_label} view ({view_name}). "
|
||||
"Render exactly one subject, one time, in one pose and one camera angle. "
|
||||
"Do not create a multi-view sheet, contact sheet, grid, storyboard, lineup, comparison layout, before/after layout, mirrored pair, duplicate subjects, thumbnails, labels, captions, arrows, view names, panel borders, or multiple versions in the same image. "
|
||||
"Do not include any other views in this image. "
|
||||
+ projection_clause
|
||||
)
|
||||
framing_clause = (
|
||||
"For this close-up view, intentionally crop as an upper-body asset from head/neck to chest or upper back; the neck, shoulders, collarbone or upper spine area must be large, clear, and useful for placing a neck-and-shoulder massage device. "
|
||||
|
||||
Reference in New Issue
Block a user