Skip to content
Python

fixed kandinsky VAE 32 bits crash

DeepBeepMeep4249fa03ba2c
diff --git a/models/wan/diffusion_forcing.py b/models/wan/diffusion_forcing.py
index dd8a1e0..3c33b4a 100644
--- a/models/wan/diffusion_forcing.py
+++ b/models/wan/diffusion_forcing.py
@@ -20,7 +20,7 @@ from shared.utils.fm_solvers import (FlowDPMSolverMultistepScheduler,
get_sampling_sigmas, retrieve_timesteps)
from shared.utils.fm_solvers_unipc import FlowUniPCMultistepScheduler
from shared.utils.loras_mutipliers import update_loras_slists
-
+from shared.utils import files_locator as fl
class DTT2V:
@@ -52,7 +52,7 @@ class DTT2V:
dtype=config.t5_dtype,
device=torch.device('cpu'),
checkpoint_path=text_encoder_filename,
- tokenizer_path=os.path.join(checkpoint_dir, config.t5_tokenizer),
+ tokenizer_path=fl.locate_folder(config.t5_tokenizer),
shard_fn= None)
self.model_def = model_def
self.image_outputs = model_def.get("image_outputs", False)
@@ -61,7 +61,7 @@ class DTT2V:
self.patch_size = config.patch_size
self.vae = WanVAE(
- vae_pth=os.path.join(checkpoint_dir, config.vae_checkpoint), dtype= VAE_dtype,
+ vae_pth= fl.locate_file(config.vae_checkpoint.replace(".pth", ".safetensors")), dtype= VAE_dtype,
device=self.device)
logging.info(f"Creating WanModel from {model_filename[-1]}")
diff --git a/models/wan/modules/vae.py b/models/wan/modules/vae.py
index c6e16a2..9db4bab 100644
--- a/models/wan/modules/vae.py
+++ b/models/wan/modules/vae.py
@@ -780,7 +780,7 @@ def _video_vae(pretrained_path=None, z_dim=None, device='cpu', **kwargs):
# model.load_state_dict(
# torch.load(pretrained_path, map_location=device), assign=True)
# offload.load_model_data(model, pretrained_path.replace(".pth", "_bf16.safetensors"), writable_tensors= False)
- offload.load_model_data(model, pretrained_path.replace(".pth", ".safetensors"), writable_tensors= False)
+ offload.load_model_data(model, pretrained_path, writable_tensors= False)
return model