MCPcopy Create free account
hub / github.com/MooreThreads/Moore-AnimateAnyone / prepare_base_model

Function prepare_base_model

tools/download_weights.py:7–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def prepare_base_model():
8 print(f'Preparing base stable-diffusion-v1-5 weights...')
9 local_dir = "./pretrained_weights/stable-diffusion-v1-5"
10 os.makedirs(local_dir, exist_ok=True)
11 for hub_file in ["unet/config.json", "unet/diffusion_pytorch_model.bin"]:
12 path = Path(hub_file)
13 saved_path = local_dir / path
14 if os.path.exists(saved_path):
15 continue
16 hf_hub_download(
17 repo_id="runwayml/stable-diffusion-v1-5",
18 subfolder=PurePosixPath(path.parent),
19 filename=PurePosixPath(path.name),
20 local_dir=local_dir,
21 )
22
23
24def prepare_image_encoder():

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected