Added legacy paths
This commit is contained in:
1 parent
c3bc8b0b4e
commit
702254688d
45 files changed
+840
-223
No files matched your search
@@ -44,6 +44,7 @@ from typing import Any, Callable, Dict, List, Optional, Union
|
||||
from toolkit.models.wan21.wan_lora_convert import convert_to_diffusers, convert_to_original
|
||||
from toolkit.util.quantize import quantize_model
|
||||
from toolkit.models.v2.text_encoders.umt5 import UMT5TextEncoder
|
||||
from toolkit.models.v2.vae.wan import WanVAE
|
||||
from toolkit.metadata import get_meta_for_safetensors
|
||||
|
||||
# for generation only?
|
||||
@@ -431,11 +432,9 @@ class Wan21(BaseModel):
|
||||
|
||||
if self._wan_vae_path is not None:
|
||||
# load the vae from individual repo
|
||||
vae = AutoencoderKLWan.from_pretrained(
|
||||
self._wan_vae_path, torch_dtype=dtype).to(dtype=dtype)
|
||||
vae = WanVAE.load_model(self._wan_vae_path, dtype=dtype, subfolder="")
|
||||
else:
|
||||
vae = AutoencoderKLWan.from_pretrained(
|
||||
vae_path, subfolder="vae", torch_dtype=dtype).to(dtype=dtype)
|
||||
vae = WanVAE.load_model(vae_path, dtype=dtype)
|
||||
flush()
|
||||
|
||||
self.print_and_status_update("Making pipe")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# WIP, coming soon ish
|
||||
from toolkit.models.v2.vision_encoders.clip_vision import CLIPVisionEncoder
|
||||
from functools import partial
|
||||
import torch
|
||||
import yaml
|
||||
@@ -314,10 +315,8 @@ class Wan21I2V(Wan21):
|
||||
self.model_config.extras_name_or_path ,
|
||||
subfolder="image_processor"
|
||||
)
|
||||
self.image_encoder = CLIPVisionModel.from_pretrained(
|
||||
self.model_config.extras_name_or_path,
|
||||
subfolder="image_encoder",
|
||||
torch_dtype=dtype,
|
||||
self.image_encoder = CLIPVisionEncoder.load_model(
|
||||
self.model_config.extras_name_or_path, dtype=dtype
|
||||
)
|
||||
except Exception as e:
|
||||
# load from name_or_path
|
||||
@@ -325,10 +324,8 @@ class Wan21I2V(Wan21):
|
||||
self.model_config.name_or_path_original,
|
||||
subfolder="image_processor"
|
||||
)
|
||||
self.image_encoder = CLIPVisionModel.from_pretrained(
|
||||
self.model_config.name_or_path_original,
|
||||
subfolder="image_encoder",
|
||||
torch_dtype=dtype,
|
||||
self.image_encoder = CLIPVisionEncoder.load_model(
|
||||
self.model_config.name_or_path_original, dtype=dtype
|
||||
)
|
||||
self.image_encoder.to(self.device_torch, dtype=dtype)
|
||||
self.image_encoder.eval()
|
||||
|
||||
Reference in new issue
Block a user