From 6b8bb741525b1d387ad7537d23fcbc27cfbd2df4 Mon Sep 17 00:00:00 2001 From: Jo Kim <1893942+Jokimbe@users.noreply.github.com> Date: Sat, 5 Apr 2025 15:42:46 +0200 Subject: [PATCH] Update nodes.py --- nodes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nodes.py b/nodes.py index c27135c..7987fab 100644 --- a/nodes.py +++ b/nodes.py @@ -91,11 +91,12 @@ def convert_image_for_request(img: torch.Tensor): length = width * height * channels * 2 print(f"Request image is {width}x{height} with {channels} channels") - # print(f"Input size: {len(response_image)} (Expected: {length + 68})") + + data = img.to(torch.float16) # Encode the image as base64 - encoded_string = base64.b64encode(tf.io.serialize_tensor(img)) - # encoded_string = image_to_base64(img) + encoded_string = base64.b64encode(tf.io.serialize_tensor(data)) + # encoded_string = base64.b64encode(data) return encoded_string def get_files(server, port):