Skip to content

Conversation

@samuelchristlie
Copy link

Quick fix to allow loading text model GGUFs as clip, like Qwen 2.5 VL.

  File "ComfyUI\custom_nodes\ComfyUI-GGUF\loader.py", line 89, in gguf_sd_loader
    raise ValueError(f"Unexpected text model architecture type in GGUF file: {arch_str!r}")
ValueError: Unexpected text model architecture type in GGUF file: 'clip'

Fixes loading mmproj model for gguf
@Ph0rk0z
Copy link

Ph0rk0z commented Oct 12, 2025

This saves a lot of trouble having to edit metadata.

@phil2sat
Copy link

Please add to master, as some mmproj files appear to be clip. ripped my hair.

@Pythonpa
Copy link

Pythonpa commented Nov 4, 2025

I see there have been recent updates, but why hasn't this merge been accepted yet? @city96

@city96
Copy link
Owner

city96 commented Nov 4, 2025

Is this triggered by the text model or the mmproj? Some older ones have mmproj instead of clip-vision set for general.type

Can you check if this fix works? d4fbdb0

@phil2sat
Copy link

phil2sat commented Nov 4, 2025

mmproj, it comes from this part:

correct loaded:
general.architecture clip
general.type clip-vision

false loaded:
general.architecture clip
general.type mmproj

i get the error in the abliberated model:
https://huggingface.co/mradermacher/Qwen2.5-VL-7B-Instruct-abliterated-GGUF/blob/main/Qwen2.5-VL-7B-Instruct-abliterated.mmproj-Q8_0.gguf

but i edit the metadata with huggingface and added the files to my repo so for this the patch is no longer needed:
https://huggingface.co/Phil2Sat/Qwen-Image-Edit-Rapid-AIO-GGUF/blob/main/Qwen2.5-VL-7B-Instruct-abliterated/Qwen2.5-VL-7B-Instruct-abliterated.mmproj-Q8_0.gguf

i dont know what is the correct naming but this model was the only case where i had to patch something.

i guess the best way, catch error and give a message that the repo maintainer should update the metadata.

@city96
Copy link
Owner

city96 commented Nov 4, 2025

Could you re-test on latest master? It should load it now even with the old style metadata like the file you linked (since it should now accept general.type = mmproj)

@phil2sat
Copy link

phil2sat commented Nov 4, 2025

i try as soon as im home..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants