Image
TextToImage
Stability

Name

stabilityTextToImage

Description

Returns an image generated by Stability (Stable Diffusion) from the given text prompt in the form of an ArrayBuffer.

API Key

Uses the stability API key:

index.ts

const aigur = createClient({
apiKeys: {
stability: process.env.STABILITY_API_KEY
}
})

Example

index.ts

import { stabilityTextToImage } from '@aigur/client';
//...
flow.node(stabilityTextToImage, () => ({
text_prompts: [
{
text: 'a green apple'
}
]
})) // --> {result: ArrayBuffer}

Input

Property Type Required Description Default Value
text_prompts { text: string, weight?: number }[] Yes The prompt to create the image from. Weight is optional. If weight is negative the text becomes a "negative prompt". At least one array member with text is required.
model enum('stable-diffusion-v1-5', 'stable-diffusion-512-v2-0', 'stable-diffusion-768-v2-0', 'stable-diffusion-512-v2-1', 'stable-diffusion-768-v2-1') No The model to use. stable-diffusion-v1-5
clip_guidance_preset enum('NONE', 'FAST_BLUE', 'FAST_GREEN', 'SIMPLE', 'SLOW', 'SLOWER', 'SLOWEST') No CLIP Guidance can be used to provide additional context while generating your image, which often results in improved coherency. CLIP Guidance is "guiding" the generation process of your image to be more in-line with your included prompt.
steps number [10..150] No Amount of inference steps performed on image generation. 50
sampler enum('DDIM', 'DDPM', 'K_DPMPP_2M', 'K_DPMPP_2S_ANCESTRAL', 'K_DPM_2', 'K_DPM_2_ANCESTRAL', 'K_EULER', 'K_EULER_ANCESTRAL', 'K_HEUN', 'K_LMS') No Which sampler to use for the diffusion process. If this value is omitted we'll automatically select an appropriate sampler for you.
cfg_scale number [0..35] No How strictly the diffusion process adheres to the prompt text (higher values keep your image closer to your prompt). 7
seed number [>0] No Random noise seed (omit this option or use 0 for a random seed) 0
height number [>128, multiples of 64] No The height of the generated image.

For 768 engines: 589,824 ≤ height * width ≤ 1,048,576

All other engines: 262,144 ≤ height * width ≤ 1,048,576
512
width number [>128, multiples of 64] No The width of the generated image.

For 768 engines: 589,824 ≤ height * width ≤ 1,048,576

All other engines: 262,144 ≤ height * width ≤ 1,048,576
512
No
No

Output

Property Type
result ArrayBuffer