mirror of https://github.com/skygpu/skynet.git
Fix telegram frontend bug sending upscaled images based on wrong size
parent
2b0ed25605
commit
2ccae8d08a
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue