avoid further crash under low-memory conditions

This commit is contained in:
Damian Stewart 2022-12-10 20:31:45 +01:00 committed by Lincoln Stein
parent 12a8d7fc14
commit 8cbb50c204

View File

@ -103,7 +103,8 @@ class Generator():
results.append([image, seed])
if image_callback is not None:
image_callback(image, seed, first_seed=first_seed, attention_maps_image=attention_maps_images[-1])
attention_maps_image = None if len(attention_maps_images)==0 else attention_maps_images[-1]
image_callback(image, seed, first_seed=first_seed, attention_maps_image=attention_maps_image)
seed = self.new_seed()