AI model drawing images for Node using min(DALL·E). Requires python3.
npm install dalle
Sometimes you have to install prerequisites to make it work. Check below:
import { generateImage } from 'dalle'
import ImageDataURI from 'image-data-uri'
async function start() {
const dataURI = await generateImage('Nuclear explosion broccoli', { gridSize: 2 })
ImageDataURI.outputFile(dataURI, 'brocolli.png')
}
start()
The generateImage
function will load the model parameters once and reuse the model to generate multiple images.
MIT License © 2022 Robert Soriano