From c39f7ea76c551b1890084c6aea3b89b97c10a943 Mon Sep 17 00:00:00 2001 From: Tara Ding <38710454+windtara0619@users.noreply.github.com> Date: Mon, 27 Apr 2026 22:23:42 -0700 Subject: [PATCH] add tqdm to the benchmark --- benchmarks/benchmark_comfyui_serving.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/benchmarks/benchmark_comfyui_serving.py b/benchmarks/benchmark_comfyui_serving.py index 06979cdc5..2e961660c 100644 --- a/benchmarks/benchmark_comfyui_serving.py +++ b/benchmarks/benchmark_comfyui_serving.py @@ -51,6 +51,7 @@ from pathlib import Path from typing import Any import aiohttp +from tqdm import tqdm # ────────────────────────────────────────────────────────────────────────────── @@ -669,7 +670,14 @@ async def async_main(args: argparse.Namespace) -> None: ) for i in range(args.num_requests) ] - results = await asyncio.gather(*tasks) + results = [] + with tqdm(total=args.num_requests, unit="req", desc="benchmark") as pbar: + for coro in asyncio.as_completed(tasks): + result = await coro + results.append(result) + pbar.update(1) + if result.ok: + pbar.set_postfix(succeeded=sum(r.ok for r in results)) wall_s = time.perf_counter() - started print_summary(results, wall_s)