feat: add Deep Enhance AI tier to image enhancement

When deepEnhance is true and the upscale-enhance bundle is installed,
runs SCUNet (quality tier) after the Sharp pipeline for noise/artifact
cleanup. Falls back gracefully to Sharp-only if sidecar is unavailable.
This commit is contained in:
SnapOtter
2026-05-09 11:29:27 +08:00
parent bdcfb6647c
commit 40522ebe1a
2 changed files with 44 additions and 1 deletions
@@ -900,3 +900,21 @@ describe("Large file with modes", () => {
expect(result.processedSize).toBeGreaterThan(0);
});
});
// ── Deep Enhance ───────────────────────────────────────────────
describe("Deep Enhance", () => {
it("accepts deepEnhance setting and returns 200", async () => {
const res = await postTool({ deepEnhance: true });
expect(res.statusCode).toBe(200);
const result = JSON.parse(res.body);
expect(result.downloadUrl).toBeDefined();
expect(result.processedSize).toBeGreaterThan(0);
});
it("works without deepEnhance (default false)", async () => {
const res = await postTool({});
expect(res.statusCode).toBe(200);
const result = JSON.parse(res.body);
expect(result.downloadUrl).toBeDefined();
});
});