wobsoriano / node-dalle

AI model drawing images for Node using min(DALL·E).
MIT License
5 stars 0 forks source link
ai dalle images node typescript

node-dalle

AI model drawing images for Node using min(DALL·E). Requires python3.

Installation

npm install dalle

Sometimes you have to install prerequisites to make it work. Check below:

Linux #### Install Python ```bash sudo apt install python3 sudo apt install python3-dev ``` #### Install Node-gyp ```bash sudo apt install make sudo apt install g++ sudo npm install -g node-gyp ```
Windows #### Install Python, Node-gyp if missing ```bash npm install --global --production windows-build-tools npm install -g node-gyp ```
Mac #### Install XCode from AppStore, Python

Usage

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.

License

MIT License © 2022 Robert Soriano