mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: AI face enhancement with GFPGAN and CodeFormer (#61)
* feat(shared): add enhance-faces tool definition and i18n strings * feat(ai): add face enhancement script with GFPGAN and CodeFormer support Detects faces via MediaPipe dual-model approach, then enhances using GFPGAN (proven) or CodeFormer (via codeformer-pip) with auto fallback. Supports strength-based alpha blending with original image. * feat(ai): add TypeScript bridge for face enhancement * feat(api): add enhance-faces route with GFPGAN/CodeFormer support * feat(web): add enhance-faces settings component and register in tool registry * feat(docker): add CodeFormer dependency and model download - Add codeformer-pip to both CPU and GPU requirements - Download CodeFormer model (~375MB) at Docker build time - Add CodeFormer to smoke test verification * fix(enhance-faces): address code review findings - Skip alpha blend for CodeFormer (strength already applied via fidelity weight) - Hide "only enhance main face" checkbox when Best (CodeFormer) is selected - Fix sensitivity slider labels (swap More/Fewer faces to match actual behavior) - Register EnhanceFacesControls in pipeline step settings - Remove model names from user-facing descriptions * fix(enhance-faces): fix CodeFormer integration and Docker setup - Add codeformer-pip install to Dockerfile with --no-deps to avoid numpy 2.x conflict - Re-pin numpy==1.26.4 after codeformer-pip install - Pin codeformer-pip==0.0.4 in requirements files - Broaden auto-mode fallback to catch any Exception from CodeFormer --------- Co-authored-by: stirling-image <stirling-image@users.noreply.github.com>
This commit is contained in:
co-authored by
stirling-image
parent
9ddeac92b6
commit
8071fe61c5
@@ -229,6 +229,11 @@ const BlurFacesSettings = lazy(() =>
|
||||
default: m.BlurFacesSettings,
|
||||
})),
|
||||
);
|
||||
const EnhanceFacesSettings = lazy(() =>
|
||||
import("@/components/tools/enhance-faces-settings").then((m) => ({
|
||||
default: m.EnhanceFacesSettings,
|
||||
})),
|
||||
);
|
||||
const EraseObjectSettings = lazy(() =>
|
||||
import("@/components/tools/erase-object-settings").then((m) => ({
|
||||
default: m.EraseObjectSettings,
|
||||
@@ -371,6 +376,7 @@ export const toolRegistry = new Map<string, ToolRegistryEntry>([
|
||||
["upscale", { displayMode: "before-after", Settings: UpscaleSettings }],
|
||||
["ocr", { displayMode: "before-after", Settings: OcrSettings }],
|
||||
["blur-faces", { displayMode: "before-after", Settings: BlurFacesSettings }],
|
||||
["enhance-faces", { displayMode: "before-after", Settings: EnhanceFacesSettings }],
|
||||
[
|
||||
"erase-object",
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user