save code
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
<tr><td>编码</td><td>UTF-8</td></tr>
|
||||
<tr><td>Content-Type</td><td><code>multipart/form-data</code></td></tr>
|
||||
<tr><td>图片参数</td><td>三选一:<code>image_file</code>(文件上传)/ <code>image_url</code>(URL)/ <code>image_base64</code>(base64 + 前缀)</td></tr>
|
||||
<tr><td>图片格式</td><td>JPG / PNG,≤ 1 MB,单人正面照</td></tr>
|
||||
<tr><td>图片格式</td><td>JPG / PNG,单人正面照</td></tr>
|
||||
</table>
|
||||
|
||||
<p style="margin-top:14px;font-size:13px"><strong>统一响应结构</strong>:</p>
|
||||
@@ -303,10 +303,10 @@ console.log(features['四季色彩季型']); // "冷夏型"(中文字段也保
|
||||
<table>
|
||||
<tr><th>code</th><th>message</th><th>说明</th></tr>
|
||||
<tr><td>1001</td><td>无法识别人像</td><td>未检测到人脸</td></tr>
|
||||
<tr><td>1002</td><td>人像分辨率过低</td><td>低于最低分辨率</td></tr>
|
||||
|
||||
<tr><td>1003</td><td>角度问题,非正面照</td><td>非正面 / 角度过大</td></tr>
|
||||
<tr><td>1005</td><td>检测到多张人脸</td><td>仅支持单人</td></tr>
|
||||
<tr><td>1006</td><td>文件超出大小限制</td><td>单文件 > 1 MB</td></tr>
|
||||
|
||||
<tr><td>1007</td><td>图片参数错误 / 后端不可用</td><td>参数传错 / 服务繁忙请稍后重试</td></tr>
|
||||
<tr><td>1008</td><td>图片格式不支持</td><td>非 JPG/PNG / base64 解码失败</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<button class="btn btn-outline btn-sm" onclick="clearResults()">清除结果</button>
|
||||
</div>
|
||||
<div class="upload-hint">
|
||||
支持 JPG / PNG 正面照 | 单文件 ≤ 1 MB | 也可拖拽图片到文件选择框
|
||||
支持 JPG / PNG 正面照 | 也可拖拽图片到文件选择框
|
||||
</div>
|
||||
<div id="statusBar" class="status hidden"></div>
|
||||
</div>
|
||||
@@ -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;
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<button class="btn btn-primary" id="submitBtn" onclick="submitTest()">🚀 提交</button>
|
||||
<button class="btn btn-outline btn-sm" onclick="clearResults()">清除</button>
|
||||
</div>
|
||||
<div class="hint">JPG/PNG ≤1MB | 生发图生成较慢(数十秒~数分钟),请耐心等待</div>
|
||||
<div class="hint">JPG/PNG | 生发图生成较慢(数十秒~数分钟),请耐心等待</div>
|
||||
<div style="margin-top:10px;display:flex;align-items:center;gap:8px">
|
||||
<label style="font-size:13px;font-weight:600;color:#374151;white-space:nowrap">💬 提示词</label>
|
||||
<input type="text" id="promptInput" value="补充遮罩区域的头发" style="flex:1;padding:8px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:13px;max-width:500px">
|
||||
@@ -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 = '⏳ 请求中...';
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<button class="btn btn-primary" id="submitBtn" onclick="submitTest()">🚀 提交</button>
|
||||
<button class="btn btn-outline btn-sm" onclick="clearResults()">清除</button>
|
||||
</div>
|
||||
<div class="hint">JPG/PNG ≤1MB | 用马克笔在用户照片额头画发际线后拍照上传 | 不再需要原始照片</div>
|
||||
<div class="hint">JPG/PNG | 用马克笔在用户照片额头画发际线后拍照上传 | 不再需要原始照片</div>
|
||||
<div id="statusBar" class="status hidden"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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);
|
||||
// 先显示原图
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<button class="btn btn-primary" id="submitBtn" onclick="submitTest()">🚀 提交</button>
|
||||
<button class="btn btn-outline btn-sm" onclick="clearResults()">清除</button>
|
||||
</div>
|
||||
<div class="hint">JPG/PNG 正面照,≤1MB | Female: 椭圆/花瓣/心形/直线/波浪 | Male: 椭圆/M形/直线/倒弧 | 返回中心点坐标(原图像素)</div>
|
||||
<div class="hint">JPG/PNG 正面照 | Female: 椭圆/花瓣/心形/直线/波浪 | Male: 椭圆/M形/直线/倒弧 | 返回中心点坐标(原图像素)</div>
|
||||
<div id="statusBar" class="status hidden"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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 = '⏳ ...';
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<button class="btn btn-outline btn-sm" onclick="clearResults()">清除结果</button>
|
||||
</div>
|
||||
<div class="upload-hint">
|
||||
支持 JPG / PNG 正面照 | 单文件 ≤ 1 MB | 也可拖拽图片到文件选择框
|
||||
支持 JPG / PNG 正面照 | 也可拖拽图片到文件选择框
|
||||
</div>
|
||||
<div id="statusBar" class="status hidden"></div>
|
||||
</div>
|
||||
@@ -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;
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<button class="btn btn-primary" id="submitBtn" onclick="submitTest()">🚀 提交</button>
|
||||
<button class="btn btn-outline btn-sm" onclick="clearResults()">清除</button>
|
||||
</div>
|
||||
<div class="hint">JPG/PNG ≤1MB | 生发图生成较慢(数十秒~数分钟),请耐心等待 | 工作流: add_hair2.json</div>
|
||||
<div class="hint">JPG/PNG | 生发图生成较慢(数十秒~数分钟),请耐心等待 | 工作流: add_hair2.json</div>
|
||||
<div style="margin-top:10px;display:flex;align-items:center;gap:8px">
|
||||
<label style="font-size:13px;font-weight:600;color:#374151;white-space:nowrap">💬 提示词</label>
|
||||
<input type="text" id="promptInput" value="补充遮罩区域的头发" style="flex:1;padding:8px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:13px;max-width:500px">
|
||||
@@ -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 = '⏳ 请求中...';
|
||||
|
||||
Reference in New Issue
Block a user