From e5c2f0bbfe654f1a311c2dcbba2765fd3c950daa Mon Sep 17 00:00:00 2001 From: Thomas Dewitte Date: Thu, 23 Apr 2026 15:35:32 +0200 Subject: [PATCH] Removed comments & unused packages --- __init__.py | 1 - nodes.py | 2 -- utils.py | 22 +--------------------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/__init__.py b/__init__.py index 6fef7a0..ce2a581 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,5 @@ from .nodes import ImageToBase64, Base64ToImage, AudioToBase64, LastFrameToBase64 - NODE_CLASS_MAPPINGS = { "ImageToBase64": ImageToBase64, "Base64ToImage": Base64ToImage, diff --git a/nodes.py b/nodes.py index cc65d18..cba694a 100644 --- a/nodes.py +++ b/nodes.py @@ -1,5 +1,3 @@ -from base64 import b64decode - from .utils import convert_base64_to_image, convert_image_to_base64, convert_base64_to_audio class Base64ToImage: diff --git a/utils.py b/utils.py index 620281c..d961439 100644 --- a/utils.py +++ b/utils.py @@ -96,24 +96,4 @@ def convert_base64_to_audio(base64_str: str, start_time=0, duration=0): except subprocess.CalledProcessError as e: raise RuntimeError(f"FFmpeg failed:\n{e.stderr.decode(*ENCODE_ARGS)}") except Exception as e: - raise RuntimeError(f"Failed to decode audio: {e}") - -# def convert_tensor_to_base(image_tensor: torch.Tensor) -> str: -# """ -# Encodes a PyTorch image tensor into a Base64 string. -# """ -# try: -# # (H, W, C) => (C, H, W) -# if image_tensor.ndim == 3 and image_tensor.shape[0] > 4: -# image_tensor = image_tensor.permute(2, 0, 1) - -# # Normalize pixel values (0.0, 1.0) -# image_tensor = torch.clamp(image_tensor, 0.0, 1.0) -# image = transforms.ToPILImage()(image_tensor) - -# buffer = BytesIO() -# image.save(buffer, format="PNG") - -# return b64encode(buffer.getvalue()) -# except Exception as e: -# raise RuntimeError(f"Failed to decode image tensor: {e}") \ No newline at end of file + raise RuntimeError(f"Failed to decode audio: {e}") \ No newline at end of file