Generate your first image with Mynth
# Bun
bun add @mynthio/sdk
# PNPM
pnpm add @mynthio/sdk
# NPM
npm install @mynthio/sdk
MYNTH_API_KEY=mak_...
import Mynth from "@mynthio/sdk";
const mynth = new Mynth({ apiKey: process.env.MYNTH_API_KEY ?? "" });
const task = await mynth.generate({
prompt: "A cinematic portrait of a fox in a rainy neon alley",
model: "black-forest-labs/flux.1-dev",
});
console.log(task.getImages());
const taskAsync = await mynth.generate(
{
prompt: "A floating garden at sunrise",
model: "black-forest-labs/flux.1-dev",
},
{ mode: "async" }
);
console.log("Task started:", taskAsync.id);