Add SD v2.1 768x768 tuned model (#1244)

Co-authored-by: powderluv <powderluv@users.noreply.github.com>
This commit is contained in:
yzhang93
2023-03-24 10:39:15 -07:00
committed by GitHub
parent da449b73aa
commit 17a67897d1
2 changed files with 24 additions and 3 deletions

View File

@@ -115,7 +115,14 @@ def load_lower_configs(base_model_id=None):
config_name = f"{args.annotation_model}_{args.precision}_{device}_{spec}.json"
else:
if not spec or spec in ["rdna3", "sm_80"]:
config_name = f"{args.annotation_model}_{version}_{args.precision}_{device}.json"
if (
version in ["v2_1", "v2_1base"]
and args.height == 768
and args.width == 768
):
config_name = f"{args.annotation_model}_v2_1_768_{args.precision}_{device}.json"
else:
config_name = f"{args.annotation_model}_{version}_{args.precision}_{device}.json"
else:
config_name = f"{args.annotation_model}_{version}_{args.precision}_{device}_{spec}.json"

View File

@@ -269,8 +269,8 @@ def set_init_device_flags():
if (
args.precision != "fp16"
or args.height != 512
or args.width != 512
or args.height not in [512, 768]
or args.width not in [512, 768]
or args.batch_size != 1
or ("vulkan" not in args.device and "cuda" not in args.device)
):
@@ -304,6 +304,20 @@ def set_init_device_flags():
]:
args.use_tuned = False
elif (
args.height == 768
and args.width == 768
and (
base_model_id
not in [
"stabilityai/stable-diffusion-2-1",
"stabilityai/stable-diffusion-2-1-base",
]
or "rdna3" not in args.iree_vulkan_target_triple
)
):
args.use_tuned = False
if args.use_tuned:
print(f"Using tuned models for {base_model_id}/fp16/{args.device}.")
else: