civitai-api-wrapper
v1.0.4
Published
An advanced and robust Node.js library that serves as a comprehensive wrapper for seamless integration with the Civitai API. Designed to enhance your development experience, this library offers features such as automatic rate limit handling, request retri
Downloads
4
Maintainers
Readme
Civitai API Wrapper
This is a Node.js wrapper for the Civitai API, allowing you to interact with Civitai's services programmatically from your Node.js applications.
Installation
To use this wrapper in your Node.js project, you can install it via npm or yarn: Installation requires Node.js 10.9.0 or higher.
npm install civitai-api-wrapper
# or
yarn add civitai-api-wrapper
# latest
npm install civitai-api-wrapper@latest
const CivitaiAPI = require('civitai-api-wrapper');
const civitai = new CivitaiAPI();
// Example: Fetch a list of creators
civitai.getCreators()
.then(creators => {
console.log('Creators:', creators);
})
.catch(error => {
console.error('Error:', error.message);
});
Methods
getCreators(options)
Fetch a list of creators.
getImages(options)
Fetch a list of images.
getModels(options)
Fetch a list of models.
getModelById(modelId)
Fetch a model by its ID.
getModelVersionById(modelVersionId)
Fetch a model version by its ID.
getModelVersionByHash(hash)
Fetch a model version by its hash.
getTags(options)
Fetch a list of tags.
Contributing
Contributions Welcome!
If you'd like to contribute to this wrapper or add new features, please follow these steps:
Open an issue to discuss the proposed changes or improvements.
Fork the repository on GitHub.
Create a new branch for your feature or bug fix.
Implement your changes and write tests if applicable.
Ensure that your code follows best practices and is well-documented.
Test your changes thoroughly.
Create a pull request (PR) with a clear description of the changes you've made.
Your PR will be reviewed, and any necessary feedback will be provided.
Once your PR is approved, it will be merged into the main branch.
Thank you for contributing to this project!
Examples
See src/examples/
.