新增模型补全空洞

This commit is contained in:
2026-04-09 23:38:14 +08:00
parent 6cb82cec57
commit 0710090b4d
11 changed files with 582 additions and 8 deletions

View File

@@ -420,7 +420,12 @@ def inpaint(req: InpaintRequest) -> Dict[str, Any]:
out_path = out_dir / f"{model_name}_inpaint.png"
out.save(out_path)
return {"success": True, "output_path": str(out_path)}
# 兼容 Qt 前端:直接返回结果图,避免前端再去读取服务器磁盘路径
return {
"success": True,
"output_path": str(out_path),
"output_image_b64": _pil_image_to_png_b64(out),
}
except Exception as e:
return {"success": False, "error": str(e)}