cjwbw
/
real-esrgan
Real-ESRGAN: Real-World Blind Super-Resolution
Run cjwbw/real-esrgan 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
Run cjwbw/real-esrgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
import Replicate from "replicate";
const replicate = new Replicate();
const input = {
image: "https://replicate.delivery/pbxt/ILGG7cg5B6nJe95KzEYuUwn6ANVMNWutvNo0thaFFfkF9Xuu/groot.jpeg"
};
const output = await replicate.run("cjwbw/real-esrgan:d0ee3d708c9b911f122a4ad90046c5d26a0293b99476d697f6bb7f2e251ce2d4", { input });
import { writeFile } from "node:fs/promises";
await writeFile("output.png", output);
//=> output.png written to disk