Open Source
Open Source

Old Photos at Home: Three Open-Source Models, Zero App

A walk through three open-source old-photo restoration models - CodeFormer (sczhou/CodeFormer, about 18,202 stars, NTU S-Lab license, weights non-commercial), GFPGAN (TencentARC/GFPGAN, about 37,697 stars, code Apache-2.0 but weights non-commercial), and Real-ESRGAN (xinntao/Real-ESRGAN, about 37,299 stars, BSD-3-Clause). It clarifies the relationship, selection, local setup, and each model's commercial boundary.

Published November 1, 20269 min read
<!-- old-photo-restoration-opensource-resource | open-source | Old Photos at Home: Three Open-Source Models, Zero App -->

Scope note: open-source selection and local setup only

Let us be clear about the boundary first. This article does not review any mobile app, nor does it benchmark cloud services. We do exactly one thing: walk through three open-source old-photo restoration models that each have tens of thousands of GitHub stars, ship downloadable weights for free, and run on your own machine, so you can decide which to install, how to install it, and whether you may use it commercially. Online mini-programs from Tencent, ByteDance, and Alipay are mentioned only in one line at the end as the "do not want to run locally" exit, and we will not expand on them. The reason is simple: the strength of open-source models is that your data never leaves your machine, the parameters are controllable, and you can batch-process a whole box of family photos, whereas online services usually require uploading the original, charge per image, and hide what they actually do. If you care about privacy or need to restore a crate of ancestry photos, local deployment is the real answer.

The three models and their repositories

All three repositories are given below in both link and plain form so you can copy directly.

CodeFormer

The sczhou/CodeFormer repository, plain address: https://github.com/sczhou/CodeFormer

At the time of our check, CodeFormer has roughly 18,202 stars on GitHub. Its license field returned by the GitHub API is NOASSERTION, meaning it was not normalized by the standard license classifier; the project README states the license as NTU S-Lab License 1.0, a non-commercial license, and the pretrained weights are, per the authors' statement, restricted to research and non-commercial use. Its core strength is blind face restoration: without you marking where the face is, the model uses a Codebook Lookup Transformer to naturally complete blurred, damaged, low-resolution faces. It shines on faces, especially severely degraded old photos where the features are barely visible, and the result looks like a person rather than an obvious face swap.

GFPGAN

The TencentARC/GFPGAN repository, plain address: https://github.com/TencentARC/GFPGAN

GFPGAN has about 37,697 stars, the most popular of the three. Its code is released under Apache-2.0, but pay close attention: the bundled pretrained weights include DFDNet under CC BY-NC-SA 4.0 (non-commercial) and StyleGAN2 under the NVIDIA license, so the weights themselves carry non-commercial restrictions and commercial use needs caution. Proposed by Tencent ARC Lab, GFPGAN uses a Generative Facial Prior for blind face restoration and enhancement; it brightens, denoises, and rebuilds facial features cleanly, making it ideal for quickly turning a dull, gray face photo into a lively one, and it is the fastest to get started among the three.

Real-ESRGAN

The xinntao/Real-ESRGAN repository, plain address: https://github.com/xinntao/Real-ESRGAN

Real-ESRGAN has about 37,299 stars and the cleanest, most friendly license: BSD-3-Clause. It is positioned as a general-purpose blind image super-resolution model, good at deblurring, removing JPEG compression artifacts, and upscaling small images; it is not a face-specialized model. The models it ships, such as realesrgan-x4plus, realesrnet-x4plus, realesr-animevideov3, and realesr-general-x4v3, are general super-resolution models, not face-specific. Its face enhancement is achieved by internally calling GFPGAN through the --face_enhance option; it does not independently rebuild faces on its own, a point we will stress again below.

A relationship often written wrong

Many articles describe GFPGAN as a component of CodeFormer, which is wrong. GFPGAN and CodeFormer are two independent, parallel projects from different teams: CodeFormer comes from NTU S-Lab (Nanyang Technological University) and GFPGAN from Tencent ARC. When CodeFormer does full-image restoration, it plugs in Real-ESRGAN to upsample the background and face regions, not GFPGAN. In other words, the model CodeFormer actually uses as a "background enhancement plugin" is Real-ESRGAN; realesrgan-x4plus and friends are general super-resolution models, and the face-enhancement role falls to GFPGAN only at that step. Getting this straight keeps you from installing the wrong dependencies or wiring the wrong pipeline, and stops you from assuming that installing CodeFormer automatically brings GFPGAN along.

How to choose: look at the photo first

Selection is not a dilemma; match the photo type to the tool.

For face-dominant old photos, prefer CodeFormer. It ships a fidelity slider w from 0 to 1: smaller w yields more "beautified", higher-quality output, larger w stays closer to the original. If you are restoring a wedding photo of your grandparents and want both a clear face and the original look preserved, CodeFormer gives the most flexibility; for extremely old, broken photos where features are fuzzy, pushing w toward 1 is also more stable.

For overall blur, scans, and general sharpness, prefer Real-ESRGAN. Old archive scans, yellowed documents, and endlessly re-compressed JPEGs are best handled by its deblurring and artifact removal, and its ncnn build needs no CUDA and runs on CPU, making it the most hardware-friendly choice.

For a quick face brighten and denoise, prefer GFPGAN. It is the fastest to get started among the three; the command is simple and the clean build runs on plain CPU Windows, perfect for people who do not want to fiddle with environments.

How to run locally

All three need a Python environment, but the difficulty differs sharply; each is described below.

CodeFormer local setup

You need a conda environment with python=3.8, then pip install -r requirements.txt, and python basicsr/setup.py develop. It depends on PyTorch and CUDA; a GPU is strongly recommended, though CPU works but is slow. The main inference script is inference_codeformer.py. The repo maintains an official Gradio wrapper, and the community offers third-party WebUIs such as dfcode, so command-line avoiders can use a graphical interface and just drag an image in to get a result.

GFPGAN local setup

pip install basicsr facexlib, then pip install -r requirements.txt and python setup.py develop. The main script is inference_gfpgan.py, for example:

bash
python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2

It ships a "clean" build that needs no CUDA extension and runs directly on CPU and Windows, the most newcomer-friendly of the three; the version flag -v ranges from 1.2 to 1.4, where 1.3 is more natural and stable across qualities while 1.2 is sharper with a slight beauty touch, so switch as needed.

Real-ESRGAN local setup

The lightest. You can use the Python script way:

bash
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance

Or you can download the realesrgan-ncnn-vulkan portable executable, which needs no CUDA and no PyTorch and runs on Intel, AMD, Nvidia GPUs or plain CPU, making it the most hassle-free of the three; adding --face_enhance automatically calls GFPGAN for face enhancement, so one command gives you both a sharp background and a clean face.

License and commercial boundary

This section must be clear, because none of the three is "fully free," and reading only the code license will trip you up.

CodeFormer: the GitHub API license field is NOASSERTION, the README states NTU S-Lab License 1.0, and the pretrained weights are, per statement, limited to research and non-commercial use; commercial use needs extra authorization, so do not assume it is free for business.

GFPGAN: the code is Apache-2.0 and commercially usable, but the weights bundle DFDNet (CC BY-NC-SA 4.0) and StyleGAN2 (NVIDIA license), so the weights themselves carry non-commercial restrictions; using the model inside a commercial product demands extra caution and preferably explicit authorization first.

Real-ESRGAN: BSD-3-Clause, with both code and general-model weights relatively permissive, the lowest commercial risk of the three; but because its --face_enhance calls GFPGAN, once you enable face enhancement that non-commercial constraint comes along, so do not assume using it solves everything.

Conclusion: for personal family photos, research, and non-profit display, all three are safe; for paid restoration services or commercial products, prefer Real-ESRGAN's general super-resolution and seek separate compliant authorization for the face-enhancement part, keeping the boundary in writing.

Practical tips

If this is your first time with such tools, start with Real-ESRGAN's ncnn portable build: zero environment, zero GPU threshold, and you get the "sharpness" layer working first; once the direction is confirmed, move to GFPGAN for face brightening, and finally use CodeFormer for high-fidelity retouching. Going from light to heavy, from general to face, wastes no time on wrong environments and lets you compare the three directly. Also, scan old photos at the highest DPI you can; the clearer the original, the more believable the face details the model fills in, and do not expect a phone snapshot of a blurry print to be brought back to life.

A few output notes save rework. CodeFormer and GFPGAN emit PNG by default, while Real-ESRGAN can also write the upscaled result as a single tile-free image. If you feed a scanned photo, fix rotation and dust first, because every model treats a tilted scan as part of the scene and will happily "restore" the skew along with the face. Keep your originals untouched and write results to a separate folder, so a bad run never overwrites the only copy you have.

When open source is not optimal

Having praised the strengths, a dose of cold water is fair: open-source models are not omnipotent, and in several cases they are not the best answer. First, if you have no command-line background and no willingness to install a Python environment, even the ncnn portable build still asks you to download, unzip, and type commands, a higher bar than "open the mini-program and upload." Second, if a photo is so damaged that the face structure is entirely gone, no model can do more than invent a face from its prior, and the result may look nothing like the real person; such extremes are better left to a professional restorer doing hand retouching. Third, if you need batch, consistent, deliverable commercial service with both stable quality and compliant licensing, the labor and legal cost of building this toolchain yourself may exceed buying a mature solution. Open source gives you control and playfulness; the price is that you become the operator, so think it through before you start.

Online alternatives, in one line

If you do not even want to set up an environment, Tencent, ByteDance, and Alipay all offer old-photo restoration mini-programs: upload and get a result, zero deployment cost, at the price of sending your original to their servers and playing by their rules, with neither the privacy nor the batch freedom of local runs.

FAQ

Q1: Which restores faces best?

For severely degraded photos where features are unreadable, CodeFormer's blind face restoration is the most robust, and its w slider balances "fidelity" against "beautification"; for a quick brighten and denoise, GFPGAN is faster and lighter. Both beat Real-ESRGAN on the face step, whose face enhancement is essentially borrowed from GFPGAN.

Q2: Do I need a graphics card?

CodeFormer and GFPGAN recommend an NVIDIA GPU (CUDA) for a comfortable run; GFPGAN has a clean build for pure CPU, and CodeFormer can also run slowly on CPU. Real-ESRGAN's ncnn build is the least picky and works on CPU. You can run without a discrete GPU, but the speed gap is large, turning a few seconds per photo into several minutes.

Q3: How do I run locally?

Install Python and the matching dependencies first: CodeFormer uses inference_codeformer.py, GFPGAN uses inference_gfpgan.py, and Real-ESRGAN uses inference_realesrgan.py or the downloaded ncnn build. If you fear the command line, CodeFormer and some community projects ship a WebUI where you just click, no need to memorize parameters.

Q4: Can I use it commercially?

Real-ESRGAN (BSD-3-Clause) general super-resolution is safest; CodeFormer weights are research-and-non-commercial only and need extra authorization; GFPGAN code is commercial but its weights carry non-commercial limits. For paid restoration, untangle each model's license first and do not read only the code license.

Q5: How does it compare with online mini-programs?

Online mini-programs need zero setup and are quick to start, but your original is uploaded, processed by their rules, and hard to batch or customize; local open-source models keep data on your machine, give controllable parameters, and allow batching, at the cost of setting up an environment and using hardware. For privacy-sensitive cases or a whole box of photos, local wins.

Related reading

This article is AI-assisted and human-edited. Last updated: 2026-11-01

Related

Open Source

DeepInfer Open-Sourced: 155T Tokens/Day, Engine or Factory?

On October 20, 2026 DeepSeek announced full open sourcing of DeepInfer, its production-grade inference framework - the first time the official production engine is available instead of open-source parts plus guesswork. The repository deepseek-ai/DeepInfer ships under Apache-2.0 and measured 17,902 stars, 1,836 forks, and 188 open issues on launch day, while the companion token codec deepseek-recipe is MIT-licensed; the two repositories carry different licenses. Every performance figure below is vendor-reported and has no third-party reproduction yet: a single cluster serves 155 trillion tokens per day (about 38 dollars per card per hour at off-peak pricing), first-token latency of 400 milliseconds, 230 tokens per second generation, 96 percent prefix-cache hit rate, and Prefill throughput per card rising from 60,000 to 1.5 million tokens per second when caching counts. SWA Bounded Replay pins the recompute of cache misses to the last 128 tokens, which nearly halves total Prefill compute and makes cost independent of context length; DSpark speculative decoding drafts up to 5 tokens, adds another 6 percent to live throughput, and yields 14K tokens per card per second; MoE expert replicas reshuffle every 10,000 steps so the busiest card runs only 9 percent above average load. Hardware covers both NVIDIA SM100 and Huawei Ascend 950 NPUs, and setup means a Python 3.12 virtual environment, the DEEPINFER_ACCELERATOR variable, and a source build that pulls DeepSeek-V4.1-Flash-1017 weights by default. The boundaries matter: DeepSeek states that Prefill and Decode disaggregation, data-parallel load balancing, and the KVCache management layer are still not fully open because they couple too deeply to internal infrastructure - this is the engine, not the whole factory - and no official benchmark against vLLM, SGLang, or TensorRT-LLM exists. In production, 8-card servers handle Prefill while 64 to 128-card supernodes handle Decode, with KVCache kept beyond 72 hours to avoid recomputation.

Oct 22, 202610 min read
Open Source

AI Memory Framework, Open-Sourced: Tencent's 3B Tops Opus 5

Tencent Hunyuan open-sourced all three layers of Hy Memory 2.0 on 2026-10-16: the model layer Hy-Memory-30B-A3B (30B total parameters with about 3B active per token, a sparse MoE on HuggingFace at tencent/Hy-Memory-30B-A3B, arXiv 2610.22196), the SDK layer hy-memory (2.0.3 on PyPI at writing time) and the tool layer MemHub (CLI v1.0.3, bootstrapped via the npm memhub-cli package). License check: the GitHub API reports NOASSERTION (non-standard text), but the raw LICENSE file is Apache-2.0 with a Tencent preamble and no added restrictions - this article follows the LICENSE text. Official documents mix two spellings, "Hy-Memory-30A3B" and "Hy-Memory-30B-A3B"; we follow the HF repository name. Official benchmarks (vendor-reported): first place at 55.49 in a four-way memory-system comparison, ahead of Opus 5 (54.62) and DeepSeek-Flash (53.64), while Qwen3-30B-A3B scores only 44.37; MemoryArena 55.31 percent, leading runner-up EverOS by 10.2 points; CodeMemoryBench 64.2/35.6; SWE-ContextBench 28.3; LoCoMo 72.6 percent with memory tokens cut from 1159 to 703 (-39.3 percent). Internal business validation (vendor-reported): stock-picking multi-hop recall up from 50 to 90 percent, iWiki up 48.6 percent relative. Positioning is a memory-writer workhorse (analyst take, secondary): the model specializes in writing and updating memory and can in principle sit under existing systems like Mem0 or MemOS. MemHub tool count in two versions: the README lists 5 while the official WeChat article says 10 - go by actual CLI output. Five limitations stated as-is: vendor-only benchmarks without third-party replication, preview-stage API churn, MemHub limited to Linux/macOS, a 30B-class model that is nontrivial to self-host, and thin English docs. Repository: github.com/Tencent-Hunyuan/Hy-Memory (verified reachable). Division note: ai-agent-long-term-memory-sop (2026-08-08) covers the build-your-own mem0/Letta route; this piece covers Tencent's ready-made stack.

Oct 20, 202610 min read
Open Source

AI Agents Can Now Reverse Engineer Apps: 84k Stars in a Week

morluto/rea (Reverse Engineer Anything) topped GitHub Trending: verified via GitHub API on October 11, 2026 - 84,088 stars, MIT, TypeScript; the star-growth chain cites three sources separately (~10,400 via trending data, 47,884 via a third party quoting the GitHub API, 84,088 verified by us). Repo: github.com/morluto/rea. It is an MCP server plus CLI (npx rea-agents setup) that wires your coding agent (Claude Code/Codex/Cursor/Gemini CLI and more) into a reverse-engineering toolbox: native binaries through Hopper/Ghidra/IDA, static JS/Electron with no engine needed, .NET assemblies, APKs (JADX), firmware (Binwalk/Unblob), EVM bytecode, HAR/mitmproxy captures and websites. v6.0 (release notes, October 8, 2026) added pwntools offline ELF layout, crash inspection, Windows PE x86 and LLDB observation, with v6.1-v6.3 following within 24 hours. Honest limits: it does not recover original source, does not clone apps wholesale, and every conclusion ships with evidence and stated caveats; analysis runs locally so the target binary never leaves your machine. README-cited showcases: DX-Ball function rebuilt in C passing 3,205 original x86 cases with all 63 bytes reproduced; the Notion clipboard bridge traced end to end. created_at 2026-04-14 (API) vs a reported October 7 launch - both stated, no exact date asserted.

Oct 11, 202610 min read