You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug]: XLabs FLUX ControlNet v3 checkpoints are installed as FLUX main models #9832
Installing flux-canny-controlnet-v3.safetensors from XLabs-AI/flux-controlnet-collections registers it as a FLUX main model (type: main, base: flux, format: checkpoint) instead of a ControlNet. It then does not show up where ControlNets are chosen and cannot be used as one.
What you expected to happen
The file is registered as a FLUX ControlNet (type: controlnet, base: flux, format: checkpoint).
How to reproduce the problem
Download flux-canny-controlnet-v3.safetensors from XLabs-AI/flux-controlnet-collections (1.39 GiB).
Install it from its local path, e.g. POST /api/v2/models/install?source=<path>&inplace=true with body {}.
The new model record has type: main.
Additional context
Both config classes match the file, and the main model wins:
Main model.Main_Checkpoint_FLUX_Config._validate_is_flux (invokeai/backend/model_manager/configs/main.py) accepts any state dict containing double_blocks.0.img_attn.norm.key_norm.scale. The XLabs ControlNet has two FLUX double blocks, so it contains that key.
ControlNet.ControlNet_Checkpoint_FLUX_Config matches too, since is_state_dict_xlabs_controlnet recognises the file. The comment in _validate_looks_like_controlnet (configs/controlnet.py) already notes that XLabs ControlNets also contain double_blocks. keys.
Tie-break.ModelConfigFactory.matches_sort_key (configs/factory.py) ranks ModelType.Main first, so the main config is chosen.
The file's 86 tensors fall under these prefixes: controlnet_blocks, double_blocks, guidance_in, img_in, input_hint_block, pos_embed_input, time_in, txt_in, vector_in. There are no single_blocks or final_layer keys, which every FLUX.1 main checkpoint has.
Possible fix: let _validate_is_flux reject state dicts that is_state_dict_xlabs_controlnet or is_state_dict_instantx_controlnet recognise, or require a main-only key such as final_layer.linear.weight.
Workaround: install with an explicit type, i.e. body {"type": "controlnet", "base": "flux"}. The model then loads and works as a ControlNet; a FLUX.1 dev generation with a canny control image succeeded.
Activity
Do not identify FLUX ControlNet checkpoints as FLUX main models (#9835)