Skip to main content

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


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)

Uploaded Source

Built Distribution

AsyncKandinsky-0.0.2-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page