From 92a04bd7afc0b9d7bfb86ddb90d0b77641df53d4 Mon Sep 17 00:00:00 2001 From: Rob Ballantyne Date: Thu, 23 Oct 2025 13:41:03 +0100 Subject: [PATCH 1/3] No silent fail if benchmark file is missing --- workers/comfyui-json/data_types.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workers/comfyui-json/data_types.py b/workers/comfyui-json/data_types.py index d4cb7c6..578a48b 100644 --- a/workers/comfyui-json/data_types.py +++ b/workers/comfyui-json/data_types.py @@ -7,9 +7,12 @@ from functools import cache from math import ceil from pathlib import Path import json +import logging from lib.data_types import ApiPayload, JsonDataException +log = logging.getLogger(__file__) + def count_workload() -> float: # Always 100.0 where there is a single instance of ComfyUI handling requests # Results will indicate % or a job completed per second. Avoids sub 0.1 sec performance indication @@ -40,8 +43,7 @@ class ComfyWorkflowData(ApiPayload): } ) except (json.JSONDecodeError, IOError): - # JSON is malformed or file can't be read, fall through to default - pass + log.info(f"{benchmark_file} not found. Using fallback method") # Fallback: read prompts and construct payload with open("workers/comfyui-json/misc/test_prompts.txt", "r") as f: From d51a338e8ff4af09e63ef6f617d5867855b52498 Mon Sep 17 00:00:00 2001 From: Rob Ballantyne Date: Thu, 23 Oct 2025 16:41:02 +0100 Subject: [PATCH 2/3] log when benchmark file not used --- workers/comfyui-json/data_types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workers/comfyui-json/data_types.py b/workers/comfyui-json/data_types.py index 578a48b..6d46f43 100644 --- a/workers/comfyui-json/data_types.py +++ b/workers/comfyui-json/data_types.py @@ -43,9 +43,10 @@ class ComfyWorkflowData(ApiPayload): } ) except (json.JSONDecodeError, IOError): - log.info(f"{benchmark_file} not found. Using fallback method") + log.error(f"Failed to benchmark using {benchmark_file}") # Fallback: read prompts and construct payload + log.info("Using fallback method for benchmarking") with open("workers/comfyui-json/misc/test_prompts.txt", "r") as f: test_prompts = f.readlines() From f4f7080df1f9e798b8ce7a2c43065cb745e70b05 Mon Sep 17 00:00:00 2001 From: Rob Ballantyne Date: Thu, 23 Oct 2025 17:00:28 +0100 Subject: [PATCH 3/3] Re-add comment --- workers/comfyui-json/data_types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/workers/comfyui-json/data_types.py b/workers/comfyui-json/data_types.py index 6d46f43..1af1f8b 100644 --- a/workers/comfyui-json/data_types.py +++ b/workers/comfyui-json/data_types.py @@ -43,6 +43,7 @@ class ComfyWorkflowData(ApiPayload): } ) except (json.JSONDecodeError, IOError): + # JSON is malformed or file can't be read, fall through to default log.error(f"Failed to benchmark using {benchmark_file}") # Fallback: read prompts and construct payload