Compare commits

..
Author SHA1 Message Date
KarrixLee ebc71a7d72 refactor 2025-09-22 18:13:54 +08:00
KarrixLee 9076b4c0ce set to true 2025-09-22 18:08:52 +08:00
KarrixLee e34d1651f7 fix: remove metadata in output node 2025-09-22 18:05:56 +08:00
3 changed files with 13 additions and 22 deletions
+4 -4
View File
@@ -4,7 +4,6 @@ import numpy as np
from PIL import Image from PIL import Image
from PIL.PngImagePlugin import PngInfo from PIL.PngImagePlugin import PngInfo
import folder_paths import folder_paths
from comfy.cli_args import args
class ComfyDeployOutputImage: class ComfyDeployOutputImage:
@@ -34,6 +33,7 @@ class ComfyDeployOutputImage:
"STRING", "STRING",
{"multiline": False, "default": "output_images"}, {"multiline": False, "default": "output_images"},
), ),
"remove_metadata": ("BOOLEAN", {"default": True}),
}, },
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"}, "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
} }
@@ -54,6 +54,7 @@ class ComfyDeployOutputImage:
output_id="output_images", output_id="output_images",
prompt=None, prompt=None,
extra_pnginfo=None, extra_pnginfo=None,
remove_metadata=True,
): ):
filename_prefix += self.prefix_append filename_prefix += self.prefix_append
full_output_folder, filename, counter, subfolder, filename_prefix = ( full_output_folder, filename, counter, subfolder, filename_prefix = (
@@ -65,9 +66,8 @@ class ComfyDeployOutputImage:
for batch_number, image in enumerate(images): for batch_number, image in enumerate(images):
i = 255.0 * image.cpu().numpy() i = 255.0 * image.cpu().numpy()
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8)) img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
metadata = None metadata = PngInfo()
if not args.disable_metadata: if not remove_metadata:
metadata = PngInfo()
if prompt is not None: if prompt is not None:
metadata.add_text("prompt", json.dumps(prompt)) metadata.add_text("prompt", json.dumps(prompt))
if extra_pnginfo is not None: if extra_pnginfo is not None:
+8 -17
View File
@@ -1554,26 +1554,18 @@ async def send_json_override(self, event, data, sid=None):
) )
if event == "executing" and data.get("node") is not None: if event == "executing" and data.get("node") is not None:
raw_node = data.get("node") node = data.get("node")
node = str(raw_node)
if prompt_id in prompt_metadata: if prompt_id in prompt_metadata:
wf_api = prompt_metadata[prompt_id].workflow_api # if 'progress' not in prompt_metadata[prompt_id]:
# prompt_metadata[prompt_id]["progress"] = set()
# Normalize dotted display ids like "23.0.0.1" to base "23"
if node not in wf_api and "." in node:
base = node.split(".")[0]
if base in wf_api:
node = base
# If still unknown, skip safely
if node not in wf_api:
logger.info(f"Skipping unknown node id in 'executing': {raw_node}")
return
prompt_metadata[prompt_id].progress.add(node) prompt_metadata[prompt_id].progress.add(node)
calculated_progress = len(prompt_metadata[prompt_id].progress) / len(wf_api) calculated_progress = len(prompt_metadata[prompt_id].progress) / len(
prompt_metadata[prompt_id].workflow_api
)
calculated_progress = round(calculated_progress, 2) calculated_progress = round(calculated_progress, 2)
# logger.info("calculated_progress", calculated_progress)
if ( if (
prompt_metadata[prompt_id].last_updated_node is not None prompt_metadata[prompt_id].last_updated_node is not None
@@ -1581,8 +1573,7 @@ async def send_json_override(self, event, data, sid=None):
): ):
return return
prompt_metadata[prompt_id].last_updated_node = node prompt_metadata[prompt_id].last_updated_node = node
class_type = prompt_metadata[prompt_id].workflow_api[node]["class_type"]
class_type = wf_api[node]["class_type"]
logger.info(f"At: {round(calculated_progress * 100)}% - {class_type}") logger.info(f"At: {round(calculated_progress * 100)}% - {class_type}")
asyncio.create_task( asyncio.create_task(
send( send(
+1 -1
View File
@@ -1,7 +1,7 @@
[project] [project]
name = "comfyui-deploy" name = "comfyui-deploy"
description = "Open source comfyui deployment platform, a vercel for generative workflow infra." description = "Open source comfyui deployment platform, a vercel for generative workflow infra."
version = "2.3.9" version = "2.3.7"
license = { file = "LICENSE" } license = { file = "LICENSE" }
dependencies = ["aiofiles", "pydantic", "opencv-python", "imageio-ffmpeg", "tabulate", "brotli"] dependencies = ["aiofiles", "pydantic", "opencv-python", "imageio-ffmpeg", "tabulate", "brotli"]