From 5d94edfc1aec322d7e8d0b10d46beb0854714ca2 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 25 Jun 2026 20:25:49 +0800 Subject: [PATCH] save code --- static/integration.html | 6 +++--- static/test_interface1.html | 4 ++-- static/test_interface2.html | 4 ++-- static/test_interface3.html | 4 ++-- static/test_interface5.html | 4 ++-- static/test_interface6.html | 4 ++-- static/test_interface7.html | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/static/integration.html b/static/integration.html index f5a7367..65f77f6 100644 --- a/static/integration.html +++ b/static/integration.html @@ -72,7 +72,7 @@ 编码UTF-8 Content-Typemultipart/form-data 图片参数三选一:image_file(文件上传)/ image_url(URL)/ image_base64(base64 + 前缀) - 图片格式JPG / PNG,≤ 1 MB,单人正面照 + 图片格式JPG / PNG,单人正面照

统一响应结构

@@ -303,10 +303,10 @@ console.log(features['四季色彩季型']); // "冷夏型"(中文字段也保 - + - +
codemessage说明
1001无法识别人像未检测到人脸
1002人像分辨率过低低于最低分辨率
1003角度问题,非正面照非正面 / 角度过大
1005检测到多张人脸仅支持单人
1006文件超出大小限制单文件 > 1 MB
1007图片参数错误 / 后端不可用参数传错 / 服务繁忙请稍后重试
1008图片格式不支持非 JPG/PNG / base64 解码失败
diff --git a/static/test_interface1.html b/static/test_interface1.html index 82d2b80..5fd61e6 100644 --- a/static/test_interface1.html +++ b/static/test_interface1.html @@ -78,7 +78,7 @@
- 支持 JPG / PNG 正面照  |  单文件 ≤ 1 MB  |  也可拖拽图片到文件选择框 + 支持 JPG / PNG 正面照  |  也可拖拽图片到文件选择框
@@ -129,7 +129,7 @@ async function submitTest() { const fileInput = $('imageFile'); const file = fileInput.files[0]; if (!file) { setStatus('请先选择一张图片', 'error'); return; } - if (file.size > 1_000_000) { setStatus('文件超过 1 MB 限制', 'error'); return; } + const btn = $('submitBtn'); btn.disabled = true; diff --git a/static/test_interface2.html b/static/test_interface2.html index 0d0938d..a14b6a3 100644 --- a/static/test_interface2.html +++ b/static/test_interface2.html @@ -99,7 +99,7 @@ -
JPG/PNG ≤1MB  |  生发图生成较慢(数十秒~数分钟),请耐心等待
+
JPG/PNG  |  生发图生成较慢(数十秒~数分钟),请耐心等待
@@ -138,7 +138,7 @@ function setStatus(t, type) { const b=$('statusBar'); b.textContent=t; b.classNa async function submitTest() { const f = $('imageFile').files[0]; if (!f) { setStatus('请选择图片', 'error'); return; } - if (f.size > 1_000_000) { setStatus('文件超过 1 MB', 'error'); return; } + _origUrl = URL.createObjectURL(f); $('submitBtn').disabled = true; $('submitBtn').textContent = '⏳ 请求中...'; diff --git a/static/test_interface3.html b/static/test_interface3.html index 82c0541..12394f9 100644 --- a/static/test_interface3.html +++ b/static/test_interface3.html @@ -99,7 +99,7 @@
-
JPG/PNG ≤1MB  |  用马克笔在用户照片额头画发际线后拍照上传  |  不再需要原始照片
+
JPG/PNG  |  用马克笔在用户照片额头画发际线后拍照上传  |  不再需要原始照片
@@ -141,7 +141,7 @@ function setStatus(t, type) { const b=$('statusBar'); b.textContent=t; b.classNa async function submitTest() { const mf = $('markedFile').files[0]; if (!mf) { setStatus('请选择划线图', 'error'); return; } - if (mf.size > 1_000_000) { setStatus('文件超过 1 MB', 'error'); return; } + const markedUrl = URL.createObjectURL(mf); // 先显示原图 diff --git a/static/test_interface5.html b/static/test_interface5.html index 696f7f0..4dfb7be 100644 --- a/static/test_interface5.html +++ b/static/test_interface5.html @@ -85,7 +85,7 @@ -
JPG/PNG 正面照,≤1MB  |  Female: 椭圆/花瓣/心形/直线/波浪  |  Male: 椭圆/M形/直线/倒弧  |  返回中心点坐标(原图像素)
+
JPG/PNG 正面照  |  Female: 椭圆/花瓣/心形/直线/波浪  |  Male: 椭圆/M形/直线/倒弧  |  返回中心点坐标(原图像素)
@@ -134,7 +134,7 @@ function setStatus(t, type) { const b=$('statusBar'); b.textContent=t; b.classNa async function submitTest() { const f = $('imageFile').files[0]; if (!f) { setStatus('请选择图片', 'error'); return; } - if (f.size > 1_000_000) { setStatus('文件超过 1 MB', 'error'); return; } + _origUrl = URL.createObjectURL(f); $('submitBtn').disabled = true; $('submitBtn').textContent = '⏳ ...'; diff --git a/static/test_interface6.html b/static/test_interface6.html index ff81b1a..296a807 100644 --- a/static/test_interface6.html +++ b/static/test_interface6.html @@ -80,7 +80,7 @@
- 支持 JPG / PNG 正面照  |  单文件 ≤ 1 MB  |  也可拖拽图片到文件选择框 + 支持 JPG / PNG 正面照  |  也可拖拽图片到文件选择框
@@ -131,7 +131,7 @@ async function submitTest() { const fileInput = $('imageFile'); const file = fileInput.files[0]; if (!file) { setStatus('请先选择一张图片', 'error'); return; } - if (file.size > 1_000_000) { setStatus('文件超过 1 MB 限制', 'error'); return; } + const btn = $('submitBtn'); btn.disabled = true; diff --git a/static/test_interface7.html b/static/test_interface7.html index 26ebd34..064650d 100644 --- a/static/test_interface7.html +++ b/static/test_interface7.html @@ -100,7 +100,7 @@ -
JPG/PNG ≤1MB  |  生发图生成较慢(数十秒~数分钟),请耐心等待  |  工作流: add_hair2.json
+
JPG/PNG  |  生发图生成较慢(数十秒~数分钟),请耐心等待  |  工作流: add_hair2.json
@@ -139,7 +139,7 @@ function setStatus(t, type) { const b=$('statusBar'); b.textContent=t; b.classNa async function submitTest() { const f = $('imageFile').files[0]; if (!f) { setStatus('请选择图片', 'error'); return; } - if (f.size > 1_000_000) { setStatus('文件超过 1 MB', 'error'); return; } + _origUrl = URL.createObjectURL(f); $('submitBtn').disabled = true; $('submitBtn').textContent = '⏳ 请求中...';