mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Merge branch 'bakkot-variant-commas' into development
Change the image variation weighting syntax to match the prompt weighting syntax
This commit is contained in:
commit
cc4f33bf3a
@ -48,12 +48,12 @@ variation.
|
|||||||
dream> "prompt" -n6 -S3357757885 -v0.2
|
dream> "prompt" -n6 -S3357757885 -v0.2
|
||||||
...
|
...
|
||||||
Outputs:
|
Outputs:
|
||||||
./outputs/Xena/000002.784039624.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 784039624,0.2 -S3357757885
|
./outputs/Xena/000002.784039624.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 784039624:0.2 -S3357757885
|
||||||
./outputs/Xena/000002.3647897225.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.2 -S3357757885
|
./outputs/Xena/000002.3647897225.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.2 -S3357757885
|
||||||
./outputs/Xena/000002.917731034.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 917731034,0.2 -S3357757885
|
./outputs/Xena/000002.917731034.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 917731034:0.2 -S3357757885
|
||||||
./outputs/Xena/000002.4116285959.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 4116285959,0.2 -S3357757885
|
./outputs/Xena/000002.4116285959.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 4116285959:0.2 -S3357757885
|
||||||
./outputs/Xena/000002.1614299449.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 1614299449,0.2 -S3357757885
|
./outputs/Xena/000002.1614299449.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 1614299449:0.2 -S3357757885
|
||||||
./outputs/Xena/000002.1335553075.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 1335553075,0.2 -S3357757885
|
./outputs/Xena/000002.1335553075.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 1335553075:0.2 -S3357757885
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
Note that the output for each image has a -V option giving the
|
Note that the output for each image has a -V option giving the
|
||||||
@ -78,7 +78,7 @@ this to work.
|
|||||||
~~~
|
~~~
|
||||||
dream> "prompt" -S3357757885 -V3647897225,0.1;1614299449,0.1
|
dream> "prompt" -S3357757885 -V3647897225,0.1;1614299449,0.1
|
||||||
Outputs:
|
Outputs:
|
||||||
./outputs/Xena/000003.1614299449.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1 -S3357757885
|
./outputs/Xena/000003.1614299449.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1 -S3357757885
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
Here we are providing equal weights (0.1 and 0.1) for both the
|
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:
|
|||||||
~~~~
|
~~~~
|
||||||
dream> "prompt" -S3357757885 -V3647897225,0.1;1614299449,0.1 -v0.05 -n6
|
dream> "prompt" -S3357757885 -V3647897225,0.1;1614299449,0.1 -v0.05 -n6
|
||||||
Outputs:
|
Outputs:
|
||||||
./outputs/Xena/000004.3279757577.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;3279757577,0.05 -S3357757885
|
./outputs/Xena/000004.3279757577.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,3279757577:0.05 -S3357757885
|
||||||
./outputs/Xena/000004.2853129515.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;2853129515,0.05 -S3357757885
|
./outputs/Xena/000004.2853129515.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,2853129515:0.05 -S3357757885
|
||||||
./outputs/Xena/000004.3747154981.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;3747154981,0.05 -S3357757885
|
./outputs/Xena/000004.3747154981.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,3747154981:0.05 -S3357757885
|
||||||
./outputs/Xena/000004.2664260391.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;2664260391,0.05 -S3357757885
|
./outputs/Xena/000004.2664260391.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,2664260391:0.05 -S3357757885
|
||||||
./outputs/Xena/000004.1642517170.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;1642517170,0.05 -S3357757885
|
./outputs/Xena/000004.1642517170.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,1642517170:0.05 -S3357757885
|
||||||
./outputs/Xena/000004.2183375608.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225,0.1;1614299449,0.1;2183375608,0.05 -S3357757885
|
./outputs/Xena/000004.2183375608.png: "prompt" -s50 -W512 -H512 -C7.5 -Ak_lms -V 3647897225:0.1,1614299449:0.1,2183375608:0.05 -S3357757885
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
This produces six images, all slight variations on the combination of
|
This produces six images, all slight variations on the combination of
|
||||||
|
@ -72,7 +72,7 @@ class PromptFormatter:
|
|||||||
if opt.variation_amount > 0:
|
if opt.variation_amount > 0:
|
||||||
switches.append(f'-v{opt.variation_amount}')
|
switches.append(f'-v{opt.variation_amount}')
|
||||||
if opt.with_variations:
|
if opt.with_variations:
|
||||||
formatted_variations = ';'.join(f'{seed},{weight}' for seed, weight in opt.with_variations)
|
formatted_variations = ','.join(f'{seed}:{weight}' for seed, weight in opt.with_variations)
|
||||||
switches.append(f'-V{formatted_variations}')
|
switches.append(f'-V{formatted_variations}')
|
||||||
if t2i.full_precision:
|
if t2i.full_precision:
|
||||||
switches.append('-F')
|
switches.append('-F')
|
||||||
|
@ -187,8 +187,8 @@ def main_loop(t2i, outdir, prompt_as_dir, parser, infile):
|
|||||||
# shotgun parsing, woo
|
# shotgun parsing, woo
|
||||||
parts = []
|
parts = []
|
||||||
broken = False # python doesn't have labeled loops...
|
broken = False # python doesn't have labeled loops...
|
||||||
for part in opt.with_variations.split(';'):
|
for part in opt.with_variations.split(','):
|
||||||
seed_and_weight = part.split(',')
|
seed_and_weight = part.split(':')
|
||||||
if len(seed_and_weight) != 2:
|
if len(seed_and_weight) != 2:
|
||||||
print(f'could not parse with_variation part "{part}"')
|
print(f'could not parse with_variation part "{part}"')
|
||||||
broken = True
|
broken = True
|
||||||
@ -598,7 +598,7 @@ def create_cmd_parser():
|
|||||||
'--with_variations',
|
'--with_variations',
|
||||||
default=None,
|
default=None,
|
||||||
type=str,
|
type=str,
|
||||||
help='list of variations to apply, in the format `seed,weight;seed,weight;...'
|
help='list of variations to apply, in the format `seed:weight,seed:weight,...'
|
||||||
)
|
)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user