Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

computerender

computerender49MIT0.3.4TypeScript support: included

client for the computerender API

stable diffusion, stable, diffusion, ai, generative, art, dalle, text2img, img2img

readme

Node client for computerender

npm version workflow

An easy to use image generation API

Updates:

  • v0.3: Throws errors with custom types
  • v0.2: Heavy deps removed
  • v0.1: Now supports img2img!

Install:

npm i computerender

Usage:

import fs from "fs";
import {Computerender} from "computerender";

// Automatically tries environment variable 
// CR_KEY when no key is provided
const cr = new Computerender("sk_your_api_key_here");

/* -- text to image -- */
const prompt = "a cow wearing sunglasses";
const imageResult = await cr.generateImage({prompt});

// Optionally write to file 
fs.writeFileSync(prompt + ".jpg", imageResult);

/* -- image to image -- */
const newPrompt = "van gough painting of " + prompt;
const styledResult = await cr.generateImage(
    {prompt: newPrompt, img: imageResult}
);

// Optionally write to file
fs.writeFileSync(newPrompt + ".jpg", styledResult);

"a cow wearing sunglasses"
a cow wearing sunglasses

"van gough painting of a cow wearing sunglasses"
van gough painting of a cow wearing sunglasses

See more info here:

https://computerender.com/models-sd.html