web: EXPORT offers a size, and a bigger one is upscaled in the browser

The server still never sees a photo, so the model has to run in the page.
Real-ESRGAN x4v3 ships as a 4.9MB ONNX in public/models and is loaded
lazily on the first export that actually needs it; the wasm runtime is
copied next to CanvasKit at build time and stays lazily fetched, cached
for 30 days. Vite is told onnxruntime-web is external-wasm so no 28MB
asset lands in the bundle.

UNCHANGED keeps the old path and the tier cap; 2K/4K/custom upscale only
when the request is larger than the photo being edited, otherwise they
resize down. Guests keep UNCHANGED and 2K. Tiling is 256px with an 8px
overlap, so memory follows the target size rather than four times it.
This commit is contained in:
2026-09-22 09:40:18 +07:00
parent f9a40a9e1c
commit c0c99a9672
13 changed files with 17553 additions and 22 deletions
+8
View File
@@ -480,6 +480,14 @@ input[type="range"] { width: 100%; accent-color: var(--accent); }
gap: 10px;
}
.modal h2 { margin: 0; font-size: 17px; }
/* The one row in the export menu that is not a plain button: a number to type
and the button that takes it. */
.export-custom {
display: flex;
align-items: center;
gap: 8px;
}
.export-custom .field { width: 96px; }
/* --- strip moderation (/admin) ------------------------------------------ */
.adm { height: 100%; overflow-y: auto; padding: 0 22px 40px; }