Skip to content

Commit

Permalink
fix for #92
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgoringe committed Mar 29, 2024
1 parent edd642f commit 50764b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions image_chooser_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ def func(self, id, **kwargs):
# convert list to batch
images_in = torch.cat(kwargs.pop('images'))
latents_in = kwargs.pop('latents', None)
masks_in = torch.cat(kwargs.pop('masks')) if kwargs.get('masks', None) is not None else None
masks_in = torch.cat(kwargs.get('masks')) if kwargs.get('masks', None) is not None else None
kwargs.pop('masks', None)
latent_samples_in = torch.cat(list(l['samples'] for l in latents_in)) if latents_in is not None else None
self.batch = images_in.shape[0]

# any other parameters shouldn't be lists any more...
for x in kwargs: kwargs[x] = kwargs[x][0]
for x in kwargs: kwargs[x] = kwargs[x][0] if kwargs[x] is not None else None

# call PreviewImage base
ret = self.save_images(images=images_in, **kwargs)
Expand Down

0 comments on commit 50764b0

Please sign in to comment.