diff options
Diffstat (limited to 'infer.py')
-rw-r--r-- | infer.py | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -295,11 +295,10 @@ def generate(output_dir, pipeline, args): | |||
295 | for j, image in enumerate(images): | 295 | for j, image in enumerate(images): |
296 | image_dir = output_dir | 296 | image_dir = output_dir |
297 | if use_subdirs: | 297 | if use_subdirs: |
298 | idx = j % len(args.prompt) | 298 | image_dir = image_dir.joinpath(slugify(args.prompt[j % len(args.prompt)])[:100]) |
299 | image_dir = image_dir.joinpath(slugify(args.prompt[idx])[:100]) | ||
300 | image_dir.mkdir(parents=True, exist_ok=True) | 299 | image_dir.mkdir(parents=True, exist_ok=True) |
301 | image.save(image_dir.joinpath(f"{seed}_{j}.png")) | 300 | image.save(image_dir.joinpath(f"{seed}_{j // len(args.prompt)}.png")) |
302 | image.save(image_dir.joinpath(f"{seed}_{j}.jpg"), quality=85) | 301 | image.save(image_dir.joinpath(f"{seed}_{j // len(args.prompt)}.jpg"), quality=85) |
303 | 302 | ||
304 | if torch.cuda.is_available(): | 303 | if torch.cuda.is_available(): |
305 | torch.cuda.empty_cache() | 304 | torch.cuda.empty_cache() |