Commit 42ea6dbf authored by chenpangpang's avatar chenpangpang
Browse files

feat: 避免重复下载模型

parent 9a73404f
......@@ -40,7 +40,6 @@ ASPECT_RATIO_LABELS = list(aspect_ratios)
DEFAULT_ASPECT_RATIO = ASPECT_RATIO_LABELS[0]
enable_doodle_arg = False
photomaker_ckpt = hf_hub_download(repo_id="TencentARC/PhotoMaker-V2", filename="photomaker-v2.bin", repo_type="model")
torch_dtype = torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
if device == "mps":
......@@ -60,9 +59,9 @@ pipe = PhotoMakerStableDiffusionXLAdapterPipeline.from_pretrained(
).to(device)
pipe.load_photomaker_adapter(
os.path.dirname(photomaker_ckpt),
"TencentARC/PhotoMaker-V2",
subfolder="",
weight_name=os.path.basename(photomaker_ckpt),
weight_name="photomaker-v2.bin",
trigger_word="img",
pm_version="v2",
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment