Offer SCUNet and NLM alongside the guided denoise
The AI denoise panel now picks between three bases: the existing guided filter, non-local means and a learned SCUNet model run through onnxruntime-node on overlapping tiles. The base is part of the render key, so each model keeps its own cached render and switching back is instant, and jobs report stage and tile progress instead of a bare spinner. onnxruntime-node is pinned to 1.23.0, the last release that ships both macOS architectures, and every Docker and desktop install skips its CUDA download because only the CPU binaries in the package are used. The SCUNet weights and ONNX Runtime are added to the third-party notices, the deb copyright file and the README's denoise, API and redistribution sections.
This commit is contained in:
+10
-5
@@ -199,16 +199,21 @@ export function findDenoised(id, key) {
|
||||
return path.join(dir, names[0]);
|
||||
}
|
||||
|
||||
/** Remove every denoised render for a photo, sparing `keepKey` if given. */
|
||||
export function removeDenoised(id, keepKey) {
|
||||
/**
|
||||
* Remove denoised renders for a photo, sparing the keys named in `keepKeys`.
|
||||
* A single key is accepted too; with none, every render for the photo goes.
|
||||
*/
|
||||
export function removeDenoised(id, keepKeys) {
|
||||
const safe = lookupId(id);
|
||||
if (!safe) return 0;
|
||||
const dir = path.join(storageRoot(), 'denoised');
|
||||
const key = keepKey ? String(keepKey).replace(/[^a-z0-9]/gi, '') : null;
|
||||
const keep = key ? `${safe}.${key}.jpg` : null;
|
||||
const keys = (Array.isArray(keepKeys) ? keepKeys : keepKeys ? [keepKeys] : [])
|
||||
.map((key) => String(key).replace(/[^a-z0-9]/gi, ''))
|
||||
.filter(Boolean);
|
||||
const keep = new Set(keys.map((key) => `${safe}.${key}.jpg`));
|
||||
let removed = 0;
|
||||
for (const name of listFiles(dir)) {
|
||||
if (!name.startsWith(`${safe}.`) || name === keep) continue;
|
||||
if (!name.startsWith(`${safe}.`) || keep.has(name)) continue;
|
||||
fs.rmSync(path.join(dir, name), { force: true });
|
||||
removed += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user