Files
SnapOtter/apps/docs/zh-CN/tools/image/noise-removal.md
T
SnapOtterandGitHub 4963ab3bbd feat(docs-i18n): translate all documentation into 20 languages
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
2026-07-11 13:52:47 +08:00

2.7 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
基于 AI 的降噪和去颗粒处理,提供多档质量选项。 f0dfc876e0e0 human 43d042c4f560

降噪

基于 AI 的降噪和去颗粒处理,提供多档质量选项,使用 Python 边车(SCUNet 模型)。

API 端点

POST /api/v1/tools/image/noise-removal

处理方式: 异步(返回 202,通过 SSE 轮询 /api/v1/jobs/{jobId}/progress 获取状态)

模型包: upscale-enhance5-6 GB

参数

参数 类型 是否必填 默认值 说明
file file - 图片文件(multipart
tier string "balanced" 质量档位:quickbalancedqualitymaximum
strength number 50 降噪强度(0-100
detailPreservation number 50 保留细节的程度(0-100)。值越高保留的纹理越多
colorNoise number 30 彩色噪点抑制强度(0-100
format string "original" 输出格式:originalpngjpegwebpavifjxl
quality number 90 输出编码质量(1-100

请求示例

curl -X POST http://localhost:1349/api/v1/tools/image/noise-removal \
  -F "file=@noisy-photo.jpg" \
  -F 'settings={"tier":"quality","strength":60,"detailPreservation":70,"colorNoise":40}'

响应

初始响应(202 Accepted

{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "async": true
}

进度(位于 /api/v1/jobs/{jobId}/progress 的 SSE

event: progress
data: {"phase":"processing","stage":"Denoising...","percent":65}

最终结果(通过 SSE

{
  "phase": "complete",
  "percent": 100,
  "result": {
    "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "downloadUrl": "/api/v1/download/{jobId}/noisy-photo_denoised.jpg",
    "originalSize": 500000,
    "processedSize": 380000
  }
}

说明

  • 需要安装 upscale-enhance 模型包(5-6 GB)。
  • 质量档位在速度和质量之间权衡:quick 最快,仅做基础降噪;maximum 采用最彻底的多轮处理方式。
  • 对于有纹理的主体(布料、头发、树叶),detailPreservation 参数至关重要。较高的值可防止降噪器抹平细微的细节。
  • format 设为 "original" 时,输出格式与输入文件格式一致。
  • 通过自动解码支持 HEIC/HEIF、RAW、TGA、PSD、EXR 和 HDR 输入格式。