diff --git a/ldm/invoke/generator/base.py b/ldm/invoke/generator/base.py index 14cdf20a0a..1e094717f0 100644 --- a/ldm/invoke/generator/base.py +++ b/ldm/invoke/generator/base.py @@ -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()