Skip to content

FLUX.2-klein-4B failed to execute under vulkan environments #1216

@HemanLin-cl

Description

@HemanLin-cl

Hi all,
I've tried to run FLUX.2-Klein-4B models. However, it failed.

Environment

sd.cpp version: sd-master-b87fe13-bin-win-vulkan-x64.zip
GPU: Intel Arc TM [0] GPU
Backend: vulkan
OS: windows
Model Files
Diffusion: flux-2-klein-4b.safetensors from https://huggingface.co/black-forest-labs/FLUX.2-klein-4B
VAE: ae.safetensors from black-forest-labs/FLUX.2-dev or https://docs.comfy.org/tutorials/flux/flux-2-dev
LLM: qwen_3_4b.safetensors from https://huggingface.co/Comfy-Org/flux2-klein-4B/tree/main/split_files/text_encoders

Command

sd-cli.exe --diffusion-model ../models/Flux/flux-2-klein-4b.safetensors --vae models/Flux/flux2-vae.safetensors --llm ../models/text_encoders/qwen_3_4b.safetensors -p "a lovely cat" --cfg-scale 1.0 --steps 4 -v --offload-to-cpu --diffusion-fa

Results & Logs : Failed

[DEBUG] stable-diffusion.cpp:172 - Using Vulkan backend
[DEBUG] ggml_extend.hpp:75 - ggml_vulkan: Found 1 Vulkan devices:
[DEBUG] ggml_extend.hpp:75 - ggml_vulkan: 0 = Intel(R) Arc(TM) [0] GPU (Intel Corporation) | uma: 1 | fp16: 1 | bf16: 0 | warp size: 32 | shared memory: 32768 | int dot: 1 | matrix cores: KHR_coopmat
[INFO ] stable-diffusion.cpp:193 - Vulkan: Using device 0
[INFO ] stable-diffusion.cpp:258 - loading diffusion model from '../models/Flux/flux-2-klein-4b.safetensors'
[INFO ] model.cpp:373 - load ../models/Flux/flux-2-klein-4b.safetensors using safetensors format
[DEBUG] model.cpp:503 - init from '../models/Flux/flux-2-klein-4b.safetensors', prefix = 'model.diffusion_model.'
[INFO ] stable-diffusion.cpp:305 - loading llm from '../models/text_encoders/qwen_3_4b.safetensors'
[INFO ] model.cpp:373 - load ../models/text_encoders/qwen_3_4b.safetensors using safetensors format
[DEBUG] model.cpp:503 - init from '../models/text_encoders/qwen_3_4b.safetensors', prefix = 'text_encoders.llm.'
[INFO ] stable-diffusion.cpp:319 - loading vae from 'models/Flux/flux2-vae.safetensors'
[WARN ] model.cpp:379 - unknown format models/Flux/flux2-vae.safetensors
[WARN ] stable-diffusion.cpp:321 - loading vae from 'models/Flux/flux2-vae.safetensors' failed
[INFO ] stable-diffusion.cpp:335 - Version: Flux.2 klein
[INFO ] stable-diffusion.cpp:363 - Weight type stat: bf16: 547
[INFO ] stable-diffusion.cpp:364 - Conditioner weight type stat: bf16: 398
[INFO ] stable-diffusion.cpp:365 - Diffusion model weight type stat: bf16: 149
[INFO ] stable-diffusion.cpp:366 - VAE weight type stat:
[DEBUG] stable-diffusion.cpp:368 - ggml tensor size = 400 bytes
[DEBUG] llm.hpp:285 - merges size 151387
[DEBUG] llm.hpp:317 - vocab size: 151669
[DEBUG] llm.hpp:1139 - llm: num_layers = 36, vocab_size = 151936, hidden_size = 2560, intermediate_size = 9728
[INFO ] flux.hpp:1376 - flux: depth = 5, depth_single_blocks = 20, guidance_embed = false, context_in_dim = 7680, hidden_size = 3072, num_heads = 24
[INFO ] stable-diffusion.cpp:573 - Using flash attention in the diffusion model
[DEBUG] ggml_extend.hpp:1922 - qwen3 params backend buffer size = 8414.50 MB(RAM) (398 tensors)
[DEBUG] ggml_extend.hpp:1922 - flux params backend buffer size = 7392.03 MB(RAM) (149 tensors)
[DEBUG] ggml_extend.hpp:1922 - vae params backend buffer size = 94.72 MB(RAM) (140 tensors)
[DEBUG] stable-diffusion.cpp:752 - loading weights
[DEBUG] model.cpp:1377 - using 8 threads for model loading
[DEBUG] model.cpp:1399 - loading tensors from ../models/Flux/flux-2-klein-4b.safetensors
|=============> | 149/547 - 30.58it/s←[K
[DEBUG] model.cpp:1399 - loading tensors from ../models/text_encoders/qwen_3_4b.safetensors
|==================================================| 547/547 - 15.35it/s←[K
[INFO ] model.cpp:1625 - loading tensors completed, taking 35.64s (process: 0.00s, read: 9.73s, memcpy: 0.00s, convert: 0.06s, copy_to_backend: 0.00s)
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.conv_in.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.conv_in.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.conv_out.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.conv_out.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.k.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.k.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.norm.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.norm.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.proj_out.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.proj_out.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.q.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.q.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.v.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.attn_1.v.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_1.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_1.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_1.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_1.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_1.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_1.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_1.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_1.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_2.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_2.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_2.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_2.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_2.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_2.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_2.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.mid.block_2.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.norm_out.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.norm_out.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.nin_shortcut.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.nin_shortcut.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.0.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.1.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.1.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.1.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.1.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.1.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.1.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.1.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.1.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.2.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.2.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.2.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.2.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.2.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.2.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.2.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.0.block.2.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.nin_shortcut.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.nin_shortcut.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.0.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.1.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.1.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.1.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.1.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.1.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.1.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.1.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.1.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.2.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.2.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.2.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.2.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.2.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.2.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.2.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.block.2.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.upsample.conv.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.1.upsample.conv.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.0.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.0.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.0.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.0.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.0.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.0.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.0.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.0.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.1.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.1.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.1.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.1.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.1.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.1.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.1.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.1.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.2.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.2.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.2.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.2.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.2.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.2.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.2.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.block.2.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.upsample.conv.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.2.upsample.conv.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.0.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.0.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.0.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.0.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.0.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.0.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.0.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.0.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.1.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.1.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.1.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.1.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.1.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.1.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.1.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.1.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.2.conv1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.2.conv1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.2.conv2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.2.conv2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.2.norm1.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.2.norm1.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.2.norm2.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.block.2.norm2.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.upsample.conv.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.decoder.up.3.upsample.conv.weight' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.post_quant_conv.bias' not in model file
[ERROR] model.cpp:1693 - tensor 'first_stage_model.post_quant_conv.weight' not in model file
[ERROR] stable-diffusion.cpp:782 - load tensors from model loader failed
[INFO ] main.cpp:690 - new_sd_ctx_t failed

It seems like we cannot load vae?
Could you please help suggest the correct model or version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions