Skip to content

Commit e918cb1

Browse files
committed
replace list delimiters in variations syntax
1 parent 423d257 commit e918cb1

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

VARIATIONS.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ variation.
4848
dream> "prompt" -n6 -S3357757885 -v0.2
4949
...
5050
Outputs:
51-
./outputs/Xena/000002.784039624.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 784039624,0.2 -S3357757885
52-
./outputs/Xena/000002.3647897225.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.2 -S3357757885
53-
./outputs/Xena/000002.917731034.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 917731034,0.2 -S3357757885
54-
./outputs/Xena/000002.4116285959.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 4116285959,0.2 -S3357757885
55-
./outputs/Xena/000002.1614299449.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 1614299449,0.2 -S3357757885
56-
./outputs/Xena/000002.1335553075.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 1335553075,0.2 -S3357757885
51+
./outputs/Xena/000002.784039624.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 784039624:0.2 -S3357757885
52+
./outputs/Xena/000002.3647897225.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.2 -S3357757885
53+
./outputs/Xena/000002.917731034.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 917731034:0.2 -S3357757885
54+
./outputs/Xena/000002.4116285959.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 4116285959:0.2 -S3357757885
55+
./outputs/Xena/000002.1614299449.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 1614299449:0.2 -S3357757885
56+
./outputs/Xena/000002.1335553075.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 1335553075:0.2 -S3357757885
5757
~~~
5858

5959
Note that the output for each image has a -V option giving the
@@ -78,7 +78,7 @@ this to work.
7878
~~~
7979
dream> "prompt" -S3357757885 -V3647897225,0.1;1614299449,0.1
8080
Outputs:
81-
./outputs/Xena/000003.1614299449.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1 -S3357757885
81+
./outputs/Xena/000003.1614299449.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1 -S3357757885
8282
~~~
8383

8484
Here we are providing equal weights (0.1 and 0.1) for both the
@@ -95,12 +95,12 @@ strength) options. Note that we use -n6 to generate 6 variations:
9595
~~~~
9696
dream> "prompt" -S3357757885 -V3647897225,0.1;1614299449,0.1 -v0.05 -n6
9797
Outputs:
98-
./outputs/Xena/000004.3279757577.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;3279757577,0.05 -S3357757885
99-
./outputs/Xena/000004.2853129515.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;2853129515,0.05 -S3357757885
100-
./outputs/Xena/000004.3747154981.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;3747154981,0.05 -S3357757885
101-
./outputs/Xena/000004.2664260391.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;2664260391,0.05 -S3357757885
102-
./outputs/Xena/000004.1642517170.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;1642517170,0.05 -S3357757885
103-
./outputs/Xena/000004.2183375608.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;2183375608,0.05 -S3357757885
98+
./outputs/Xena/000004.3279757577.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,3279757577:0.05 -S3357757885
99+
./outputs/Xena/000004.2853129515.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,2853129515:0.05 -S3357757885
100+
./outputs/Xena/000004.3747154981.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,3747154981:0.05 -S3357757885
101+
./outputs/Xena/000004.2664260391.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,2664260391:0.05 -S3357757885
102+
./outputs/Xena/000004.1642517170.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,1642517170:0.05 -S3357757885
103+
./outputs/Xena/000004.2183375608.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,2183375608:0.05 -S3357757885
104104
~~~~
105105

106106
This produces six images, all slight variations on the combination of

ldm/dream/pngwriter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def normalize_prompt(self):
7272
if opt.variation_amount > 0:
7373
switches.append(f'-v {opt.variation_amount}')
7474
if opt.with_variations:
75-
formatted_variations = ';'.join(f'{seed},{weight}' for seed, weight in opt.with_variations)
75+
formatted_variations = ','.join(f'{seed}:{weight}' for seed, weight in opt.with_variations)
7676
switches.append(f'-V {formatted_variations}')
7777
if t2i.full_precision:
7878
switches.append('-F')

scripts/dream.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ def main_loop(t2i, outdir, prompt_as_dir, parser, infile):
187187
# shotgun parsing, woo
188188
parts = []
189189
broken = False # python doesn't have labeled loops...
190-
for part in opt.with_variations.split(';'):
191-
seed_and_weight = part.split(',')
190+
for part in opt.with_variations.split(','):
191+
seed_and_weight = part.split(':')
192192
if len(seed_and_weight) != 2:
193193
print(f'could not parse with_variation part "{part}"')
194194
broken = True
@@ -598,7 +598,7 @@ def create_cmd_parser():
598598
'--with_variations',
599599
default=None,
600600
type=str,
601-
help='list of variations to apply, in the format `seed,weight;seed,weight;...'
601+
help='list of variations to apply, in the format `seed:weight,seed:weight,...'
602602
)
603603
return parser
604604

0 commit comments

Comments
 (0)