Removed comments & unused packages
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from .nodes import ImageToBase64, Base64ToImage, AudioToBase64, LastFrameToBase64
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"ImageToBase64": ImageToBase64,
|
||||
"Base64ToImage": Base64ToImage,
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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}")
|
||||
Reference in New Issue
Block a user