@zeldafan0225/ai_horde
This package allows you to communicate with the AI Horde API
DISCLAIMER:
THIS PACKAGE/REPOSITORY IS IN NO WAY ASSOCIATED TO THE CREATORS OF AI HORDE
Versions 5.0.0 and later
Version 5.0.0 introduces some breaking changes:
- Node 18.0.0 or higher is required
- The way some things are exported is changed
It also features an internal restructure to reduce complexity and improve performance.
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
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 AIHorde
which includes basically everything you need, when using typescript you can also export types.
The package also exports constant values used in the hordes API request payloads
const { AIHorde } = require("@zeldafan0225/ai_horde");
const ai_horde = new AIHorde({
cache_interval: 1000 * 10,
cache: {
generations_check: 1000 * 30,
},
client_agent: "My-Project:v0.0.1:My-Contact"
});
const generation = await ai_horde.postAsyncImageGenerate({
prompt: "The legend of Zelda",
});
console.log(generation);
const check = await ai_horde.getImageGenerationCheck(generation.id);
console.log(check);
See the auto-generated docs for more info on methods and parameters.