Skip to content

Commit c886af2

Browse files
committed
[feat] added number of bechmark iterations as a configurable param
1 parent cce56fa commit c886af2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cosmos_transfer1/diffusion/inference/transfer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ def parse_arguments() -> argparse.Namespace:
161161
action="store_true",
162162
help="Run the generation in benchmark mode. It means that generation will be rerun a few times and the average generation time will be shown.",
163163
)
164+
parser.add_argument(
165+
"--benchmark_iterations",
166+
type=int,
167+
default=4,
168+
help="Number of iterations to run in benchmark mode, default is 4, only used if benchmark is True",
169+
)
164170
cmd_args = parser.parse_args()
165171

166172
# Load and parse JSON input
@@ -340,7 +346,7 @@ def demo(cfg, control_inputs):
340346
pipeline.region_definitions = region_definitions
341347

342348
# Generate videos in batch
343-
num_repeats = 4 if cfg.benchmark else 1
349+
num_repeats = cfg.benchmark_iterations if cfg.benchmark else 1
344350
time_sum = 0
345351
for i in range(num_repeats):
346352
if cfg.benchmark and i > 0:

0 commit comments

Comments
 (0)