eladrich / pixel2style2pixel

a StyleGAN Encoder for Image-to-Image Translation

  • Public
  • 31.9K runs
  • T4
  • GitHub
  • Paper
  • License

Run eladrich/pixel2style2pixel 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 eladrich/pixel2style2pixel 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/mgxm/7935db96-ae91-440f-8c75-b94bd6315d79/input_img.jpg",
    model: "toonify"
};

const output = await replicate.run("eladrich/pixel2style2pixel:919ed2f7b6c5c24f3a53207842b61b6eba515136bd7bb9ffa75e01e970609cc4", { input });

import { writeFile } from "node:fs/promises";
await writeFile("output", output);
//=> output written to disk
Learn more