Clear the torch cache between sequential image generations

This commit is contained in:
oobabooga 2025-12-07 11:49:22 -08:00
parent 3b8369a679
commit 1ec9f708e5

View file

@ -848,6 +848,9 @@ def generate(state, save_images=True):
if shared.stop_everything:
break
if batch_idx > 0:
clear_torch_cache()
generator.manual_seed(int(seed + batch_idx))
# Generate prompt variation if enabled