Catalog PyPI
PACKAGE EXPLORERView in registry

aihorde

PyPI

Python client for AI Horde API

Versions collected1
Direct dependencies2From release 0.3
Last observed21 Oct, 10:55 UTC

README

Version 0.3 documentation

Async Python client library for AI Horde

Installation:

Warning: supports only Python 3.11 or later

python3.11 -m pip install aihorde

Usage examples

Image generation

import asyncio
from aihorde.client import AIHordeClient
from aihorde import models

API_KEY = '0000000000' # Your API key from aihorde.net/register. You can also use 0000000000.

async def image():
    q = input('Введите запрос: ')
    client = AIHordeClient(API_KEY)
    generation_input = models.GenerationInputStable(
        q,
        models=['Anything v5', 'Anything v3', 'MeinaMix', 'Cetus-Mix', 'Anything Diffusion',
                'AAM XL', 'AlbedoBase XL (SDXL)', 'Animagine XL', 'Anime Illust Diffusion', 'DreamShaper XL',
                'ICBINP XL', 'Juggernaut XL', 'Quiet Goodnight XL', 'Unstable Diffusers XL']
    )
    generations: list[models.GenerationStable] = (await client.generate_image(generation_input)).generations
    for generation in generations:
        print(f'{generation.model}: {generation.img}')

asyncio.run(image())

Text generation

import asyncio
from aihorde.client import AIHordeClient
from aihorde import models

API_KEY = '0000000000' # Your API key from aihorde.net/register. You can also use 0000000000.

async def text():
    q = input('Введите запрос: ')
    client = AIHordeClient(API_KEY)
    params = models.ModelGenerationInputKobold(
        stop_sequence=['Human:'],
        max_length=160
    )
    generation_input = models.GenerationInputKobold(
        f' Human: {q}/n AI:',
        params=params,
        models=['koboldcpp/Kunoichi-DPO-v2-7B-Q8_0-imatrix'] # i dont know which models are good for text :D
    )
    results: list[models.GenerationKobold] = (await client.generate_text(generation_input)).generations
    for result in results:
        print(result.text.strip())

asyncio.run(text())

Get active models list

import asyncio
from aihorde.client import AIHordeClient
from aihorde import models

API_KEY = '0000000000' # Your API key from aihorde.net/register. You can also use 0000000000.

async def models():
    client = AIHordeClient(API_KEY)
    active_models: list[models.ActiveModel] = await client.get_models(type='image') # or 'text'
    print(repr(active_models))

asyncio.run(models())

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.325 May 20242

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
lapismyt/pyaihorde

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:55 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:fa4df6ee3a23f9caf20f497c3bbc1c8d853e115268535af9b5c09b03745e61c6