kandinsky-async-api
Асинхронное api для использования Kandinsky 3.1 в своих проектах
Как использовать:
Установка:
pip install AsyncKandinsky
Для инициализации FusionBrainApi можно использовать keys или данные аккаунта:
- api_key и secret_key:
- !!! Ключи создаются во вкладке api (https://fusionbrain.ai/keys/)
- быстрый и простой способ генерации
- не самое лучше качество генерации
- почта и пароль - данные от уже созданного аккаунта:
- !!! Обязательно нужен уже зарегистрированный аккаунт
- в такой версии будет доступна генерация: видео / анимации / больше стилей
- лучшее качество генерации
model = FusionBrainApi(ApiApi("Сюда свой api_key", "Сюда свой secret_key"))
# Любой способ на выбор
model = FusionBrainApi(ApiWeb("Ваша почта", "Ваш пароль"))
Полные примеры можно посмотреть в tests.py (GitHub)
1. text2image
async def generate():
try:
result = await model.text2image("котик", style="ANIME", art_gpt=True)
# новый параметр art_gpt - это инструмент для автоматического улучшения промпта => улучшение качества картинки
except ValueError as e:
print(f"Error:\t{e}")
else:
with open("cat_anime_img.png", "wb") as f:
f.write(result.getvalue())
print("Done!")
2. text2animation
async def generate():
# описания для двух сцен
try:
result = await model.text2animation(["котик бежит по полю", "котик пьёт воду из речки"])
# заготовленных стилей нет
except ValueError as e:
print(f"Error:\t{e}")
else:
with open("cat_anime_animation.mp4", "wb") as f:
f.write(result.getvalue())
print("Done!")
3. text2video
async def generate():
try:
result = await model.text2video("котик бежит по полю")
# заготовленных стилей нет
except ValueError as e:
print(f"Error:\t{e}")
else:
with open("cat_anime_video.mp4", "wb") as f:
f.write(result.getvalue())
print("Done!")
Все стили можно посмотреть в await FusionBrainApi().get_styles():
async def read_styles():
for style in await model.get_styles():
print(style)
Metadata
Release files for AsyncKandinsky 3.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asynckandinsky-3.0.1.tar.gz | 5.9 kB | Without provenance | Details for asynckandinsky-3.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asynckandinsky-3.0.1-py3-none-any.whl | Python 3 | none | any | Details for asynckandinsky-3.0.1-py3-none-any.whl |
Total release size: 12.8 kB
Release files / asynckandinsky-3.0.1.tar.gz
| Download URL | asynckandinsky-3.0.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64cdefcdd560bdac33cedd6df6481209d559aabce6fb6e8e0fb1d96d15ae4857
|
|
BLAKE2b-256 checksum How to use checksums |
33dfad5969a2436e8e234e9145fb2b86712e873e9cd9b34aff726ac483e53fe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.0
|
Release files / asynckandinsky-3.0.1-py3-none-any.whl
| Download URL | asynckandinsky-3.0.1-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61ded8ab15350404f046b6e2f07aca720d51f5df55977f1b3f08a70a8fbb663e
|
|
BLAKE2b-256 checksum How to use checksums |
320878fefa71a19720d1a34a3f302e85548a0dfa0bf708c1e41619f5fc1148d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.0
|
Security for AsyncKandinsky 3.0.1
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.