https://github.com/sweatpotato13/novelai-sdk
novelAI SDK for Typescript
https://github.com/sweatpotato13/novelai-sdk
novelai npm
Last synced: 3 months ago
JSON representation
novelAI SDK for Typescript
- Host: GitHub
- URL: https://github.com/sweatpotato13/novelai-sdk
- Owner: sweatpotato13
- License: mit
- Created: 2022-10-13T01:23:19.000Z (about 3 years ago)
- Default Branch: develop
- Last Pushed: 2023-07-19T23:56:51.000Z (over 2 years ago)
- Last Synced: 2025-07-15T18:17:04.564Z (4 months ago)
- Topics: novelai, npm
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/novelai
- Size: 42.6 MB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Welcome to novelai-sdk 👋
[](https://badge.fury.io/js/novelai) [](https://opensource.org/licenses/MIT) 
> novelAI SDK for Typescript
### 🏠 [Homepage](https://github.com/sweatpotato13/novelai-sdk)
## Install
```sh
npm i novelai
yarn add novelai
```
## Run tests
```sh
yarn test
```
## Usage
```ts
import fs from "fs";
import { NovelAi } from "novelai";
async function main() {
const novelAi = new NovelAi();
const accessToken = await (
await novelAi.login("email", "password")
).accessToken;
const data = await novelAi.generateImage(accessToken, {
input: "masterpiece",
model: "safe",
resolution: "landscape",
sampling: "k_euler_ancestral",
seed: 1,
});
const buffer = Buffer.from(data.imageBase64, "base64");
fs.writeFileSync("new-path.jpg", buffer);
console.log("done");
}
main();
```
## Author
👤 **CuteWisp **
- Website: Cutewisp.com
- Github: [@sweatpotato13](https://github.com/sweatpotato13)
## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/sweatpotato13/novelai-sdk/issues).
## Show your support
Give a ⭐️ if this project helped you!