Namespace: stability
Functions
Api
▸ Api(settings
): StabilityApiConfiguration
Creates an API configuration for the Stability AI API.
It calls the API at https://api.stability.ai/v1 by default and uses the STABILITY_API_KEY
environment variable.
Parameters
Name | Type |
---|---|
settings | Partial <BaseUrlPartsApiConfigurationOptions > & { apiKey? : string } |
Returns
Defined in
packages/modelfusion/src/model-provider/stability/StabilityFacade.ts:12
ImageGenerator
▸ ImageGenerator(settings
): StabilityImageGenerationModel
Create an image generation model that calls the Stability AI image generation API.
Parameters
Name | Type |
---|---|
settings | StabilityImageGenerationSettings |
Returns
A new instance of StabilityImageGenerationModel.
See
https://api.stability.ai/docs#tag/v1generation/operation/textToImage
Example
const image = await generateImage(
stability.ImageGenerator({
model: "stable-diffusion-v1-6",
cfgScale: 7,
clipGuidancePreset: "FAST_BLUE",
height: 512,
width: 512,
steps: 30,
})
[
{ text: "the wicked witch of the west" },
{ text: "style of early 19th century painting", weight: 0.5 },
]
);
Defined in
packages/modelfusion/src/model-provider/stability/StabilityFacade.ts:43