help=f'default: {DEFAULT_SCHEDULER}')
parsed_args = parser.parse_args()
if parsed_args.copy_params:
- for section in parsed_args.copy_params.split('; '):
+ first_split = parsed_args.copy_params.split('; PROMPT: ', maxsplit=1)
+ if 2 == len(first_split):
+ parser.set_defaults(prompt=first_split[1])
+ for section in first_split[0].split('; '):
key, val = section.split(': ', maxsplit=1)
key = key.lower()
if key in {'seed', 'height', 'width', 'n_steps'}:
val = int(val)
elif key in {'guidance'}:
val = float(val)
- setattr(parsed_args, key, val)
+ parser.set_defaults(**{key: val})
+ parsed_args = parser.parse_args()
prefix = f'{argv[0]}: error: '
if parsed_args.list_schedulers:
required = {'model': 'm'}
return self.target not in record.getMessage()
self.model_filename = basename(model_path)
+ if '; ' in self.model_filename:
+ raise Exception('illegal filename (must not contain "; ")')
self.seed = None
self.prompt = None
self.guidance = None