Upscaler fix & frontend model selection naming chanes

add-txt2txt-models
Guillermo Rodriguez 2023-06-05 11:52:16 -03:00
parent bbc5751837
commit aa41c08d2f
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
2 changed files with 5 additions and 2 deletions

View File

@ -144,7 +144,7 @@ class SkynetMM:
if upscaler == 'x4': if upscaler == 'x4':
input_img = image.convert('RGB') input_img = image.convert('RGB')
up_img, _ = upscaler.enhance( up_img, _ = self.upscaler.enhance(
convert_from_image_to_cv2(input_img), outscale=4) convert_from_image_to_cv2(input_img), outscale=4)
image = convert_from_cv2_to_image(up_img) image = convert_from_cv2_to_image(up_img)

View File

@ -32,9 +32,12 @@ def validate_user_config_request(req: str):
match attr: match attr:
case 'algo': case 'algo':
val = params[2] val = params[2]
if val not in ALGOS: shorts = [model_info['short'] for model_info in MODELS.values()]
if val not in shorts:
raise ConfigUnknownAlgorithm(f'no algo named {val}') raise ConfigUnknownAlgorithm(f'no algo named {val}')
val = get_model_by_shortname(val)
case 'step': case 'step':
val = int(params[2]) val = int(params[2])
val = max(min(val, MAX_STEP), MIN_STEP) val = max(min(val, MAX_STEP), MIN_STEP)