Skip to main content

novelai-python

PyPI version Downloads

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 🙏

BackEnd novelai-api

Metadata

Release files for novelai-python 0.1.4

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-python 0.1.4
File Size Uploaded Provenance Actions
novelai_python-0.1.4.tar.gz 24.5 kB Without provenance Details for novelai_python-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 53.0 kB

Release files / novelai_python-0.1.4.tar.gz

Download URL novelai_python-0.1.4.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f8f4b1824b35630aa3042a4212ee93de9663a21fca563aa506ca3eef9867c975
BLAKE2b-256 checksum
How to use checksums
b06219d16d4d9c0deb58b1deff3a19f149a0240220bf3ef9db9b8792f1521a7c
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.4-py3-none-any.whl

Download URL novelai_python-0.1.4-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b84e99deb03a8c57525e1e22c4d6975bb668c3ecd127efce93e0ba289ffc75e
BLAKE2b-256 checksum
How to use checksums
fcda02b63791b376f7e7d5ac608457293f0e06f27b15212b6991520e8886500e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.12.2 CPython/3.10.12

Security for novelai-python 0.1.4

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.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files No provenance

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