From 682d74754cac4925b369f5c778b1ee2772ec213a Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 19 Sep 2022 11:53:47 +1000 Subject: [PATCH] Fixes metadata_loads() #686 --- ldm/dream/args.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ldm/dream/args.py b/ldm/dream/args.py index 7d8f473b4a..db6d963645 100644 --- a/ldm/dream/args.py +++ b/ldm/dream/args.py @@ -681,7 +681,10 @@ def metadata_loads(metadata): ''' results = [] try: - images = metadata['sd-metadata']['images'] + if 'grid' in metadata['sd-metadata']: + images = metadata['sd-metadata']['images'] + else: + images = [metadata['sd-metadata']['image']] for image in images: # repack the prompt and variations image['prompt'] = ','.join([':'.join([x['prompt'], str(x['weight'])]) for x in image['prompt']])