Fix telegram frontend bug sending upscaled images based on wrong size

pull/2/head
Guillermo Rodriguez 2022-12-24 11:40:43 -03:00
parent 2b0ed25605
commit 2ccae8d08a
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
2 changed files with 6 additions and 1 deletions

View File

@ -118,6 +118,7 @@ async def open_dgpu_node(
).images[0]
if ireq.upscaler == 'x4':
logging.info(f'size: {len(image.tobytes())}')
logging.info('performing upscale...')
input_img = image.convert('RGB')
up_img, _ = upscaler.enhance(

View File

@ -101,7 +101,11 @@ async def run_skynet_telegram(
else:
logging.info(resp.result['id'])
img_raw = base64.b64decode(bytes.fromhex(resp.result['img']))
img = Image.frombytes('RGB', (512, 512), img_raw)
size = (512, 512)
if resp.result['meta']['upscaler'] == 'x4':
size = (2048, 2048)
img = Image.frombytes('RGB', size, img_raw)
await bot.send_photo(
message.chat.id,