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.

Add LyCoris LoKr MLP layer support for Flux2 (#11997)

Markury0fc15700be9b
diff --git a/comfy/utils.py b/comfy/utils.py
index 5e79fb449..d97d753e6 100644
--- a/comfy/utils.py
+++ b/comfy/utils.py
@@ -611,6 +611,14 @@ def flux_to_diffusers(mmdit_config, output_prefix=""):
"ff_context.net.0.proj.bias": "txt_mlp.0.bias",
"ff_context.net.2.weight": "txt_mlp.2.weight",
"ff_context.net.2.bias": "txt_mlp.2.bias",
+ "ff.linear_in.weight": "img_mlp.0.weight", # LyCoris LoKr
+ "ff.linear_in.bias": "img_mlp.0.bias",
+ "ff.linear_out.weight": "img_mlp.2.weight",
+ "ff.linear_out.bias": "img_mlp.2.bias",
+ "ff_context.linear_in.weight": "txt_mlp.0.weight",
+ "ff_context.linear_in.bias": "txt_mlp.0.bias",
+ "ff_context.linear_out.weight": "txt_mlp.2.weight",
+ "ff_context.linear_out.bias": "txt_mlp.2.bias",
"attn.norm_q.weight": "img_attn.norm.query_norm.scale",
"attn.norm_k.weight": "img_attn.norm.key_norm.scale",
"attn.norm_added_q.weight": "txt_attn.norm.query_norm.scale",