@@ -1614,9 +1614,9 @@ struct LLMEmbedder : public Conditioner {
16141614 bool enable_vision = false )
16151615 : version(version) {
16161616 LLM::LLMArch arch = LLM::LLMArch::QWEN2_5_VL;
1617- if (sd_version_is_flux2 ( version) ) {
1617+ if (version == VERSION_FLUX2 ) {
16181618 arch = LLM::LLMArch::MISTRAL_SMALL_3_2;
1619- } else if (sd_version_is_z_image (version) || version == VERSION_OVIS_IMAGE) {
1619+ } else if (sd_version_is_z_image (version) || version == VERSION_OVIS_IMAGE || version == VERSION_FLUX2_KLEIN ) {
16201620 arch = LLM::LLMArch::QWEN3;
16211621 }
16221622 if (arch == LLM::LLMArch::MISTRAL_SMALL_3_2) {
@@ -1771,7 +1771,7 @@ struct LLMEmbedder : public Conditioner {
17711771 prompt_attn_range.second = static_cast <int >(prompt.size ());
17721772
17731773 prompt += " <|im_end|>\n <|im_start|>assistant\n " ;
1774- } else if (sd_version_is_flux2 ( version) ) {
1774+ } else if (version == VERSION_FLUX2 ) {
17751775 prompt_template_encode_start_idx = 0 ;
17761776 out_layers = {10 , 20 , 30 };
17771777
@@ -1793,17 +1793,17 @@ struct LLMEmbedder : public Conditioner {
17931793 prompt_attn_range.second = static_cast <int >(prompt.size ());
17941794
17951795 prompt += " <|im_end|>\n <|im_start|>assistant\n " ;
1796- } else if (sd_version_is_flux2 ( version) ) {
1796+ } else if (version == VERSION_FLUX2_KLEIN ) {
17971797 prompt_template_encode_start_idx = 0 ;
1798- out_layers = {10 , 20 , 30 };
1798+ out_layers = {9 , 18 , 27 };
17991799
1800- prompt = " [SYSTEM_PROMPT]You are an AI that reasons about image descriptions. You give structured responses focusing on object relationships, object \n attribution and actions without speculation.[/SYSTEM_PROMPT][INST] " ;
1800+ prompt = " <|im_start|>user \n " ;
18011801
18021802 prompt_attn_range.first = static_cast <int >(prompt.size ());
18031803 prompt += conditioner_params.text ;
18041804 prompt_attn_range.second = static_cast <int >(prompt.size ());
18051805
1806- prompt += " [/INST] " ;
1806+ prompt += " <|im_end|> \n <|im_start|>assistant \n <think> \n\n </think> \n\n " ;
18071807 } else if (version == VERSION_OVIS_IMAGE) {
18081808 prompt_template_encode_start_idx = 28 ;
18091809 max_length = prompt_template_encode_start_idx + 256 ;
0 commit comments