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.2.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for AsyncKandinsky-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 345f029255e29b333a50619d17c82f78415d530f1f789411a308f5ed2fa1c194 |
|
MD5 | 46795ce49fd3338800d25ea03601b53c |
|
BLAKE2b-256 | 089351a66af752fb89ef5384a45f792017ecdd88f5219f58a1b83cd7e8d63cba |