computerender
v0.3.4
Published
client for the computerender API
Downloads
33
Maintainers
Readme
Node client for computerender
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"
"van gough painting of a cow wearing sunglasses"
See more info here:
https://computerender.com/models-sd.html