comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
52.47k stars 5.54k forks source link

Error occurred when executing CheckpointLoaderSimple: unet_dtype() got an unexpected keyword argument 'supported_dtypes' #3017

Open dyxy520 opened 6 months ago

dyxy520 commented 6 months ago

Error occurred when executing CheckpointLoaderSimple:

unet_dtype() got an unexpected keyword argument 'supported_dtypes'

File "D:\flc\software\comfy ui\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\flc\software\comfy ui\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\flc\software\comfy ui\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\flc\software\comfy ui\ComfyUI\nodes.py", line 540, in load_checkpoint out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\flc\software\comfy ui\ComfyUI\comfy\sd.py", line 508, in load_checkpoint_guess_config unet_dtype = model_management.unet_dtype(model_params=parameters, supported_dtypes=model_config.supported_inference_dtypes)

robinjhuang commented 6 months ago

Which git commit is your comfy on? supported_dtypes was added recently

https://github.com/comfyanonymous/ComfyUI/commit/f83109f09bec04f39f028c275b4eb1231adba00a#diff-c43913f04f43d976f3ec095cfcb3981df79c55947e3efbe70799cd374905c773R490

hello2mao commented 6 months ago

+1

shiimizu commented 6 months ago

Update your custom nodes.

6sixteen commented 6 months ago

Suppplement: other custom nodes may cause error for example: smZNodes (if you have older version)

if hasattr(comfy.model_management, 'unet_dtype'):
    if not hasattr(comfy.model_management, 'unet_dtype_orig'):
        comfy.model_management.unet_dtype_orig = comfy.model_management.unet_dtype
    from .modules import devices
    def unet_dtype(device=None, model_params=0):
        dtype = comfy.model_management.unet_dtype_orig(device=device, model_params=model_params)
        if model_params != 0:
            devices.dtype_unet = dtype
        return dtype
    comfy.model_management.unet_dtype = unet_dtype

dtype = comfy.model_management.unet_dtype_orig(device=device, model_params=model_params) make bug Just Update the extension (The author has already fixed it )

def hook_for_dtype_unet():
    if hasattr(comfy.model_management, 'unet_dtype'):
        if not hasattr(comfy.model_management, 'unet_dtype_orig'):
            comfy.model_management.unet_dtype_orig = comfy.model_management.unet_dtype
        from .modules import devices
        def unet_dtype(device=None, model_params=0, *args, **kwargs):
            dtype = comfy.model_management.unet_dtype_orig(device=device, model_params=model_params, *args, **kwargs)
            if model_params != 0:
                devices.dtype_unet = dtype
            return dtype
        comfy.model_management.unet_dtype = unet_dtype
hello2mao commented 6 months ago

Update smZNodes fix my issue.