zetyquickly-org
/
faceswap-a-gif
Make Fun by Changing Face on a GIF!
- Public
- 14.5K runs
-
L40S
Run zetyquickly-org/faceswap-a-gif 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 zetyquickly-org/faceswap-a-gif 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 = {
source: "https://replicate.delivery/pbxt/MSGVMZFwtAVjR6GfWtJPXkWY8oD5x1VU1YD33L0cDfus1PpX/target2.jpg",
target: "https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExcng1OHp0ZHh3d2QxaXQ5cXlid3JrdWRia2J6OXdtcWw2MHgwam40OCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/s239QJIh56sRW/giphy.gif"
};
const output = await replicate.run("zetyquickly-org/faceswap-a-gif:974be35318aab27d78c8c935761e665620236d3b157a9b35385c7905c601d977", { input });
import { writeFile } from "node:fs/promises";
await writeFile("output.gif", output);
//=> output.gif written to disk