The SDWebUIApi class provides methods to interact with the AUTOMATIC1111 Stable Diffusion Web UI API. It extends the Shared class and includes various methods to generate images, retrieve information, and manage options and configurations.

Each method corresponds to a specific API endpoint and provides a convenient way to interact with the AUTOMATIC1111 Stable Diffusion Web UI functionalities.

Hierarchy

  • Shared
    • SDWebUIApi

Constructors

Properties

_client: SDWebUIClient

Methods

  • Create embedding from options.

    Reference: create_embedding

    Parameters

    • options: Record<string, any>

      Options for creating an embedding

    Returns Promise<{ info: string }>

  • Create HyperNetwork from options.

    Reference: create_hypernetwork

    Parameters

    • options: Record<string, any>

      Options for creating a HyperNetwork

    Returns Promise<{ info: string }>

    Information about the HyperNetwork

  • Generate images from images.

    Reference: img2imgapi

    Type Parameters

    Parameters

    • options: T & { init_images: string[] }

      Options for generating images from images

      • init_images: string[]

        List of base64 encoded images

    Returns Promise<Img2ImgResponse<T>>

    Generated images as base64 strings

  • Interrupt the current task.

    Reference: interruptapi

    Returns Promise<string>

    Information about the interruption

  • Get the current options or set the options.

    Reference: get_config, set_config

    Type Parameters

    • T extends Partial<SDOptions> & Record<string, any>

    Parameters

    • Optionaloptions: T

      Options to set

    Returns Promise<OptionsResponse<T>>

    Current options

    const options = await client.api.options();
    console.log(options);

    const options = await client.api.options({
    "sd_model_checkpoint": "some_checkpoint"
    });
    console.log(options
  • Get information about a PNG image.

    Reference: pnginfoapi

    Type Parameters

    • T extends undefined | string

    Parameters

    • Optionalimage: T

      Base64 encoded PNG image

    Returns Promise<PngInfoResponse<T>>

    Information about the PNG image

  • Reload the current checkpoint.

    Reference: reloadapi

    Returns Promise<string>

    Information about the reloading

  • Skip the current task.

    Reference: skipapi

    Returns Promise<string>

    Information about the skipped task

  • Train embedding from options.

    Reference: train_embedding

    Parameters

    • options: Record<string, any>

      Options for training an embedding

    Returns Promise<{ info: string }>

    Information about the training

  • Train HyperNetwork from options.

    Reference: train_hypernetwork

    Parameters

    • options: Record<string, any>

      Options for training a HyperNetwork

    Returns Promise<{ info: string }>

    Information about the training

  • Unload the current checkpoint.

    Reference: unloadapi

    Returns Promise<string>

    Information about the unloading