Skip to content

Commit afb6987

Browse files
committed
recognize anima controlnet files
for #1392
1 parent 300d803 commit afb6987

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/Text2Image/T2IModelClassSorter.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ bool isQwenImageLora(JObject h) => (hasLoraKey(h, "transformer_blocks.0.attn.add
228228
bool isAnima(JObject h) => hasKey(h, "t_embedder.1.linear_2.weight") && hasKey(h, "llm_adapter.blocks.0.self_attn.v_proj.weight") && hasKey(h, "blocks.27.adaln_modulation_cross_attn.2.weight");
229229
bool isAnimaLora(JObject h) => (hasLoraKey(h, "llm_adapter.blocks.5.self_attn.v_proj") && hasLoraKey(h, "blocks.27.self_attn.v_proj") && hasLoraKey(h, "blocks.27.adaln_modulation_cross_attn.1"))
230230
|| (hasLoraKey(h, "lora_unet_blocks_27_self_attn_v_proj") && hasLoraKey(h, "lora_unet_blocks_27_cross_attn_output_proj") && hasLoraKey(h, "lora_unet_blocks_27_mlp_layer2"));
231+
bool isAnimaControlnet(JObject h) => h.ContainsKey("lllite_dit_blocks_0_self_attn_q_proj.depth_embed") && h.ContainsKey("lllite_dit_blocks_0_self_attn_q_proj.cond_to_film.weight") && h.ContainsKey("lllite_dit_blocks_27_self_attn_q_proj.up.weight");
231232
bool isLongcat(JObject h) => hasKey(h, "double_blocks.0.txt_attn.norm.query_norm.weight") && hasKey(h, "time_in.out_layer.weight") && hasKey(h, "final_layer.adaLN_modulation.1.weight");
232233
// Audio models
233234
bool isAceStep15(JObject h) => hasKey(h, "encoder.lyric_encoder.layers.0.post_attention_layernorm.weight");
@@ -742,6 +743,7 @@ JToken GetEmbeddingKey(JObject h)
742743
{
743744
return isAuraFlow(h);
744745
}});
746+
// ====================== Anima ======================
745747
Register(new() { ID = "anima", CompatClass = CompatAnima, Name = "Anima", StandardWidth = 1024, StandardHeight = 1024, IsThisModelOfClass = (m, h) =>
746748
{
747749
return isAnima(h);
@@ -750,6 +752,10 @@ JToken GetEmbeddingKey(JObject h)
750752
{
751753
return isAnimaLora(h);
752754
}});
755+
Register(new() { ID = "anima/controlnet", CompatClass = CompatAnima, Name = "Anima ControlNet", StandardWidth = 1024, StandardHeight = 1024, IsThisModelOfClass = (m, h) =>
756+
{
757+
return isAnimaControlnet(h);
758+
}});
753759
// ====================== Hunyuan Image 2.1 ======================
754760
Register(new() { ID = "hunyuan-image-2_1", CompatClass = CompatHunyuanImage2_1, Name = "Hunyuan Image", StandardWidth = 2048, StandardHeight = 2048, IsThisModelOfClass = (m, h) =>
755761
{
@@ -855,6 +861,7 @@ JToken GetEmbeddingKey(JObject h)
855861
Remaps["stable-diffusion-3-3-5-medium/lora"] = "stable-diffusion-v3.5-medium/lora";
856862
Remaps["anima-preview"] = "anima";
857863
Remaps["anima-preview/lora"] = "anima/lora";
864+
Remaps["anima-preview/control-net-lllite"] = "anima/controlnet";
858865
// ====================== Comfy model_type remaps ======================
859866
Remaps["hunyuanvideo1.5_480p_t2v_distilled"] = "hunyuan-video-1_5";
860867
Remaps["hunyuanvideo1.5_480p_i2v_distilled"] = "hunyuan-video-1_5";

0 commit comments

Comments
 (0)