This commit is contained in:
allinoneallinone00
2024-05-02 00:07:20 +00:00
parent 1c8b7a2f6f
commit 7bae8fdac6
8 changed files with 18 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ import logging
import asyncio
from lexica import AsyncClient, Client
def ImageModels():
models = Client().models['models']['image']
dict_models = {}
@@ -12,7 +13,8 @@ def ImageModels():
dict_models[model_name] = model_id
return dict_models
async def ImageGeneration(model,prompt):
async def ImageGeneration(model, prompt):
try:
output = await AsyncClient().generate(model, prompt, "")
if output['code'] != 1:
@@ -40,6 +42,7 @@ async def ImageGeneration(model,prompt):
finally:
await AsyncClient().close()
async def UpscaleImages(image: bytes) -> str:
content = await AsyncClient().upscale(image)
await AsyncClient().close()