Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 714 Bytes

File metadata and controls

29 lines (22 loc) · 714 Bytes

Welcome to Prodia

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.