novelai
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Welcome to novelai-sdk 👋

npm version License: MIT npm

novelAI SDK for Typescript

🏠 Homepage

Install

npm i novelai
yarn add novelai

Run tests

yarn test

Usage

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 sweatpotato13@gmail.com

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

/novelai/

    Package Sidebar

    Install

    npm i novelai

    Weekly Downloads

    0

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    37.9 kB

    Total Files

    16

    Last publish

    Collaborators

    • sweatpotato