- scratch_model
- image
- mask
This node has exactly one job: look at an old photo and draw a mask over the physical damage - creases, tears, dust, scratches - so the main restoration node knows where to focus its repair work rather than just doing a general quality pass. It's the automated version of what you'd otherwise have to paint by hand.
Under the hood it's a dedicated segmentation model, trained by the original Microsoft team specifically to recognize scratch-type damage rather than to do anything general-purpose. It's a separate, much smaller model from the main restoration GAN, which is why it gets its own loader (Load Scratch Mask Model) and its own node rather than being baked into Restore Old Photos directly.
Required inputs: scratch_model (the loaded checkpoint from Load Scratch Mask Model), image, input_size (full_size / resize_256 / scale_256, defaults to full_size), and resize_method (nearest-exact / bilinear / area / bicubic / lanczos, defaults to bilinear). Output: mask - wire this straight into Restore Old Photos's optional scratch_mask input.
For most photos, the defaults are the right call: full_size runs detection at your image's native resolution, which is what the README's own full-pipeline workflow screenshot uses, and it's the safest choice for accuracy. resize_256 and scale_256 trade some of that accuracy for speed by working at a smaller internal resolution first - worth trying if you're batching a large number of very high-resolution scans and full_size is too slow, but start with the default. resize_method only actually matters once you've moved off full_size, since that's the only case where an internal resize is happening at all.
One thing worth being deliberate about: this node's output is only useful downstream if scratch_detection was also enabled on the Load Restore Old Photos Model node. The mask itself will generate fine regardless, but if the restoration model wasn't loaded with the scratch-aware checkpoint, you're producing a mask that nothing is actually configured to act on. Wire both pieces together consciously rather than adding this node after the fact and assuming it'll just work.
Installing this one is simple compared to the rest of the pack - it needs a single model file, detection/FT_Epoch_latest.pt, which comes from the same global_checkpoints.zip release download the main restoration model uses, placed in models/checkpoints/. If you've already set up Load Restore Old Photos Model, there's a decent chance you already have this file sitting in the same extracted folder. Beyond that, standard pack install applies: ComfyUI Manager or a manual git clone into custom_nodes/, restart, then pip install -r requirements.txt against ComfyUI's Python.
If the dropdown is empty, it almost always means the zip wasn't extracted into models/checkpoints/ - double-check the exact folder rather than assuming the install failed outright, since this is a common one-letter-off mistake with the README's folder names. And keep the pack-wide image rule in mind here too: this node processes the same image that everything else in the pipeline does, so dimensions need to be sane multiples of 8 or 16 pixels or you risk a crash rather than a resize.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| scratch_model | SCRATCH_MODEL | — | |
| image | IMAGE | — | |
| input_size | COMBO | full_size | 3 options: full_size, resize_256, scale_256 |
| resize_method | COMBO | bilinear | 5 options: nearest-exact, bilinear, area, bicubic, lanczos |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |