Files
TeleDiffusionBot/bot/modules/api/samplers.py
2023-02-26 22:16:05 +02:00

12 lines
357 B
Python

import aiohttp
from bot.db import db, DBTables, decrypt
async def get_samplers():
endpoint = decrypt(db[DBTables.config].get('endpoint'))
async with aiohttp.ClientSession() as session:
r = await session.get(endpoint + "/sdapi/v1/samplers")
if r.status != 200:
return None
return [x["name"] for x in await r.json()]