diff --git a/skynet/dgpu.py b/skynet/dgpu.py index d40d214..4dd8e07 100644 --- a/skynet/dgpu.py +++ b/skynet/dgpu.py @@ -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( diff --git a/skynet/frontend/telegram.py b/skynet/frontend/telegram.py index 3edb729..bf9d116 100644 --- a/skynet/frontend/telegram.py +++ b/skynet/frontend/telegram.py @@ -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,