This project has been archived by its maintainers, and is no longer receiving any updates.
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
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| novelai-0.0.1.tar.gz | 10.6 kB | Without provenance | Details for novelai-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| novelai-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for novelai-0.0.1-py3-none-any.whl |
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
|
Security for novelai 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.