docs: 重绘分辨率对比(无美颜提示词) + 调试接口支持自定义提示词

- app.py/hairline/service.py: 调试接口新增 redraw_prompt 参数,_call_local_redraw 支持自定义提示词
- benchmark_res_prompt.py: 提示词改为"填充遮罩区域的头发,皮肤加一点磨皮"(去掉美颜)
- static/bench4_report.html: 20行×4分辨率对比报告,80/80成功,0 OOM

可对照 bench3(含美颜) vs bench4(无美颜) 看画质差异
This commit is contained in:
xsl
2026-07-26 19:57:36 +08:00
parent bee7a487ac
commit 2877d07a69
84 changed files with 133 additions and 3 deletions
+5 -1
View File
@@ -829,6 +829,7 @@ async def debug_grow_timing(
hair_style: str = Form(default="2", description="发型序号(花瓣=2),逗号分隔多选"),
webui_steps: Optional[int] = Form(default=None, description="swapHair webui img2img 采样步数,None=服务端默认(15),可填10/15/20/25对比"),
redraw_max_side: Optional[int] = Form(default=None, description="ComfyUI重绘分辨率(长边像素)。None=默认8960=原图不缩;其他如640/768/1024"),
redraw_prompt: Optional[str] = Form(default=None, description="ComfyUI重绘提示词,None=默认'填充遮罩区域的头发,皮肤加一点磨皮,再加一点美颜'"),
):
"""单图跑接口2女性生发,返回每个步骤的耗时 + 结果图,用于定位性能瓶颈。
@@ -927,9 +928,12 @@ async def debug_grow_timing(
# 3: ComfyUI 重绘
t0 = _time.perf_counter()
# max_side: 0 或 None 都让 _call_local_redraw 用默认逻辑(外层已控制分辨率)
_ms = redraw_max_side if redraw_max_side is not None and redraw_max_side > 0 else None
grown_png = await run_in_threadpool(
_call_local_redraw,
base64.b64decode(final_b64), base64.b64decode(mask_b64))
base64.b64decode(final_b64), base64.b64decode(mask_b64),
max_side=_ms, prompt=redraw_prompt)
entry["comfyui_redraw_ms"] = int((_time.perf_counter() - t0) * 1000)
if grown_png:
entry["grown_b64"] = "data:image/jpeg;base64," + _png_to_jpg_b64(grown_png)