Skip to main content

Class: Automatic1111ImageGenerationModel

Create an image generation model that calls the AUTOMATIC1111 Stable Diffusion Web UI API.

See

https://github.com/AUTOMATIC1111/stable-diffusion-webui

Hierarchy

Implements

Accessors

modelInformation

get modelInformation(): ModelInformation

Returns

ModelInformation

Implementation of

ImageGenerationModel.modelInformation

Inherited from

AbstractModel.modelInformation

Defined in

packages/modelfusion/src/model-function/AbstractModel.ts:17


modelName

get modelName(): string

Returns

string

Overrides

AbstractModel.modelName

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:73


settingsForEvent

get settingsForEvent(): Partial<Automatic1111ImageGenerationSettings>

Returns settings that should be recorded in observability events. Security-related settings (e.g. API keys) should not be included here.

Returns

Partial<Automatic1111ImageGenerationSettings>

Implementation of

ImageGenerationModel.settingsForEvent

Overrides

AbstractModel.settingsForEvent

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:119

Constructors

constructor

new Automatic1111ImageGenerationModel(settings): Automatic1111ImageGenerationModel

Parameters

NameType
settingsAutomatic1111ImageGenerationSettings

Returns

Automatic1111ImageGenerationModel

Overrides

AbstractModel&lt;Automatic1111ImageGenerationSettings&gt;.constructor

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:67

Methods

callAPI

callAPI(input, callOptions): Promise<{ images: string[] ; info: string ; parameters: }>

Parameters

NameType
inputAutomatic1111ImageGenerationPrompt
callOptionsFunctionCallOptions

Returns

Promise<{ images: string[] ; info: string ; parameters: }>

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:77


doGenerateImages

doGenerateImages(prompt, options): Promise<{ base64Images: string[] = rawResponse.images; rawResponse: { images: string[] ; info: string ; parameters: } }>

Parameters

NameType
promptAutomatic1111ImageGenerationPrompt
optionsFunctionCallOptions

Returns

Promise<{ base64Images: string[] = rawResponse.images; rawResponse: { images: string[] ; info: string ; parameters: } }>

Implementation of

ImageGenerationModel.doGenerateImages

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:136


withPromptTemplate

withPromptTemplate<INPUT_PROMPT>(promptTemplate): PromptTemplateImageGenerationModel<INPUT_PROMPT, Automatic1111ImageGenerationPrompt, Automatic1111ImageGenerationSettings, Automatic1111ImageGenerationModel>

Type parameters

Name
INPUT_PROMPT

Parameters

NameType
promptTemplatePromptTemplate<INPUT_PROMPT, Automatic1111ImageGenerationPrompt>

Returns

PromptTemplateImageGenerationModel<INPUT_PROMPT, Automatic1111ImageGenerationPrompt, Automatic1111ImageGenerationSettings, Automatic1111ImageGenerationModel>

Implementation of

ImageGenerationModel.withPromptTemplate

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:152


withSettings

withSettings(additionalSettings): Automatic1111ImageGenerationModel

The withSettings method creates a new model with the same configuration as the original model, but with the specified settings changed.

Parameters

NameType
additionalSettingsPartial<Automatic1111ImageGenerationSettings>

Returns

Automatic1111ImageGenerationModel

Example

const model = new OpenAICompletionModel({
model: "gpt-3.5-turbo-instruct",
maxGenerationTokens: 500,
});

const modelWithMoreTokens = model.withSettings({
maxGenerationTokens: 1000,
});

Implementation of

ImageGenerationModel.withSettings

Overrides

AbstractModel.withSettings

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:169


withTextPrompt

withTextPrompt(): PromptTemplateImageGenerationModel<string, Automatic1111ImageGenerationPrompt, Automatic1111ImageGenerationSettings, Automatic1111ImageGenerationModel>

Returns

PromptTemplateImageGenerationModel<string, Automatic1111ImageGenerationPrompt, Automatic1111ImageGenerationSettings, Automatic1111ImageGenerationModel>

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:148

Properties

provider

Readonly provider: "Automatic1111"

Overrides

AbstractModel.provider

Defined in

packages/modelfusion/src/model-provider/automatic1111/Automatic1111ImageGenerationModel.ts:71


settings

Readonly settings: Automatic1111ImageGenerationSettings

Implementation of

ImageGenerationModel.settings

Inherited from

AbstractModel.settings

Defined in

packages/modelfusion/src/model-function/AbstractModel.ts:7