Removed comments & unused packages

This commit is contained in:
Thomas Dewitte
2026-04-23 15:35:32 +02:00
parent d4361f5907
commit e5c2f0bbfe
3 changed files with 1 additions and 24 deletions
-1
View File
@@ -1,6 +1,5 @@
from .nodes import ImageToBase64, Base64ToImage, AudioToBase64, LastFrameToBase64
NODE_CLASS_MAPPINGS = {
"ImageToBase64": ImageToBase64,
"Base64ToImage": Base64ToImage,
-2
View File
@@ -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:
+1 -21
View File
@@ -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}")
raise RuntimeError(f"Failed to decode audio: {e}")