We make a fast simple API for AI image generation.
const { createProdia } = require("prodia/v2"); const fs = require("node:fs/promises"); // add this to imports at the top const prodia = createProdia({ token: process.env.PRODIA_TOKEN, // get it from environment }); (async () => { // run a flux schnell generation const job = await prodia.job({ type: "inference.flux.schnell.txt2img.v1", config: { prompt: "puppies in a cloud, 4k", }, }); const image = await job.arrayBuffer(); await fs.writeFile("puppies.jpg", new Uint8Array(image)); // open puppies.jpg })();For more information check out our API docs.