Skip to main content

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

NameType
settingsPartial<BaseUrlPartsApiConfigurationOptions> & { apiKey?: string }

Returns

StabilityApiConfiguration

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

NameType
settingsStabilityImageGenerationSettings

Returns

StabilityImageGenerationModel

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