lucataco / omnigen2
OmniGen2: a powerful and efficient unified multimodal model
Run lucataco/omnigen2 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 lucataco/omnigen2 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/NFVLgKWVv48pYj7p8qCnKpeYDN5S46MlxYNaIEzRu03KG1xJ/yellow-dress.png",
prompt: "Change the dress to blue"
};
const output = await replicate.run("lucataco/omnigen2:5b9ea1d0821a60be9c861ebfc3513d121ecd8cab1932d3aa8d703e517988502e", { input });
// To access the file URL:
console.log(output.url());
//=> "https://replicate.delivery/.../output.png"
// To write the file to disk:
await writeFile("output.png", output);
//=> output.png written to disk