Novelai Python Binding With Pydantic
Project description
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 🙏
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
novelai_python-0.1.2.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for novelai_python-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97aaeed47dac98f159bd88786fafd1621a4529ff84f7f19977961cf587e479a0 |
|
MD5 | aaaa3aa4041159474f940d381ce08d0f |
|
BLAKE2b-256 | 5a9d70e80ef023382677bc653b258940cae22e3ead294ed895c133eaf9b241a1 |