From 2878ffd75a6145116f0c3522fe89ea71274922f0 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sat, 3 Aug 2024 11:53:30 -0400 Subject: [PATCH] More aggressive batch splitting. --- comfy/samplers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/samplers.py b/comfy/samplers.py index 3f7633814..ce4371d50 100644 --- a/comfy/samplers.py +++ b/comfy/samplers.py @@ -171,7 +171,7 @@ def calc_cond_batch(model, conds, x_in, timestep, model_options): for i in range(1, len(to_batch_temp) + 1): batch_amount = to_batch_temp[:len(to_batch_temp)//i] input_shape = [len(batch_amount) * first_shape[0]] + list(first_shape)[1:] - if model.memory_required(input_shape) < free_memory: + if model.memory_required(input_shape) * 1.5 < free_memory: to_batch = batch_amount break