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: 4 additions & 3 deletions comfy_api_nodes/nodes_topaz.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from io import BytesIO

import aiohttp
import torch
from typing_extensions import override

from comfy_api.latest import IO, ComfyExtension, Input
Expand Down Expand Up @@ -138,7 +137,7 @@ def define_schema(cls):
async def execute(
cls,
model: str,
image: torch.Tensor,
image: Input.Image,
prompt: str = "",
subject_detection: str = "All",
face_enhancement: bool = True,
Expand All @@ -153,7 +152,9 @@ async def execute(
) -> IO.NodeOutput:
if get_number_of_images(image) != 1:
raise ValueError("Only one input image is supported.")
download_url = await upload_images_to_comfyapi(cls, image, max_images=1, mime_type="image/png")
download_url = await upload_images_to_comfyapi(
cls, image, max_images=1, mime_type="image/png", total_pixels=4096*4096
)
initial_response = await sync_op(
cls,
ApiEndpoint(path="/proxy/topaz/image/v1/enhance-gen/async", method="POST"),
Expand Down
3 changes: 2 additions & 1 deletion comfy_api_nodes/util/upload_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async def upload_images_to_comfyapi(
mime_type: str | None = None,
wait_label: str | None = "Uploading",
show_batch_index: bool = True,
total_pixels: int = 2048 * 2048,
) -> list[str]:
"""
Uploads images to ComfyUI API and returns download URLs.
Expand All @@ -63,7 +64,7 @@ async def upload_images_to_comfyapi(

for idx in range(num_to_upload):
tensor = image[idx] if is_batch else image
img_io = tensor_to_bytesio(tensor, mime_type=mime_type)
img_io = tensor_to_bytesio(tensor, total_pixels=total_pixels, mime_type=mime_type)

effective_label = wait_label
if wait_label and show_batch_index and num_to_upload > 1:
Expand Down
Loading