Only convert layers that actually have scaled weights...

This commit is contained in:
kijai
2025-07-21 01:57:27 +03:00
parent 29ce253bb6
commit aeac12ed7a
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ def convert_fp8_scaled_linear(module, sd, original_dtype, params_to_keep={}, pat
lora = (lora_diffs, lora_strengths)
setattr(submodule, "lora", lora)
if isinstance(submodule, nn.Linear) and (has_scale or has_fp8_weight):
if isinstance(submodule, nn.Linear) and (has_scale and has_fp8_weight):
original_forward = submodule.forward
setattr(submodule, "original_forward", original_forward)
setattr(submodule, "forward", lambda input, m=submodule: fp8_scaled_linear_forward(m, original_dtype, input))
+3 -1
View File
@@ -651,9 +651,11 @@ class WanVideoModelLoader:
quantization = "fp8_e5m2"
break
if "scaled_fp8" in sd and quantization != "fp8_e4m3fn_scaled":
raise ValueError("The model is a scaled fp8 model, please set quantization to 'fp8_e4m3fn_scaled'")
if merge_loras and "scaled" in quantization:
raise ValueError("scaled models currently do not support merging LoRAs, please disable merging or use a non-scaled model")
if "vace_blocks.0.after_proj.weight" in sd and not "patch_embedding.weight" in sd:
raise ValueError("You are attempting to load a VACE module as a WanVideo model, instead you should use the vace_model input and matching T2V base model")