mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Enhance logging and error handling across tools; add full tool audit and Playwright tests
- Added model mismatch warnings in colorize, enhance-faces, and upscale routes. - Improved error handling in colorize, enhance_faces, remove_bg, restore, and upscale scripts with detailed logging. - Updated Dockerfile to align NCCL versions for compatibility. - Introduced a new full tool audit script to test all tools for functionality and GPU usage. - Created Playwright E2E tests for GPU-dependent tools to ensure proper functionality and performance.
This commit is contained in:
@@ -142,6 +142,13 @@ export function registerColorize(app: FastifyInstance) {
|
||||
});
|
||||
}
|
||||
|
||||
if (model !== "auto" && result.method !== model) {
|
||||
request.log.warn(
|
||||
{ toolId: "colorize", requested: model, actual: result.method },
|
||||
`Colorize model mismatch: requested ${model} but used ${result.method}`,
|
||||
);
|
||||
}
|
||||
|
||||
return reply.send({
|
||||
jobId,
|
||||
downloadUrl: `/api/v1/download/${jobId}/${encodeURIComponent(outputFilename)}`,
|
||||
|
||||
@@ -122,6 +122,13 @@ export function registerEnhanceFaces(app: FastifyInstance) {
|
||||
});
|
||||
}
|
||||
|
||||
if (model !== "auto" && result.model !== model) {
|
||||
request.log.warn(
|
||||
{ toolId: "enhance-faces", requested: model, actual: result.model },
|
||||
`Face enhance model mismatch: requested ${model} but used ${result.model}`,
|
||||
);
|
||||
}
|
||||
|
||||
return reply.send({
|
||||
jobId,
|
||||
downloadUrl: `/api/v1/download/${jobId}/${encodeURIComponent(outputFilename)}`,
|
||||
|
||||
@@ -145,6 +145,7 @@ export function registerRemoveBackground(app: FastifyInstance) {
|
||||
originalSize: fileBuffer.length,
|
||||
processedSize: transparentResult.length,
|
||||
filename,
|
||||
model: settings.model,
|
||||
});
|
||||
} catch (err) {
|
||||
request.log.error({ err, toolId: "remove-background" }, "Background removal failed");
|
||||
|
||||
@@ -166,6 +166,13 @@ export function registerUpscale(app: FastifyInstance) {
|
||||
});
|
||||
}
|
||||
|
||||
if (model !== "auto" && result.method !== model) {
|
||||
request.log.warn(
|
||||
{ toolId: "upscale", requested: model, actual: result.method },
|
||||
`Upscale model mismatch: requested ${model} but used ${result.method}`,
|
||||
);
|
||||
}
|
||||
|
||||
return reply.send({
|
||||
jobId,
|
||||
downloadUrl: `/api/v1/download/${jobId}/${encodeURIComponent(outputFilename)}`,
|
||||
|
||||
Reference in New Issue
Block a user