Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Support the wan fun reward loras.

comfyanonymous70d7242e57e8
diff --git a/comfy/lora_convert.py b/comfy/lora_convert.py
index 05032c690..3e00b63db 100644
--- a/comfy/lora_convert.py
+++ b/comfy/lora_convert.py
@@ -1,4 +1,5 @@
import torch
+import comfy.utils
def convert_lora_bfl_control(sd): #BFL loras for Flux
@@ -11,7 +12,13 @@ def convert_lora_bfl_control(sd): #BFL loras for Flux
return sd_out
+def convert_lora_wan_fun(sd): #Wan Fun loras
+ return comfy.utils.state_dict_prefix_replace(sd, {"lora_unet__": "lora_unet_"})
+
+
def convert_lora(sd):
if "img_in.lora_A.weight" in sd and "single_blocks.0.norm.key_norm.scale" in sd:
return convert_lora_bfl_control(sd)
+ if "lora_unet__blocks_0_cross_attn_k.lora_down.weight" in sd:
+ return convert_lora_wan_fun(sd)
return sd