city96 / ComfyUI-GGUF

GGUF Quantization support for native ComfyUI models
Apache License 2.0
1.02k stars 67 forks source link

Error with cast_to function due to unsupported 'copy' argument in ops.py #115

Open RyanSadicious opened 1 month ago

RyanSadicious commented 1 month ago

Hi,

I'm experiencing an error when using the ComfyUI-GGUF custom node with ComfyUI. The error occurs during image generation and seems related to the cast_to function receiving an unexpected keyword argument 'copy'.

Error: TypeError: cast_to() got an unexpected keyword argument 'copy'

I'm on ComfyUI 0.2.2 (latest as of writing this)

I resolved this issue by updating custom_nodes/ComfyUI-GGUF/ops.py line 144 and 147, and removed argument "copy=False".

impacted workflow attached.

flux1-dev-gguf-txt2img.json

city96 commented 1 month ago

cast_to in ComfyUI's ops.py does take a copy argument tho, and that's also present in 0.2.2 as far as I can tell.

Could you check what your ComfyUI/comfy/ops.py file looks like?

RyanSadicious commented 1 month ago

ComfyUI/comfy/ops.py:23

def cast_to(weight, dtype=None, device=None, non_blocking=False):
    r = torch.empty_like(weight, dtype=dtype, device=device)
    r.copy_(weight, non_blocking=non_blocking)
    return r

Very strange. I guess this could be a "me" issue, or something broke during ComfyUI updates.

city96 commented 1 month ago

Would definitely be good to get to the bottom of this, had people reporting similar issues before about different parts of the actual ComfyUI code being out of date compared to master despite them updating.

Sure, some of it might be user error, but it seems weird that the automatic update would break in such a way. Could you maybe just mention: