What the model is for, and what it is not
This page has always divided print damage by width, and the division has always had a hole in it. Narrow damage — dust, hairline scratches, cat hairs on the platen, the speckle of foxing — is closed by averaging the intact picture within a few pixels of each marked one, and that works because the photograph either side of a hairline still agrees about what should be there. Wide damage has no such agreement. Across a torn corner there is no intact picture in the middle to average, so the average reaches further and further for something to hold on to and returns a smear.
An inpainting model is a different kind of answer to that. Rather than averaging, it generates: it is shown the hole with its contents removed, and it draws what it thinks continues into the gap. On a crease across a brick wall, a sky, a lawn or a patterned dress that is a repair nothing local could have made. On a crease across somebody’s face it is a guess about a face, and it will make one confidently.
- What it draws is invented, not recovered. The paper under a tear records nothing, so there is no signal anywhere for a model to find. It produces something plausible for the gap, which is a different claim from producing what was there. Where the missing region held a face, a hand or a sign, treat the result as a reconstruction and say so if you pass the picture on.
- It adds no colour that was never recorded. Fade recovery stretches the range each channel still holds, and the model redraws inside the mask using the colours around the hole. Neither invents a hue for a monochrome print. A grey photograph comes out of both passes grey.
- Nothing here rates the result. This site quotes sizes and run times because they were measured, and it does not quote a quality figure because none was. Whether a redrawn crease is better than a filled one is a judgement about your photograph, which is why the comparison control and the undo history are where they are.
- It does not make the picture bigger. One of the two models is a super-resolver, used inside the pass so that a square drawn on a 512-pixel grid lands in a flatbed scan at something nearer the scan’s own resolution. The file you save has exactly the pixel dimensions of the file you opened. There is no enlargement control on this site and this is not one.
What it costs before it runs
Nothing on this page fetches anything until a control that names the size has been pressed. These are the exact lengths of the files, not rounded estimates and not figures copied off a model card — they were measured on the files that are served, and they are read by the same code that draws the button.
| File | Exact size | Where from |
|---|---|---|
| ONNX Runtime, WebAssembly build | 13,986,063 bytes (13.3 MB) | This domain |
| Damage filler — inpainting, MIT | 26,639,447 bytes (25.4 MB) | Our model file server |
| Detail pass — optional, BSD-3-Clause | 4,866,396 bytes (4.6 MB) | Our model file server |
| Everything, with the optional pass on | 45,491,906 bytes (43.4 MB) | Two hosts, one of them this one |
The runtime is the larger half of that and it is not the model. ONNX Runtime’s WebAssembly build is what executes a graph in a browser tab at all, it is served from this domain rather than from anywhere else, and it is the reason the first model pass on any site in this family costs what it costs. Everything after it is comparatively small.
Kept, and deletable
A completed download is written into a named cache in your own browser, and the name carries a version — so a future model is a new bucket rather than a stale file served under an old address. The second pass fetches nothing and works offline. A file that arrives at a length that does not match the measured size is refused rather than kept, because a truncated graph fails much later and much less clearly than a download that plainly did not finish. The panel carries a control that deletes both models again.
Declining costs you nothing but the wide damage
The local engine is not a fallback bolted on for appearances; it is what this site was and still is. Detection, the editable mask, the fill, the per-channel fade recovery and the written report all run with nothing downloaded, and the save path is the same one. Declining leaves you a tool that closes dust, hairlines and foxing properly and says honestly that a tear is beyond it.
How a pass is put together
The order never varies, on screen or in the export: the scan is read for damage, the reading is thresholded into a mask you can edit, the mask is filled locally, the wide regions are redrawn, and the tone curves go last. The model is inserted into an existing order rather than replacing it, which is why a pass can be run, looked at, undone and run again without the rest of the repair moving.
| Step | What it does | Why it is that way |
|---|---|---|
| Sort the mask by width | Connected regions are measured; those whose shortest side exceeds twice the fill's reach are candidates | A region narrower than that has intact picture within reach of its middle, and the local average is the better answer there |
| Cut a square around each | Two and a half times the damage, clamped to the photograph, never smaller than the model's own 512 | A window cropped tight gives the model nothing to continue from; a window smaller than 512 would be scaled up into invented detail |
| Redraw, up to eight squares | One run of the inpainting model per square, each with the hole's contents removed before it is shown | The model never sees what was under the mask, so the fill is a redraw rather than a blur of the damage |
| Re-render each square, optionally | The drawn square is run through the second model in 128-pixel tiles, and only the tiles holding damage | The fill is drawn on a 512 grid and the window is often several times that; tiles with nothing marked in them would be discarded anyway |
| Write back inside the mask only | Every pixel outside the marked regions is the scan's own, untouched | A generator redraws the whole square it is shown, and taking its version of the surroundings would quietly resample the photograph around every repair |
Saving re-runs the whole of that at the original resolution rather than enlarging what was on screen. A model square is 512 pixels whatever it was cut from, so repeating the pass on a twenty-megapixel scan costs about what it cost on the preview instead of costing it per megapixel — the squares are simply cut from bigger pixels.
Questions about the model
Is the model looking at my photograph on somebody's server?
Does it restore what was actually in the photograph?
Why does it only redraw some of what I marked?
How long does a pass take?
Can it bring the colour back to a faded print?
Can I use it without downloading anything?
Where to go next
The local engine and its two openings are on the first three cards; the reading behind all of it is on the fourth. The piece on what restoration cannot bring back is the one worth reading before a pass on a photograph that matters, because the model does not move that line — it only changes which side of it a crease falls on.
- RepairImageDetection, an editable mask and the fill, on one column.
- Scratches and dustOpens with detection turned up and the brush already out.
- Restore an old photographOpens on fade correction, for a print that has gone pale and warm.
- What restoration cannot bring backSilvering, mould, missing faces, and the honest end of the list.



