diff options
| author | Volpeon <git@volpeon.ink> | 2023-01-04 22:06:05 +0100 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2023-01-04 22:06:05 +0100 |
| commit | a5e45e2c0dab95589e5fbaa4fe87d18484fbbe68 (patch) | |
| tree | 8bd97a745e1113b1035c504ec484e099f878aed0 /infer.py | |
| parent | Various updates (diff) | |
| download | textual-inversion-diff-a5e45e2c0dab95589e5fbaa4fe87d18484fbbe68.tar.gz textual-inversion-diff-a5e45e2c0dab95589e5fbaa4fe87d18484fbbe68.tar.bz2 textual-inversion-diff-a5e45e2c0dab95589e5fbaa4fe87d18484fbbe68.zip | |
Update
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() |
