sdbds / Moore-AnimateAnyone-for-windows

Apache License 2.0
62 stars 4 forks source link

Solution of "FileNotFoundError: no weights file found in pretrained_weights\stable-diffusion-v1-5\unet" #5

Open MoonEese opened 7 months ago

MoonEese commented 7 months ago

Solution of "FileNotFoundError: no weights file found in pretrained_weights\stable-diffusion-v1-5\unet"

Add to './src/models/unet_3d.py' pretrained_model_path = pretrained_model_path.joinpath(SAFETENSORS_WEIGHTS_NAME) before line 646

        if str(pretrained_model_path).endswith(".safetensors"):
            logger.debug(
                f"loading safeTensors weights from {pretrained_model_path} ..."
            )
            state_dict = load_file(
                pretrained_model_path, device="cpu"
            )
TOKYOJAB commented 7 months ago

Just to be more specific as I had the same problem, I fixed it by putting this safetensor into the folder mentioned above... (pretrained_weights\stable-diffusion-v1-5\unet) https://civitai.com/models/155256/stable-diffusion-v15-bf16fp16-no-emaema-only-no-vae-safetensors-checkpoint

I then added the line mentioned and included the name of the new checkpoint... pretrained_model_path = pretrained_model_path.joinpath("stableDiffusionV15Bf16Fp16NoEma_v15NoEma.safetensors")

That got it working