This module is designed for asynchronous use of the kandinsky neural network and easy integration into your project.
Project description
kandinsky-api-requests
Асионхронное api для использования нейросети kandinsky 3.0
ВНИМАНИЕ: После изменнеия структуры сайта, сделана работа только для api версии. Планируется "взломать" использование web версии программно.
Как использовать:
полный пример можно посмотреть в tests.py
1. text2image
model = FusionBrainApi()
async def generate():
result = await model.text2image("котик", style="ANIME")
if result["error"]:
print("Error:")
print(result["data"])
else:
img = Image.open(result["data"])
img.save('cat_anime.jpg')
print("Done!")
if __name__ == '__main__':
asyncio.run(generate())
Все стили можно посмотреть в await FusionBrainApi().get_styles()
:
async def read_styles():
for style in await model.get_styles():
print(style, end="\n\n")
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
AsyncKandinsky-0.0.3.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for AsyncKandinsky-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58e5d762232bf02befe867342c16fa623ec5bc6adbe0fe355fe9e72d31dc98a7 |
|
MD5 | e90684566de16ea54a6e63efbf79109e |
|
BLAKE2b-256 | 8cf168722f732390fd0a9c6970fb0e1ac1c7a1213d9c138e279fd49ac0735b62 |