Image info, endpoint encryption
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import aiohttp
|
||||
from bot.db import db, DBTables
|
||||
from bot.db import db, DBTables, decrypt
|
||||
from rich import print
|
||||
|
||||
|
||||
async def get_models():
|
||||
endpoint = db[DBTables.config].get('endpoint')
|
||||
endpoint = decrypt(db[DBTables.config].get('endpoint'))
|
||||
try:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
r = await session.get(endpoint + "/sdapi/v1/sd-models")
|
||||
@@ -17,7 +17,7 @@ async def get_models():
|
||||
|
||||
|
||||
async def set_model(model_name: str):
|
||||
endpoint = db[DBTables.config].get('endpoint')
|
||||
endpoint = decrypt(db[DBTables.config].get('endpoint'))
|
||||
try:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
r = await session.post(endpoint + "/sdapi/v1/options", json={
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from bot.db import db, DBTables
|
||||
from bot.db import db, DBTables, decrypt
|
||||
import aiohttp
|
||||
import asyncio
|
||||
import time
|
||||
@@ -18,7 +18,7 @@ async def job_exists(endpoint):
|
||||
|
||||
|
||||
async def wait_for_status(ignore_exceptions: bool = False):
|
||||
endpoint = db[DBTables.config].get('endpoint')
|
||||
endpoint = decrypt(db[DBTables.config].get('endpoint'))
|
||||
try:
|
||||
while await job_exists(endpoint):
|
||||
while db[DBTables.cooldown].get('_last_time_status_checked', 0) + 5 > time.time():
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import aiohttp
|
||||
from bot.db import db, DBTables
|
||||
from bot.db import db, DBTables, decrypt
|
||||
from .objects.prompt_request import Prompt
|
||||
import json
|
||||
import base64
|
||||
|
||||
|
||||
async def txt2img(prompt: Prompt, ignore_exceptions: bool = False) -> list[bytes, dict] | None:
|
||||
endpoint = db[DBTables.config].get('endpoint')
|
||||
endpoint = decrypt(db[DBTables.config].get('endpoint'))
|
||||
try:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
r = await session.post(
|
||||
|
||||
Reference in New Issue
Block a user