stability-client
Advanced tools
Comparing version
@@ -13,4 +13,4 @@ /// <reference types="node" /> | ||
seed: number | Array<number>; | ||
width: number; | ||
height: number; | ||
width: number | null; | ||
height: number | null; | ||
diffusion: keyof typeof diffusionMap; | ||
@@ -17,0 +17,0 @@ steps: number; |
{ | ||
"name": "stability-client", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "A client for the Stability AI SDK", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -75,2 +75,34 @@ # stability-client | ||
## Example with a lot of options: | ||
```js | ||
const imgBuffer = Buffer.from(base64ImageRaw, 'base64') | ||
const api = await generate({ | ||
prompt: `amazing looking room, Dean Norton style`, | ||
apiKey: process.env.STABLE_DIFFUSION_KEY, | ||
width: 512, | ||
height: 512, | ||
steps: 10, | ||
engine: 'stable-diffusion-512-v2-1', | ||
cfgScale: 10, | ||
noStore: false, // if set to true, it won't save files to outDir after generation. | ||
imagePrompt: { | ||
mime: 'image/png', | ||
content: imgBuffer, | ||
}, | ||
samples: 1, | ||
diffusion: 'ddim', | ||
outDir: '/output', | ||
}) | ||
api.on('image', async ({ buffer, imagePath }) => { | ||
// upload somewhere probably.. | ||
}) | ||
api.on('end', (data) => { | ||
console.log('Generating Complete', data) | ||
}) | ||
``` | ||
## CLI | ||
@@ -96,3 +128,3 @@ | ||
-e, --engine <engine> engine to use for inference (default: "stable-diffusion-v1") | ||
--no-store do not write aritfacts to disk | ||
--no-store do not write artifacts to disk | ||
-k, --api-key <api-key> DreamStudio API Key (env: DREAMSTUDIO_API_KEY) | ||
@@ -99,0 +131,0 @@ -o, --output-dir <outputDir> directory to store images (defaults to cwd) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
216668
0.35%147
27.83%