Skip to main content

High-level async API for NovelAI image generation

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

novelai-0.0.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

novelai-0.0.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file novelai-0.0.1.tar.gz.

File metadata

  • Download URL: novelai-0.0.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for novelai-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fe7ce1ebba1bbf66e3c0b60102422de365786d2de6f1831d05dcd0a6cc4f9e37
MD5 557ff9fc60fef4e1832bbd1cc26890e1
BLAKE2b-256 0348fbdeafb16d81ac54f712dbc93c738dd1364b0c67c2f8a0acf7dece46eba0

See more details on using hashes here.

File details

Details for the file novelai-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: novelai-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for novelai-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ec28dee6bb86c339c281519465c99e16b49d63b766c37090ca168f91911f688
MD5 a1aded5fb1b76c3225c7b8807ba45faa
BLAKE2b-256 1abfdae3277b5482752ed6f02383bb8a98779a99a7379dee99392d1351801e22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page