This features allows you to generate images easily from a prompt using dall-e
Function: generateImage
Prototype:
async function generateImage(prompt: string, options: GenerationOptions = {}): Promise<{ url: string }>
💡 Examples
The simplest way to use it:
// In React:
const { models: { generateImage } } = usePolyfire();
// In other environments:
const { models: { generateImage } } = polyfire;
const { url } = await generateImage("Pikachu"); // By default generateImage uses Dall-E to generate its images
console.log(url);