ComfyUI Node

Load Scratch Mask Model

ComfyUI Node Guide

By cdb-boop·Created 2 years ago·Updated 2 years ago· 510
Load Scratch Mask Model
    • scratch_model
    scratch_model

    A small, single-purpose loader: it loads the checkpoint that the Scratch Mask node needs to detect physical damage - creases, tears, dust - in an old photo. There's not much to it on its own, but it's a required stop if you want automatic damage detection rather than painting a mask by hand.

    Required input: scratch_model, a dropdown bound to the checkpoint file you've downloaded and placed on disk. There's no other configuration on this node - no toggles, no device selection. Output: scratch_model (type SCRATCH_MODEL), which feeds directly into the Scratch Mask node.

    This loader only matters if you're planning to run scratch detection automatically. If you'd rather paint your own damage mask by hand - using any node that outputs a MASK, this isn't locked to the pack's own detector - you can skip this node and the Scratch Mask node entirely and feed your hand-painted mask straight into Restore Old Photos's optional scratch_mask input instead. The pipeline doesn't care where the mask came from.

    Installing the model is straightforward: it's a single file, detection/FT_Epoch_latest.pt, extracted from global_checkpoints.zip - the same release download the main restoration model (Load Restore Old Photos Model) also draws from - and placed in models/checkpoints/. If you've already set that node up, there's a good chance this file is sitting in the same extracted folder already, since it comes from the identical zip.

    Before that, the pack itself needs to be installed: through ComfyUI Manager (search "Bringing Old Photos Back to Life") or a manual git clone into custom_nodes/ followed by a restart, then pip install -r requirements.txt run against ComfyUI's own Python interpreter rather than your system one. That install pulls in dlib for the face-detection side of the pack as well - it's one shared requirements.txt for everything, even though this specific loader has nothing to do with dlib.

    One thing worth being deliberate about, since it's easy to miss: loading this model doesn't automatically make anything downstream use it. The Restore Old Photos node only actually applies scratch-aware repair if scratch_detection was also toggled True on Load Restore Old Photos Model - that toggle controls which mapping-net checkpoint gets loaded there, and it's a separate switch from anything on this node. Load this model, run Scratch Mask, get a mask - and then remember to flip the matching toggle on the restoration loader, or the mask you generated has nowhere useful to go.

    If the dropdown is empty, it's almost always that global_checkpoints.zip wasn't extracted into models/checkpoints/ - worth double-checking the exact folder name rather than assuming the download itself failed, since the README's folder structure doesn't map one-to-one onto ComfyUI's usual model directories.

    Categorybringing old photos back to life/loaders

    Inputs (1)

    NameTypeDefaultDescription
    scratch_modelCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    scratch_modelSCRATCH_MODEL