Quick answer
Replicate Codeformer costs about $0.0048 a run, or 208 runs per $1, as of November 2026. Paid client work is the catch: CodeFormer’s license covers non-commercial use, so you need the authors’ permission first. Start with an official route (Hugging Face, Replicate, OpenXLab or the GitHub code), and skip any "Codeformer APK".
Replicate Codeformer is CodeFormer, a face restoration model from S-Lab at Nanyang Technological University, running on Replicate. Replicate is a paid cloud service that bills by the second. If you retouch client photos, ask a lawyer about the license; this isn’t legal advice.
The authors’ Hugging Face Space handles a single photo in a browser tab. For a folder, Replicate charges per second of GPU time, and the authors’ code runs locally with no per-run fee.
Key takeaways
- No official CodeFormer app exists, so skip every Codeformer APK.
- A Replicate run costs about $0.0048 as of November 2026.
- The S-Lab License covers non-commercial use; paid work needs permission.
- Replicate deletes API uploads after an hour by default; web uploads stay.
- Running it locally needs PyTorch, CUDA and the official model weights.
What is CodeFormer, and what does Replicate add?
CodeFormer started as a 2022 research paper by Shangchen Zhou, Kelvin C.K. Chan, Chongyi Li and Chen Change Loy, first posted to arXiv on June 22, 2022. It later appeared in the NeurIPS 2022 proceedings. The model doesn’t just sharpen pixels. It treats the job as a "code prediction task" and rebuilds the face from a learned codebook of face parts. That’s how it can pull a clean face out of a tiny or badly blurred photo.
The CodeFormer GitHub README calls its main setting the fidelity weight, w, and sets it between 0 and 1. A smaller w gives a higher-quality result, while a larger w stays closer to the original face, the same "trade-off between fidelity and quality" the CodeFormer project page describes. In practice, a low w can hand you a crisp, clean face that doesn’t quite look like your grandmother anymore. Check every result against the original. Scanning and fidelity settings for old family prints are covered in our restoring old photos with AI guide.
The authors kept adding to the code after the paper. A dlib face detector option arrived on February 10, 2023, and the training code and config files went public on April 19, 2023. The README says CodeFormer is now "widely adopted and deployed across a broad range (>20)" of apps, platforms and websites. The repo itself had 18.2k stars and 3.7k forks on GitHub as of November 2026. Replicate’s billing docs call it "a pay-as-you-go platform," and the CodeFormer page on Replicate showed 55.4 million runs as of November 2026. The README names only three "official deployments maintained by the authors": a Hugging Face Space, Replicate and OpenXLab. Everything else is third party, including every APK.
Diagram by DigitalTreed: the three official CodeFormer deployments plus the GitHub code, from the authors’ README, as of November 2026.What a CodeFormer run costs on Replicate
As of November 2026, Replicate’s model page says CodeFormer "costs approximately $0.0048 to run on Replicate, or 208 runs per $1," though the price "varies depending on your inputs." The model runs on an Nvidia L40S. Replicate’s pricing page lists that GPU at $0.000975 a second, or $3.51 an hour. Divide one by the other and a typical run lasts about 4.9 seconds, which fits the page’s note that predictions "typically complete within 5 seconds." The formula is photos x seconds per photo x $0.000975. The photo counts and run times below are made-up example inputs, and the per-second price is Replicate’s, as of November 2026.
| Example job | Formula | Cost (USD) |
|---|---|---|
| Example: 50 family photos, about 5 s each | 50 x 5 s x $0.000975/s | $0.24 |
| Example: 300 photos, about 5 s each | 300 x 5 s x $0.000975/s | $1.46 |
| Example: 300 photos, if each run takes 12 s | 300 x 12 s x $0.000975/s | $3.51 |
Two billing rules keep a real bill close to that math: for public models, the billing docs say "you only pay for the time it’s active processing your requests." Setup and idle time are free, and "if a run fails, we don’t charge you." Replicate also lets you run select models free, "but after a bit you’ll be asked to set up billing." You then pay by prepaid credit or get billed in arrears, a charge each month for the month before. Because billing runs by the second, a run that takes, for example, 10 seconds instead of 5 costs about twice as much: $0.00975 at November 2026 prices.
Diagram by DigitalTreed: example CodeFormer costs on Replicate, worked out from its L40S price of $0.000975 a second, as of November 2026.Even the slowest example, 300 photos at 12 seconds each, adds up to exactly one hour of L40S time, which is why it matches Replicate’s $3.51 hourly rate.
Can you use CodeFormer for paid work?
CodeFormer’s LICENSE file is the S-Lab License 1.0, which allows "Redistribution and use for non-commercial purpose" and, for commercial use, says to "contact the contributor(s) of the work." Replicate’s model page is blunter: "Note that Replicate API of CodeFormer cannot be used commercially." Paying Replicate doesn’t change that, either. Section 2.5 of the Replicate terms of service says you "agree to fully comply with Third-Party Terms," and those terms include the licenses of the models you’re running. The per-run fee pays for GPU time only.
Drawn by us: the S-Lab License 1.0 decision, from the CodeFormer LICENSE file and Replicate’s model page, as of November 2026.Fixing family photos for the fridge looks like the non-commercial use the license describes, while retouching a client’s paid job or selling an app built on it looks commercial. For anything in that second group, email the authors first (the README closes with a contact address), and have a lawyer read their reply. If the authors say no, or never answer, the safe move is to keep CodeFormer for personal photos and use a tool whose terms allow commercial work. Our DragGAN explainer covers another research model, and our ChatGPT image rules guide covers a commercial tool’s usage terms.
Running CodeFormer on your own computer
Running it yourself avoids per-run fees and keeps photos on your own machine, but setup takes work. The README lists PyTorch 1.7.1 or later and CUDA 10.1 or later, then builds a separate conda environment on Python 3.8. If those version numbers mean nothing to you, the Hugging Face demo or Replicate will likely be faster than an afternoon of installing packages. Replicate’s model page adds that it’s open source and "you can run it on your own computer with Docker."
The README’s commands for a whole photo clone the code, install its packages, fetch the face detector and CodeFormer weights, then restore with w at 0.7.
git clone https://github.com/sczhou/CodeFormer
cd CodeFormer
conda create -n codeformer python=3.8 -y
conda activate codeformer
pip3 install -r requirements.txt
python basicsr/setup.py develop
python scripts/download_pretrained_models.py facelib
python scripts/download_pretrained_models.py CodeFormer
python inference_codeformer.py -w 0.7 --input_path [image folder]Results land in the code’s results folder. For a face already cropped and aligned to 512 x 512 pixels, the README adds --has_aligned and sets w to 0.5. Whole-image mode blends the face back into the background, and the README warns that this "may damage hair texture on the boundary." The weights come from the official v0.1.0 release on GitHub, published August 10, 2022, which holds 20 model files and nothing you’d install on a phone. For touch-ups after the restore, our free photo editors test checks what each editor really gives you free.
Scripting Replicate skips the install. Its Python quick start needs only pip install replicate and an API token saved as REPLICATE_API_TOKEN. Copy the input names from the API tab on the CodeFormer model page rather than guessing them, since a wrong name gets you an error instead of a photo. Teams calling several AI APIs can route them through one place, as our LLM gateway tools guide shows.
Why a Codeformer APK is a bad idea
Before this rewrite, this page told readers to download a "Replicate Codeformer APK" and allow apps from unknown sources. We cut those steps.
No official CodeFormer app exists. The authors’ official list has three web deployments and no app. Their only GitHub release holds model files, and the seven official pages we saved never mention an APK, Android or an app store.
The same README table marks 12 API platforms, among them Segmind, Sieve and fal.ai, as "Non-official" without calling them unlicensed. As we read it, the S-Lab License travels with the model, so a paid job on any of them raises the same permission question. Three look-alike websites get a harsher note: codeformer.net, codeformer.cn and codeformerai.com. The README says they "use our models without any license or authorization" and asks readers to "verify their legitimacy to avoid potential financial loss." We don’t link those sites and haven’t tested them, so we make no claim about what they do.
For app files from unknown sites, the FTC’s malware guide says "Don’t use unfamiliar websites to download free stuff" and "Don’t click on ads to download software." On Android, Google describes Play Protect as a feature that "checks your device for potentially harmful apps from other sources." It’s on by default, so leave it on. The FTC’s phone security page adds "Update your apps, too." Our Eduuolvera APK guide lists checks to run on any APK before installing it. If a CodeFormer app from a download site is already on your phone, start with our phishing cleanup steps for phones.
What we tested
We didn’t run CodeFormer itself, since that needs an account or an install. On November 11, 2026, we ran a short script over the saved official pages and GitHub’s release list.
| Check | Result |
|---|---|
| Files in the GitHub releases | 20 files in 1 release, 0 APK (v0.1.0 by type: .pth 17, .dat 3) |
| App words on 7 official pages | 0 hits |
| License lines | 4 of 4 found |
| Official deployments | 3; 15 others marked non-official |
| Cost math | $0.0048 / $0.000975 = 4.92 s a run |
The 4.92-second result fits the model page’s 5-second note. A text search can’t prove no app exists anywhere, only that the authors don’t publish one.
Screenshot: our local check page, November 11, 2026.What happens to the faces you upload
Replicate’s data retention page says API inputs, outputs and logs are "automatically removed after an hour, by default." Web predictions are different, since "Data for predictions created through the web interface is kept indefinitely" until you press Delete on that prediction’s page. Replicate’s privacy policy says it generally keeps customer personal information "for as long as necessary to provide our Services." Neither page we read says whether uploaded photos train other models, so we don’t claim either way.
In May 2023, the FTC issued a policy statement on biometric information. Its release warns that "Large databases of biometric information could also be attractive targets for malicious actors."
The FTC has also acted against a photo app: Everalbum settled FTC allegations that it misled users about facial recognition and kept photos and videos after people deactivated their accounts.
Our take, based on Replicate’s rules only (other hosts set their own): upload only photos you have the right to share. Use the API route if you want uploads gone within the hour. Delete web predictions when you’re done. For client photos, get the client’s written OK first, and ask a lawyer to check your contract wording.
Frequently asked
Is CodeFormer free to use?
The code is free for non-commercial use. Replicate charges about $0.0048 a run as of November 2026.
Can CodeFormer fix faces in a video?
Yes. The README added video input on October 5, 2022, for .mp4, .mov or .avi files.
Can CodeFormer colorize black-and-white photos?
Yes, for cropped 512 x 512 faces, since April 9, 2023, per the README file.
Is the Hugging Face CodeFormer demo official?
Yes. The README marks the Hugging Face Space "Maintained by Authors."
How we made this guide: Every quote here appears word for word in the 19 pages we saved, listed in Sources. Facts checked by the DigitalTreed team on November 11, 2026. Not legal advice.
First published December 2023 with a feature list and steps to install an unofficial APK. Rewritten November 11, 2026: those parts had no official source and were cut; cost, license, local setup and privacy are new.
Sources
- arXiv: CodeFormer paper by Zhou, Chan, Li and Loy (2206.11253)
- NeurIPS 2022 proceedings: CodeFormer paper abstract
- Shangchen Zhou: CodeFormer project page
- GitHub: sczhou/CodeFormer repository and README
- GitHub: CodeFormer LICENSE (S-Lab License 1.0)
- GitHub: CodeFormer release v0.1.0
- Hugging Face: CodeFormer Space by sczhou
- Replicate: sczhou/codeformer model page
- Replicate: Pricing
- Replicate docs: Billing
- Replicate docs: Run a model from Python
- Replicate docs: Data retention
- Replicate: Terms of Service
- Replicate: Privacy Policy
- FTC Consumer Advice: Malware, how to protect against, detect and remove it
- FTC Consumer Advice: How to protect your phone from hackers
- Android Help: Use Google Play Protect to help keep your apps safe
- FTC: FTC warns about misuses of biometric information and harm to consumers (May 2023)
- FTC: Everalbum, Inc., In the Matter of



Comments
No comments yet. Start the conversation below.