Won't load in SwarmUI

#1
by aoleg - opened

For some reason your Flux SVDQ models won't load in SwarmUI. Notably, your svdq-fp4_r32-Fluxmania_legacy-Nunchaku.safetensors duplicates existing svdq-fp4_r32-fluxmania-legacy.safetensors done by https://huggingface.co/spooknik/Fluxmania-SVDQ , but spooknik's version loads and works, and your quant fails with an error. Same goes for this model here, svdq-fp4_r32-Nepotism_xii-Nunchaku.safetensors. Hardware: RTX 5090; Nunchaku version: nunchaku-1.2.1+cu13.0torch2.10

It seems that your models have an empty comfy_config":"{}" metadata. This must be fixed, or your quants won't load:

00:18:02.985 [Warning] [ComfyUI-0/STDERR] Traceback (most recent call last):
00:18:02.987 [Warning] [ComfyUI-0/STDERR]   File "S:\SwarmUI\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 534, in execute
00:18:02.988 [Warning] [ComfyUI-0/STDERR]     output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
00:18:02.989 [Warning] [ComfyUI-0/STDERR]                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
00:18:02.990 [Warning] [ComfyUI-0/STDERR]   File "S:\SwarmUI\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 334, in get_output_data
00:18:02.991 [Warning] [ComfyUI-0/STDERR]     return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
00:18:02.992 [Warning] [ComfyUI-0/STDERR]                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
00:18:02.993 [Warning] [ComfyUI-0/STDERR]   File "S:\SwarmUI\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 308, in _async_map_node_over_list
00:18:02.994 [Warning] [ComfyUI-0/STDERR]     await process_inputs(input_dict, i)
00:18:02.995 [Warning] [ComfyUI-0/STDERR]   File "S:\SwarmUI\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 296, in process_inputs
00:18:02.996 [Warning] [ComfyUI-0/STDERR]     result = f(**inputs)
00:18:02.997 [Warning] [ComfyUI-0/STDERR]              ^^^^^^^^^^^
00:18:02.998 [Warning] [ComfyUI-0/STDERR]   File "S:\SwarmUI\SwarmUI\src\BuiltinExtensions\ComfyUIBackend\DLNodes\ComfyUI-nunchaku\nodes\models\flux.py", line 289, in load_model
00:18:03.000 [Warning] [ComfyUI-0/STDERR]     model_class_name = comfy_config["model_class"]
00:18:03.001 [Warning] [ComfyUI-0/STDERR]                        ~~~~~~~~~~~~^^^^^^^^^^^^^^^
00:18:03.002 [Warning] [ComfyUI-0/STDERR] KeyError: 'model_class'
00:18:03.003 [Warning] [ComfyUI-0/STDERR]
00:18:03.162 [Error] Error loading model 'S:/SwarmUI/SwarmUI/Models/diffusion_models/flux/svdq-fp4_r32-Nepotism_xii-Nunchaku.safetensors' (arch=Flux.1-dev) on backend 0 (ComfyUI Self-Starting): ComfyUI execution error: 'model_class'

00:18:03.163 [Warning] Tried 1 backends but none were able to load model 'flux/svdq-fp4_r32-Nepotism_xii-Nunchaku.safetensors'

Quick update: just adding the missing block with safetensors_util.py fixes the issue. Please do it on your end so that people could use your models.

  "comfy_config":"{\n  \"model_class\": \"Flux\",\n  \"model_config\": {\n    \"axes_dim\": [\n      16,\n      56,\n      56\n    ],\n    \"context_in_dim\": 4096,\n    \"depth\": 19,\n    \"depth_single_blocks\": 38,\n    \"disable_unet_model_creation\": true,\n    \"guidance_embed\": true,\n    \"hidden_size\": 3072,\n    \"image_model\": \"flux\",\n    \"in_channels\": 16,\n    \"mlp_ratio\": 4.0,\n    \"num_heads\": 24,\n    \"out_channels\": 16,\n    \"patch_size\": 2,\n    \"qkv_bias\": true,\n    \"theta\": 10000,\n    \"vec_in_dim\": 768\n  }\n}",
Owner

Thank you. copy that.

Sign up or log in to comment