diff options
author | Volpeon <git@volpeon.ink> | 2022-12-26 14:24:21 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2022-12-26 14:24:21 +0100 |
commit | e0b686b475885f0c8480f7173eaa7359adf17e27 (patch) | |
tree | 6ad882f152e63801d31230466e4d6468e7ada697 /infer.py | |
parent | Code simplifications, avoid autocast (diff) | |
download | textual-inversion-diff-e0b686b475885f0c8480f7173eaa7359adf17e27.tar.gz textual-inversion-diff-e0b686b475885f0c8480f7173eaa7359adf17e27.tar.bz2 textual-inversion-diff-e0b686b475885f0c8480f7173eaa7359adf17e27.zip |
Set default dimensions to 768; add config inheritance
Diffstat (limited to 'infer.py')
-rw-r--r-- | infer.py | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -24,7 +24,7 @@ from transformers import CLIPTextModel, CLIPTokenizer | |||
24 | from slugify import slugify | 24 | from slugify import slugify |
25 | 25 | ||
26 | from pipelines.stable_diffusion.vlpn_stable_diffusion import VlpnStableDiffusion | 26 | from pipelines.stable_diffusion.vlpn_stable_diffusion import VlpnStableDiffusion |
27 | from common import load_text_embeddings | 27 | from common import load_text_embeddings, load_config |
28 | 28 | ||
29 | 29 | ||
30 | torch.backends.cuda.matmul.allow_tf32 = True | 30 | torch.backends.cuda.matmul.allow_tf32 = True |
@@ -46,8 +46,8 @@ default_cmds = { | |||
46 | "negative_prompt": None, | 46 | "negative_prompt": None, |
47 | "image": None, | 47 | "image": None, |
48 | "image_noise": .7, | 48 | "image_noise": .7, |
49 | "width": 512, | 49 | "width": 768, |
50 | "height": 512, | 50 | "height": 768, |
51 | "batch_size": 1, | 51 | "batch_size": 1, |
52 | "batch_num": 1, | 52 | "batch_num": 1, |
53 | "steps": 30, | 53 | "steps": 30, |
@@ -163,9 +163,8 @@ def run_parser(parser, defaults, input=None): | |||
163 | conf_args = argparse.Namespace() | 163 | conf_args = argparse.Namespace() |
164 | 164 | ||
165 | if args.config is not None: | 165 | if args.config is not None: |
166 | with open(args.config, 'rt') as f: | 166 | args = load_config(args.config) |
167 | conf_args = parser.parse_known_args( | 167 | args = parser.parse_args(namespace=argparse.Namespace(**args)) |
168 | namespace=argparse.Namespace(**json.load(f)["args"]))[0] | ||
169 | 168 | ||
170 | res = defaults.copy() | 169 | res = defaults.copy() |
171 | for dict in [vars(conf_args), vars(args)]: | 170 | for dict in [vars(conf_args), vars(args)]: |