mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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.
2.9 KiB
2.9 KiB
description, i18n_source_hash, i18n_provenance, i18n_output_hash
| description | i18n_source_hash | i18n_provenance | i18n_output_hash |
|---|---|---|---|
| Pulihkan dan pertajam wajah buram atau berkualitas rendah dalam gambar dengan model AI GFPGAN dan CodeFormer. | 7f9f6af8ebda | human | 66445313eca4 |
Peningkatan Wajah
Pulihkan dan tingkatkan wajah dalam gambar menggunakan model AI (GFPGAN/CodeFormer).
API Endpoint
POST /api/v1/tools/image/enhance-faces
Pemrosesan: Asinkron (mengembalikan 202, polling /api/v1/jobs/{jobId}/progress untuk status via SSE)
Model bundle: upscale-enhance (5-6 GB) dan face-detection (200-300 MB)
Parameter
| Parameter | Tipe | Wajib | Default | Deskripsi |
|---|---|---|---|---|
| file | file | Ya | - | File gambar (multipart) |
| model | string | Tidak | "auto" |
Model yang digunakan: auto, gfpgan, codeformer |
| strength | number | Tidak | 0.8 |
Kekuatan peningkatan (0-1). Nilai lebih tinggi menghasilkan peningkatan lebih kuat |
| onlyCenterFace | boolean | Tidak | false |
Hanya tingkatkan wajah yang paling sentral/menonjol |
| sensitivity | number | Tidak | 0.5 |
Sensitivitas deteksi wajah (0-1) |
Contoh Permintaan
curl -X POST http://localhost:1349/api/v1/tools/image/enhance-faces \
-F "file=@portrait.jpg" \
-F 'settings={"model":"codeformer","strength":0.7,"onlyCenterFace":false}'
Respons
Respons Awal (202 Accepted)
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
Progres (SSE di /api/v1/jobs/{jobId}/progress)
event: progress
data: {"phase":"processing","stage":"Enhancing faces...","percent":60}
Hasil Akhir (via SSE)
{
"phase": "complete",
"percent": 100,
"result": {
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/{jobId}/portrait_enhanced.png",
"previewUrl": "/api/v1/download/{jobId}/preview.webp",
"originalSize": 350000,
"processedSize": 600000,
"facesDetected": 2,
"faces": [
{"x": 120, "y": 80, "w": 100, "h": 100},
{"x": 350, "y": 90, "w": 95, "h": 95}
],
"model": "codeformer"
}
}
Catatan
- Memerlukan model bundle
upscale-enhance(5-6 GB) dan model bundleface-detection(200-300 MB). - GFPGAN menghasilkan peningkatan yang lebih agresif; CodeFormer lebih baik mempertahankan identitas.
automemilih model terbaik untuk input. - Output selalu berformat PNG untuk kualitas maksimal.
- Pratinjau WebP dihasilkan bersama output resolusi penuh untuk tampilan frontend yang lebih cepat.
- Parameter
strengthmemadukan wajah yang ditingkatkan dengan aslinya. Gunakan nilai lebih rendah (0.3-0.5) untuk perbaikan halus, nilai lebih tinggi (0.7-1.0) untuk restorasi lebih kuat. - Mendukung format input HEIC/HEIF, RAW, TGA, PSD, EXR, dan HDR melalui dekode otomatis.