接口5:改为多选发型 + 每发型返回 middle/high/low 三档叠图(去掉 hairline_level 入参)
- 去掉 hairline_level 入参;middle/high/low 三档都返回
- 入参改为同接口2:gender + hair_style(逗号分隔多选,必填),缺失/越界返回 1007
- 每个选中发型返回 image_{middle,high,low}_base64 三档叠图 + grown_image_base64 生发图,
按发型分组;order = 发型序号,含 hairline_type
- 生发黑模板仍固定 middle(hairline_texture_black/),每发型 1 张生发图
- best_hairline_center_point 取首个选中发型的 middle 档
- 同步更新测试页(三档并排展示)、integration.html、stub_worker、接口文档/实现说明、test_api
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+12
-3
@@ -223,15 +223,24 @@ def create_app(port: int, password: str) -> FastAPI:
|
||||
if x_internal_token != password:
|
||||
return JSONResponse(status_code=401, content={"detail": "unauthorized"})
|
||||
delay = float(request.query_params.get("delay", "1"))
|
||||
_png = f"data:image/png;base64,{TINY_PNG_BASE64}"
|
||||
data = {
|
||||
"hairline_images": [
|
||||
{
|
||||
"image_base64": f"data:image/png;base64,{TINY_PNG_BASE64}",
|
||||
"hairline_type": "ellipse",
|
||||
"image_middle_base64": _png,
|
||||
"image_high_base64": _png,
|
||||
"image_low_base64": _png,
|
||||
"grown_image_base64": _png,
|
||||
"order": 1,
|
||||
},
|
||||
{
|
||||
"image_base64": f"data:image/png;base64,{TINY_PNG_BASE64}",
|
||||
"order": 2,
|
||||
"hairline_type": "heart",
|
||||
"image_middle_base64": _png,
|
||||
"image_high_base64": _png,
|
||||
"image_low_base64": _png,
|
||||
"grown_image_base64": None,
|
||||
"order": 3,
|
||||
},
|
||||
],
|
||||
"best_hairline_center_point": {"x": 540, "y": 430},
|
||||
|
||||
Reference in New Issue
Block a user