Giter Club home page Giter Club logo

stable_horde's Introduction

@zeldafan0225/stable_horde

This package allows you to communicate with the Stable Horde API

DISCLAIMER: THIS PACKAGE/REPOSITORY IS IN NO WAY ASSOCIATED TO THE CREATORS OF STABLE HORDE

You can support me and my projects on Ko-Fi

Bugs

To report bugs please open an issue on GitHub.

Features

  • Configurable Caching
  • Methods for all endpoints on the API V2
  • Default Token
  • Types with comments and explanations (TS)

Features that are currently missing

  • Ratelimit bucket

Contribute

I am always happy about contributions. You can contribute by forking this repository, updating or adding and then creating a pull request. You can contribute by adding new features, optimizing the currently existing code, adding examples or anything else I missed.

How to use

The package exports the class StableHorde which includes basically everything you need.

const StableHorde = require("@zeldafan0225/stable_horde");

/*
Create new instance of the stable_horde class to communicate with the rest API
You can configure which cache should contain the data for what time
You can also configure at what interval the cache is checking if there are any data that should be deleted

The class also takes a default token. This is helpful if you want to use this package only using your own token.
The token is not a required argument in any method.

A default API route is also in the contrictor for changing where the requests are directed to (e.g. when using a subdomain like https://test.stablehorde.net)
*/
const stable_horde = new StableHorde({
  cache_interval: 1000 * 10,
  cache: {
    generations_check: 1000 * 30,
  },
  client_agent: "My-Project:v0.0.1:My-Contact"
});

// start the generation of an image with the given payload
const generation = await stable_horde.postAsyncGenerate({
  prompt: "The legend of Zelda",
});
console.log(generation);

// check the status of your generation using the generations id
const check = await stable_horde.getGenerationCheck(generation.id);
console.log(check);

See the auto-generated docs for more info on methods and parameters.

stable_horde's People

Contributors

db0 avatar mrloldev avatar sliterok avatar zeldafan0225 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.