Nodes/ComfyUI Bringing Old Photos Back to Life/Load Restore Old Photos Model
ComfyUI Node

Load Restore Old Photos Model

ComfyUI Node Guide

By cdb-boop·Created 2 years ago·Updated 2 years ago· 510
Load Restore Old Photos Model
    • bopbtl_models
    device_ids0
    scratch_detectionFalse
    mapping_patch_attentionFalse
    mapping_net
    vae_b
    vae_a

    This is the checkpoint loader for the core restoration model - the GAN that does the actual work of turning a faded, damaged old photo into a clean one. It's the node where all the interesting configuration for Stage 1 of this pack lives, and if you're setting up the pipeline for the first time, this is the node where most of your download effort goes.

    The model it loads is actually three separate checkpoint files working together: two VAEs and a mapping network that translates between their latent spaces. The mapping net is what does the real work, and - this is the bit that trips people up - there are multiple trained variants of it, and which one gets loaded depends on the toggles on this node. scratch_detection (True/False, defaults False) swaps in a mapping net trained to also account for a scratch/damage mask, so it can paint over creases instead of just fixing quality. mapping_patch_attention (True/False, defaults False) swaps in a different variant trained with patch-based attention. Both require you to have downloaded the matching checkpoint file - turning a toggle on without the file present just means an empty or wrong entry in the corresponding dropdown.

    Required inputs: device_ids (a string, default "0" - comma-separated GPU ids like 0 or 1,2, or -1 to run on CPU), scratch_detection, mapping_patch_attention, and three dropdowns bound to downloaded files - mapping_net, vae_b, vae_a. Output: bopbtl_models (type BOPBTL_MODELS), which feeds directly into the Restore Old Photos node.

    For a first run, device_ids set to "0" is fine if you have a GPU, and CPU (-1) genuinely works here - this model is small compared to a diffusion checkpoint, so CPU inference isn't unreasonably slow the way it would be for something like SDXL. Leave both toggles False unless you specifically plan to also run the Scratch Mask node and feed its output into Restore Old Photos, in which case flip scratch_detection on and make sure you've grabbed the scratch-variant checkpoint.

    Installing the models is the meatiest part of setting this node up, and it's all one download: global_checkpoints.zip from the microsoft/Bringing-Old-Photos-Back-to-Life releases page. Inside, restoration/VAE_A_quality/latest_net_G.pth goes in models/vae/ as your vae_a option. restoration/VAE_B_quality/latest_net_G.pth and restoration/VAE_B_scratch/latest_net_G.pth both go in models/vae/ too - the scratch one is what scratch_detection=True needs. And restoration/mapping_quality/latest_net_mapping_net.pth, restoration/mapping_scratch/latest_net_mapping_net.pth, and restoration/mapping_Patch_Attention/latest_net_mapping_net.pth all go in models/checkpoints/ - download the whole zip once and every toggle combination is covered, rather than chasing individual files as you flip settings later.

    Before any of that, though, you need the pack installed at all: ComfyUI Manager (search "Bringing Old Photos Back to Life") or git clone into custom_nodes/ plus a restart, then pip install -r requirements.txt targeting ComfyUI's own Python interpreter, not your system one. That file pulls in dlib, which is used by the face-detection half of the pack and is a genuinely fiddly compiled dependency on Windows - worth getting right early even if this particular node doesn't touch it, since it's one shared install for the whole thing.

    If a dropdown is empty, the most common cause is a file landing in the wrong models/ subfolder - vae/ versus checkpoints/ matters and it's an easy mix-up on a first pass, since the README's own folder names don't map one-to-one onto ComfyUI's default model directories.

    Categorybringing old photos back to life/loaders

    Inputs (6)

    NameTypeDefaultDescription
    device_idsSTRING0
    scratch_detectionCOMBOFalse2 options: True, False
    mapping_patch_attentionCOMBOFalse2 options: True, False
    mapping_netCOMBO0 options:
    vae_bCOMBO0 options:
    vae_aCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    bopbtl_modelsBOPBTL_MODELS