parser.add_argument('-o', '--output')
parser.add_argument('-p', '--prompt')
parser.add_argument('-H', '--help', action='help')
- parser.add_argument('-S', '--list-schedulers', action='store_true')
+ parser.add_argument('--list-schedulers', action='store_true')
parser.add_argument('-C', '--copy-params')
parser.add_argument('-P', '--model_path_prefix', default='',
help='useful if -m is set from -C as mere filename')
help='default: 15')
parser.add_argument('-q', '--quantity', default=1, type=int,
help='default: 1')
- parser.add_argument('-r', '--randomness_seed', default=1, type=int,
+ parser.add_argument('-s', '--seed', default=1, type=int,
help='default: 1; if set 0, chosen randomnly')
- parser.add_argument('-s', '--scheduler', default=DEFAULT_SCHEDULER,
+ parser.add_argument('-S', '--scheduler', default=DEFAULT_SCHEDULER,
help=f'default: {DEFAULT_SCHEDULER}')
parsed_args = parser.parse_args()
if parsed_args.copy_params:
for section in parsed_args.copy_params.split('; '):
key, val = section.split(': ', maxsplit=1)
key = key.lower()
- key = 'randomness_seed' if key == 'seed' else key
- if key in {'randomness_seed', 'height', 'width', 'n_steps'}:
+ if key in {'seed', 'height', 'width', 'n_steps'}:
val = int(val)
elif key in {'guidance'}:
val = float(val)
prefix = f'{argv[0]}: error: '
if parsed_args.list_schedulers:
required = {'model': 'm'}
- prefix += 'for -S/--list-schedulers '
+ prefix += 'for --list-schedulers '
else:
required = {'output': 'o', 'prompt': 'p', 'model': 'm'}
- prefix += 'unless calling with -H/--help or -S/--list-schedulers, '
+ prefix += 'unless calling with -H/--help or --list-schedulers, '
prefix += 'requiring '
suffixes = []
for k, v in required.items():
raise Exception(f'Would overwrite file: {path}')
maker = ImageMaker(model_path)
-start_seed = args.randomness_seed
+start_seed = args.seed
start_seed = start_seed if start_seed != 0 else randint(-(2**31-1), 2**31)
for n in range(args.quantity):
nth_seed = start_seed + n