feat: add FLUX.2 Klein model support

Add support for FLUX.2 Klein distilled models (4B and 9B variants):

- Add pipeline loader for Flux2KleinPipeline
- Add model detection for 'flux.2' + 'klein' patterns
- Add pipeline mapping in shared_items
- Add shared Qwen3ForCausalLM text encoder handling:
  - 4B variants use Z-Image-Turbo's Qwen3-8B
  - 9B variants use FLUX.2-klein-9B's Qwen3-14B
- Add reference entries for distilled (4B, 9B) and base models
- Update diffusers commit for Flux2KleinPipeline support
This commit is contained in:
CalamitousFelicitousness
2026-01-16 01:16:06 +00:00
parent 6f86cc633f
commit fe99d3fe5d
8 changed files with 106 additions and 1 deletions
+2
View File
@@ -92,6 +92,8 @@ def guess_by_name(fn, current_guess):
new_guess = 'HiDream'
elif 'chroma' in fn.lower() and 'xl' not in fn.lower():
new_guess = 'Chroma'
elif 'flux.2' in fn.lower() and 'klein' in fn.lower():
new_guess = 'FLUX2 Klein'
elif 'flux.2' in fn.lower():
new_guess = 'FLUX2'
elif 'flux' in fn.lower() or 'flex.1' in fn.lower():
+4
View File
@@ -359,6 +359,10 @@ def load_diffuser_force(detected_model_type, checkpoint_info, diffusers_load_con
from pipelines.model_flux2 import load_flux2
sd_model = load_flux2(checkpoint_info, diffusers_load_config)
allow_post_quant = False
elif model_type in ['FLUX2 Klein']:
from pipelines.model_flux2_klein import load_flux2_klein
sd_model = load_flux2_klein(checkpoint_info, diffusers_load_config)
allow_post_quant = False
elif model_type in ['FLEX']:
from pipelines.model_flex import load_flex
sd_model = load_flex(checkpoint_info, diffusers_load_config)
+2
View File
@@ -48,6 +48,8 @@ pipelines = {
'Qwen': getattr(diffusers, 'QwenImagePipeline', None),
'HunyuanImage': getattr(diffusers, 'HunyuanImagePipeline', None),
'Z-Image': getattr(diffusers, 'ZImagePipeline', None),
'FLUX2': getattr(diffusers, 'Flux2Pipeline', None),
'FLUX2 Klein': getattr(diffusers, 'Flux2KleinPipeline', None),
'LongCat': getattr(diffusers, 'LongCatImagePipeline', None),
'GLM-Image': getattr(diffusers, 'GlmImagePipeline', None),
# dynamically imported and redefined later