Restore Old Photos
ComfyUI Node Guide
- bopbtl_models
- image
- scratch_mask
- image
This is the actual restoration step - the node that takes a faded, low-contrast, maybe-scratched old photo and pushes it through the GAN to come out looking like a photo again. Everything else in this pack (face detection, face enhancement, blending) is optional polish on top; this one node is the core of what "Bringing Old Photos Back to Life" does.
Mechanically it's a latent-space translation, which is a fancier way of saying: your photo gets encoded into a "degraded quality" latent space by one VAE, a mapping network translates that latent into a "restored" latent space, and a second VAE decodes it back to pixels. That's the whole trick from the original 2020 Microsoft paper this pack ports - no diffusion, no sampling steps, just one forward pass through a trained translation network. If you enabled scratch_detection back on the Load Restore Old Photos Model node, there's a different mapping-net checkpoint loaded that was trained specifically to also account for a damage mask, which is where the optional scratch_mask input on this node comes in - it lets the model paint over creases and tears rather than just brightening and sharpening.
Required inputs: bopbtl_models (the bundle from Load Restore Old Photos Model), image, and three padding controls - pad_mode (edge / constant / reflect / symmetric / none, defaults to edge), pad_constant_value (0–255, only relevant if pad_mode is constant), and pad_reflect_type (even / odd, only relevant if pad_mode is reflect). These exist because the underlying model needs image dimensions divisible by 8 or 16 pixels and will otherwise crash - the padding options let it pad up to a safe size internally rather than you having to pre-resize by hand. Optional: scratch_mask (MASK), which you'd typically get from the Scratch Mask node. Output is a single restored image.
For a first run, the only things worth touching are image (your source photo) and whether you bother wiring scratch_mask at all. Leave pad_mode on its default edge unless you notice odd warping at the frame border in the output - that's usually the first thing to try changing. Only bother with scratch_mask if scratch_detection was actually turned on when you loaded the model; feeding a mask into a model that wasn't loaded with the scratch-aware checkpoint isn't going to do what you expect.
Installing the models this node needs is the real work here. Everything comes from one release download - global_checkpoints.zip off the Microsoft repo's GitHub releases - which you extract into models/vae/ (the vae_a and vae_b files) and models/checkpoints/ (the mapping_net files). Beyond that, the pack's general install applies: ComfyUI Manager search, or git clone into custom_nodes/ and restart, then pip install -r requirements.txt against ComfyUI's own Python. That requirements file also drags in dlib for the face-detection half of the pack even if you only care about this node - it's one shared install for everything, and dlib's C++ build step is the thing people actually get stuck on.
Worth knowing: this whole approach predates the diffusion-model wave by about five years, and the community's current go-to for old-photo restoration has moved on to a Qwen-Edit-plus-SeedVR2 diffusion pass, which is more powerful but also heavier and slower. This node's real advantage is that it's small, fast, and - because of the device_ids setting on its model loader - can run on CPU with -1, no GPU required at all. If you just need a quick, predictable fix on a stack of old family photos and don't want to fight a diffusion pipeline, this is still a completely reasonable tool to reach for.
Common failure: a crash on odd-sized images. If padding doesn't fix it, round your input to a multiple of 16 first - the author's companion pack, ComfyUI-Image-Round, exists specifically for this.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| bopbtl_models | BOPBTL_MODELS | — | |
| image | IMAGE | — | |
| pad_mode | COMBO | edge | 5 options: edge, constant, reflect, symmetric, none |
| pad_constant_value | INT | 00–255 | — |
| pad_reflect_type | COMBO | even | 2 options: even, odd |
| scratch_maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |