novelai-python
The goal of this repository is to use Pydantic to build legitimate requests to access the Novelai API service.
Roadmap 🚧
- /ai/generate-image
- /ai/generate-image/suggest-tags
- /ai/annotate-image
- /ai/classify
- /ai/upscale
- /ai/generate-prompt
- /ai/generate
- /ai/generate-voice
Usage 🖥️
import asyncio
import os
from dotenv import load_dotenv
from pydantic import SecretStr
from novelai_python import GenerateImageInfer, ImageGenerateResp, JwtCredential
load_dotenv()
enhance = "year 2023,dynamic angle, best quality, amazing quality, very aesthetic, absurdres"
async def main():
globe_s = JwtCredential(jwt_token=SecretStr(os.getenv("NOVELAI_JWT")))
_res = await GenerateImageInfer.build(
prompt=f"1girl,{enhance}").generate(
session=globe_s)
_res: ImageGenerateResp
print(_res.meta)
file = _res.files[0]
with open(file[0], "wb") as f:
f.write(file[1])
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Acknowledgements 🙏
Metadata
Release files for novelai-python 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| novelai_python-0.1.3.tar.gz | 24.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| novelai_python-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.0 kB
Release files / novelai_python-0.1.3.tar.gz
| Download URL | novelai_python-0.1.3.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2f5eb5da0e0ab67f6a4cb7fe634472e654d72b487ea3a6b77d4a29a58a37193
|
|
BLAKE2b-256 checksum How to use checksums |
2d1971c1a7410b1fce74eb2e2ff99a25b5da665a9fa627c2bd34c3808e3d860f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.12.2 CPython/3.10.12
|
Release files / novelai_python-0.1.3-py3-none-any.whl
| Download URL | novelai_python-0.1.3-py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a18e36c0db5bb250013ede1b8691dfcd5d087c53d8bd9dba13c8820bbb1667d
|
|
BLAKE2b-256 checksum How to use checksums |
44680193dac47953b54b895a72c9a6faf69a349b1b6989f8b2b06dbcc58c2aac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.12.2 CPython/3.10.12
|