Skip to content

Latest commit

Β 

History

History
80 lines (59 loc) Β· 1.81 KB

File metadata and controls

80 lines (59 loc) Β· 1.81 KB

SD WEBUI API Client

API Client for AUTOMATIC1111/stable-diffusion-webui.

Features

  • Easy-to-use API client for Stable Diffusion WebUI
  • Supports authentication
  • Provides methods to interact with the API

Prerequisites

You need to set COMMANDLINE_ARGS=--api on webui-user.sh to enable the API.

See AUTOMATIC1111/stable-diffusion-webui/wiki/API for more information.

Installation

npm install @xct007/sdwebui-api-client

Usage

import { SDWebUIClient } from "@xct007/sdwebui-api-client"

const client = new SDWebUIClient({
   baseURL: "http://localhost:8080",

   // API authentication
   // Optional if --api-auth is set
   username: "admin",
   password: "admin"
})

client.api.memory()
  .then(console.log)
  .catch(console.error)

Project structure

.
β”œβ”€β”€ LICENSE
β”œβ”€β”€ __tests__
β”‚Β Β  β”œβ”€β”€ client.test.ts
β”‚Β Β  └── index.test.ts
β”œβ”€β”€ eslint.config.mjs
β”œβ”€β”€ jest.config.ts
β”œβ”€β”€ jest.setup.ts
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ scripts
β”‚Β Β  └── build.js
β”œβ”€β”€ src
β”‚Β Β  β”œβ”€β”€ client.ts
β”‚Β Β  β”œβ”€β”€ error.ts
β”‚Β Β  β”œβ”€β”€ index.ts
β”‚Β Β  β”œβ”€β”€ sd
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ index.ts
β”‚Β Β  β”‚Β Β  └── types.ts
β”‚Β Β  └── shared.ts
β”œβ”€β”€ tsc-multi.json
β”œβ”€β”€ tsconfig.build.json
└── tsconfig.json

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or inquiries, please contact itsrose.dev@gmail.com.