 xslandCursor
|
08b31a3baa
|
fix: 测试页同时兼容 base64 与 URL 图片字段
直连 worker 返回 *_base64、经网关则改写为 *_url;统一 resolveImgSrc 后接口1/2/3/5/6 测试页都能正确显示结果图。
Co-authored-by: Cursor <cursoragent@cursor.com>
|
2026-07-19 15:49:46 +08:00 |
|
 xslandCursor
|
659c037270
|
feat: ComfyUI 改走 10.60.74.221,测试页上传图超阈值自动降采样
将 worker 默认 ComfyUI 地址改为远端 10.60.74.221:8188;前端测试页在像素超过 1536000 时等比缩小到 786432 以内。
Co-authored-by: Cursor <cursoragent@cursor.com>
|
2026-07-17 02:23:35 +08:00 |
|
xsl
|
632e75317b
|
接口6 增加字段
|
2026-07-16 12:38:10 +08:00 |
|
xsl
|
4001df2c34
|
save code
|
2026-07-15 01:16:32 +08:00 |
|
xsl
|
95c6a2d929
|
feat: 接口2/5 发际线叠图改为透明 PNG(仅曲线),生发图不变
接口2(/api/v1/hair/grow)的 image_url 和接口5(/api/v1/hairline/generate)
的 image_middle/high/low_url 从「原图+白线合成 JPG」改为「透明底 PNG(仅含
发际线曲线)」,前端需叠加原图显示。grown_image_url 生发图保持不变(ComfyUI
完整人像照片)。
实现:
- app.py 新增 _rgba_png_b64() 编码 RGBA 透明层为 PNG base64(保留 alpha)
- hairline/service.py 接口2/5 改用 build_overlay_layer(返回 RGBA 透明层)
替代 render_hairline_overlay(合成到原图)
- 网关零改动:rewrite_base64_to_url 已按 \x89PNG 魔数嗅探落盘为 .png
测试页:test_interface2/5.html 改为「原图打底 + 透明PNG 绝对定位叠加」显示
(复用 .img-stack 结构,固定叠加无开关)。
文档:接口文档.md / integration.html 更新接口2/5 图片字段说明。
测试:43 passed,接口2 image_base64 改断言为 PNG 魔数,接口5 三档叠图同。
|
2026-07-13 23:38:55 +08:00 |
|
xsl
|
28255ef7c2
|
feat: 接口5 新增 face_measure(复用接口1测量数值)+ 接口1 七眼 eye1~eye7
接口5(/api/v1/hairline/generate)在发际线结果基础上新增 data.face_measure,
复用接口1的四庭七眼测量数值(四庭/七眼 eye1~eye7/landmarks/姿态),
不含标注图;独立流程容错,测量失败时为 null 不影响发际线主结果。
重构:提取 _run_face_measure_data() 共用函数,接口1/6 改调它再补标注图,
行为不变(43 测试全过,错误码 1001/1003/1008 回归正常)。
接口1/5 七眼新增 eye1~eye7 从左到右 7 段宽度(cm),eye1/eye7 耳朵不可见
时为 null(保留键)。
测试页 test_interface5.html:移除点击切换卡片网格改为所有发型平铺,
新增四庭七眼测量卡片。前端接入页 integration.html / 接口文档同步更新。
|
2026-07-13 22:40:55 +08:00 |
|
Ubuntu
|
de2cecf0d5
|
save code
|
2026-07-10 00:38:39 +08:00 |
|
 xslandClaude Opus 4.8
|
f8e30ad32e
|
接口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>
|
2026-07-10 00:19:08 +08:00 |
|
 xslandClaude Opus 4.8
|
9675e147a0
|
接口5:新增 hairline_level 档位(middle/high/low)贴图 + 集成接口2生发能力
- hairline_level: 可选 middle(默认)/high/low,选用不同高度档位发际线贴图;
新增 hairline_texture_high/low 两套贴图,get_texture_map 改为按档位缓存
- hair_style: 可选逗号分隔序号,对选中发际线类型同步生发(ComfyUI),
结果合并进 hairline_images[].grown_image_base64(未选中为 null);
生发黑模板固定取 middle(hairline_texture_black/),与档位无关
- 新增 use_mask/prompt 生发控制参数(同接口2)
- 测试页/接口文档同步更新
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-07-09 23:30:21 +08:00 |
|
Ubuntu
|
aa981229c0
|
添加统计请求的功能
|
2026-07-02 23:28:49 +08:00 |
|
Ubuntu
|
5d94edfc1a
|
save code
|
2026-06-25 20:25:49 +08:00 |
|
Ubuntu
|
cd4ca278d4
|
完成接口1 和接口2,测试页面也完成
|
2026-06-15 10:10:52 +08:00 |
|