fix fast_params

begin upload
This commit is contained in:
Mikhail Guseletov 2023-07-04 17:40:03 +07:00
parent 0d89767ce8
commit fcd63a75c8

32
bot.py
View File

@ -328,6 +328,7 @@ def getOpt(returnAll = 1) -> InlineKeyboardMarkup:
def getScripts(returnAll = 1) -> InlineKeyboardMarkup: def getScripts(returnAll = 1) -> InlineKeyboardMarkup:
keysArr = [ keysArr = [
InlineKeyboardButton("get_lora", callback_data="get_lora"), InlineKeyboardButton("get_lora", callback_data="get_lora"),
#InlineKeyboardButton("upload", callback_data="upload"),
InlineKeyboardButton("rnd_mdl", callback_data="rnd_mdl"), InlineKeyboardButton("rnd_mdl", callback_data="rnd_mdl"),
InlineKeyboardButton("rnd_smp", callback_data="rnd_smp"), InlineKeyboardButton("rnd_smp", callback_data="rnd_smp"),
InlineKeyboardButton("inf", callback_data="inf"), InlineKeyboardButton("inf", callback_data="inf"),
@ -344,6 +345,14 @@ def getSet(returnAll = 1) -> InlineKeyboardMarkup:
] ]
return (getKeyboard(keysArr, returnAll)) return (getKeyboard(keysArr, returnAll))
# Меню загрузки
def getUpl(returnAll = 1) -> InlineKeyboardMarkup:
keysArr = [
InlineKeyboardButton("uplora", callback_data="uplora"),
InlineKeyboardButton("uplmodel", callback_data="uplmodel"),
]
return (getKeyboard(keysArr, returnAll))
# Меню галочек Да/Нет # Меню галочек Да/Нет
def getYesNo(returnAll = 1, nam = '') -> InlineKeyboardMarkup: def getYesNo(returnAll = 1, nam = '') -> InlineKeyboardMarkup:
keysArr = [ keysArr = [
@ -531,6 +540,26 @@ async def inl_sd(message: Union[types.Message, types.CallbackQuery]) -> None:
"SD запущена\n" + getTxt(), reply_markup=getStart() "SD запущена\n" + getTxt(), reply_markup=getStart()
) )
# Вызов reset_param, сброс JSON
@dp.message_handler(commands=["upload"])
@dp.callback_query_handler(text="upload")
async def inl_upload(message: Union[types.Message, types.CallbackQuery]) -> None:
print("inl_upload")
keyboard = InlineKeyboardMarkup(inline_keyboard=[getUpl(0), getSet(0), getOpt(0), getStart(0)])
await message.answer(
"Грузим LORA или Model?", reply_markup=keyboard
)
# upload Lora
@dp.message_handler(commands=["uplora"])
@dp.callback_query_handler(text="uplora")
async def inl_uplora(message: Union[types.Message, types.CallbackQuery]) -> None:
print("inl_uplora")
keyboard = InlineKeyboardMarkup(inline_keyboard=[getUpl(0), getSet(0), getOpt(0), getStart(0)])
await message.answer(
"Вставьте LORA файлом", reply_markup=keyboard
)
# Вызов reset_param, сброс JSON # Вызов reset_param, сброс JSON
@dp.message_handler(commands=["reset_param"]) @dp.message_handler(commands=["reset_param"])
@dp.callback_query_handler(text="reset_param") @dp.callback_query_handler(text="reset_param")
@ -569,7 +598,8 @@ async def inl_fast_param(message: Union[types.Message, types.CallbackQuery]) ->
dataParams = {"img_thumb": "true", dataParams = {"img_thumb": "true",
"img_tg": "false", "img_tg": "false",
"img_real": "true", "img_real": "true",
"stop_sd": "true"} "stop_sd": "true",
"use_prompt": "true"}
keyboard = InlineKeyboardMarkup(inline_keyboard=[getSet(0), getOpt(0), getStart(0)]) keyboard = InlineKeyboardMarkup(inline_keyboard=[getSet(0), getOpt(0), getStart(0)])
txt = f"JSON сброшен\n{getJson()}\n{getJson(1)}" txt = f"JSON сброшен\n{getJson()}\n{getJson(1)}"
await getKeyboardUnion(txt, message, keyboard, '') await getKeyboardUnion(txt, message, keyboard, '')