Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions comfy_api/latest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ class Types:
ComfyAPISync: Type[comfy_api.latest.generated.ComfyAPISyncStub.ComfyAPISyncStub]
ComfyAPISync = create_sync_class(ComfyAPI_latest)

comfy_io = io # create the new alias for io
# create new aliases for io and ui
IO = io
UI = ui

__all__ = [
"ComfyAPI",
Expand All @@ -124,6 +126,7 @@ class Types:
"Types",
"ComfyExtension",
"io",
"comfy_io",
"IO",
"ui",
"UI",
]
14 changes: 14 additions & 0 deletions comfy_api_nodes/apinode_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io
import logging
import mimetypes
import os
from typing import Optional, Union
from comfy.utils import common_upscale
from comfy_api.input_impl import VideoFromFile
Expand Down Expand Up @@ -702,3 +703,16 @@ def image_tensor_pair_to_batch(
"center",
).movedim(1, -1)
return torch.cat((image1, image2), dim=0)


def get_size(path_or_object: Union[str, io.BytesIO]) -> int:
if isinstance(path_or_object, str):
return os.path.getsize(path_or_object)
return len(path_or_object.getvalue())


def validate_container_format_is_mp4(video: VideoInput) -> None:
"""Validates video container format is MP4."""
container_format = video.get_container_format()
if container_format not in ["mp4", "mov,mp4,m4a,3gp,3g2,mj2"]:
raise ValueError(f"Only MP4 container format supported. Got: {container_format}")
2 changes: 1 addition & 1 deletion comfy_api_nodes/apis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ def _display_text_on_node(self, text: str):
if not self.node_id:
return
if self.extracted_price is not None:
text = f"Price: {self.extracted_price}$\n{text}"
text = f"Price: ${self.extracted_price}\n{text}"
PromptServer.instance.send_progress_text(text, self.node_id)

def _display_time_progress_on_node(self, time_completed: int | float):
Expand Down
Loading