from random import randint
from exiftool import ExifToolHelper # type: ignore
from torch import Generator
-from stable.core import init_pipeline
-
-DEFAULT_MODEL = './v1-5-pruned-emaonly.safetensors'
+from stable.core import init_pipeline, make_metadata
def save_path(count: int) -> str:
return path_join(dir_path, f'{filename_sans_ext}{filename_count}.{ext}')
-def make_metadata(seed, guidance, height, width, model, prompt):
- return f'SEED: {seed}; GUIDANCE: {guidance}; HEIGHT: {height}; ' +\
- f'WIDTH: {width}; MODEL: {model}; PROMPT: {prompt}'
-
-
def parse_args():
parser = ArgumentParser(add_help=False)
- parser.add_argument('-p', '--prompt', required=True)
- parser.add_argument('-o', '--output', required=True)
+ parser.add_argument('-p', '--prompt', type=str, required=True)
+ parser.add_argument('-o', '--output', type=str, required=True)
+ parser.add_argument('-m', '--model', type=str, required=True)
parser.add_argument('-r', '--randomness_seed', default=1, type=int,
help='default: 1; if set 0, chosen randomnly')
parser.add_argument('-g', '--guidance', default=7.5, type=float,
help='default: 7.5')
parser.add_argument('-s', '--steps', default=15, type=int,
help='default: 15')
- parser.add_argument('-m', '--model', default=DEFAULT_MODEL, type=str,
- help=f'default: {DEFAULT_MODEL}')
parser.add_argument('-h', '--height', default=512, type=int,
help='default: 512')
parser.add_argument('-w', '--width', default=512, type=int,