await io.openai.images.create("dalle-3", { model: "dall-e-3", prompt: "I would like to generate an image of an american giraffe riding a bycicle in a suburban neighborhood, into the sunset.",});
Creates a an image given a prompt, but runs the request in the background using io.backgroundFetch()
example.ts
Copy
Ask AI
await io.openai.images.backgroundCreate("dalle-3", { model: "dall-e-3", prompt: "I would like to generate an image of an american giraffe riding a bycicle in a suburban neighborhood, into the sunset.",});
Creates an edited or extended image given an original image and a prompt. Official OpenAI Docs
example.ts
Copy
Ask AI
await io.openai.images.edit("dalle-2", { model: "dall-e-2", image: fs.createReadStream("./giraffe.jpg"), prompt: "A painting of a giraffe in a suburban neighborhood", response_format: "url",});