feat(erase-object): overhaul object eraser with LaMa inpainting improvements

Update erase-object pipeline, eraser canvas, and inpainting Python script.
Add LaMa model download script and update Dockerfile for model support.
Update multi-file tool routes for consistency.
This commit is contained in:
Siddharth Kumar Sah
2026-04-13 00:48:05 +08:00
parent 92d4d2d9c6
commit 0a506efe24
17 changed files with 405 additions and 95 deletions
+4 -3
View File
@@ -4,6 +4,7 @@ import { join } from "node:path";
import type { FastifyInstance } from "fastify";
import sharp from "sharp";
import { z } from "zod";
import { autoOrient } from "../../lib/auto-orient.js";
import { sanitizeFilename } from "../../lib/filename.js";
import { ensureSharpCompat } from "../../lib/heic-converter.js";
import { createWorkspace } from "../../lib/workspace.js";
@@ -81,9 +82,9 @@ export function registerCompose(app: FastifyInstance) {
}
try {
// Decode HEIC/HEIF if needed
baseBuffer = await ensureSharpCompat(baseBuffer);
overlayBuffer = await ensureSharpCompat(overlayBuffer);
// Decode HEIC/HEIF if needed, then normalize EXIF orientation
baseBuffer = await autoOrient(await ensureSharpCompat(baseBuffer));
overlayBuffer = await autoOrient(await ensureSharpCompat(overlayBuffer));
// Apply opacity to overlay if needed
let processedOverlay = overlayBuffer;