lucataco / codeformer

Robust face restoration algorithm for old photos/AI-generated faces

  • Public
  • 4M runs
  • L40S
  • GitHub
  • Paper
  • License
Iterate in playground

Run lucataco/codeformer with an API

Use one of our client libraries to get started quickly.

Set the REPLICATE_API_TOKEN environment variable

export REPLICATE_API_TOKEN=<paste-your-token-here>

Learn more about authentication

Install Replicate’s Node.js client library

npm install replicate
Learn more about setup

Run lucataco/codeformer using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

import { writeFile } from "fs/promises";
import Replicate from "replicate";
const replicate = new Replicate();

const input = {
    image: "https://replicate.delivery/pbxt/JTjMycH2wZpm6LunkJozXGi7JKsRMbcDiuuoLjJ31z5DyTuj/codeformer.jpg",
    upscale: 1,
    codeformer_fidelity: 0.7
};

const output = await replicate.run("lucataco/codeformer:78f2bab438ab0ffc85a68cdfd316a2ecd3994b5dd26aa6b3d203357b45e5eb1b", { input });
await writeFile("output.png", output);
//=> output.png written to disk
Learn more