Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

NovelAI Icon NovelAI-API

A lightweight asynchronous Python wrapper for the NovelAI image generation API supporting both web and api backend.

Installation

pip install novelai

Usage

Initialization

import asyncio
from novelai import NAIClient

# Replace string values with your actual account credentials
username = "Your NovelAI username"
password = "Your NovelAI password"

async def main():
    client = NAIClient(username, password, proxy=None)
    await client.init()

asyncio.run(main())

Generate

from pathlib import Path

async def main():
    # Choose host between "api" and "web"
    output = await client.generate_image(prompt="1girl", host="api")

    path = Path("output")
    path.mkdir(parents=True, exist_ok=True)

    for filename, data in output.items():
        Path(path / filename).write_bytes(data)

asyncio.run(main())

References

NovelAI Backend

Aedial/novelai-api

NovelAI Unofficial Knowledgebase

Release files for novelai 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for novelai 0.0.1
File Size Uploaded
novelai-0.0.1.tar.gz 10.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for novelai 0.0.1
File Interpreter ABI Platform
novelai-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / novelai-0.0.1.tar.gz

Download URL novelai-0.0.1.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fe7ce1ebba1bbf66e3c0b60102422de365786d2de6f1831d05dcd0a6cc4f9e37
BLAKE2b-256 checksum
How to use checksums
0348fbdeafb16d81ac54f712dbc93c738dd1364b0c67c2f8a0acf7dece46eba0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / novelai-0.0.1-py3-none-any.whl

Download URL novelai-0.0.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ec28dee6bb86c339c281519465c99e16b49d63b766c37090ca168f91911f688
BLAKE2b-256 checksum
How to use checksums
1abfdae3277b5482752ed6f02383bb8a98779a99a7379dee99392d1351801e22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page