Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the hook method provided by ComfyUI to inject the patch, solve some compatibility issues of ComfyUI #166

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lldacing
Copy link

@lldacing lldacing commented Jan 7, 2025

  1. Use the hook method provided by ComfyUI to inject the patch
  2. Fixed the memory leak warning issue when executing workflow multiple times
    Potential memory leak detected with model BaseModel, doing a full garbage collect, for maximum performance avoid circular references in the model code.
    WARNING, memory leak with model BaseModel. Please make sure it is not being referenced from somewhere.
  3. Solve the following compatibility issues of ComfyUI
    Loading Ksampler error <The size of tensor a (640) must match the size of tensor b (320) at non-singleton dimension 1> #152
    The version on September 5th works fine, but the subsequent versions give an error. #153
    The size of tensor a (640) must match the size of tensor b (320) at non-singleton dimension 1 #154
    gguf not work: The size of tensor a (640) must match the size of tensor b (320) at non-singleton dimension 1 #158
    RuntimeError: The size of tensor a (640) must match the size of tensor b (320) at non-singleton dimension 1  #136
    Support for SamplerCustomAdvanced? #134
    'NoneType' object has no attribute 'model' #163

@xueqing0622
Copy link

hi, lldacing ,gguf still not work,
#158

@lldacing
Copy link
Author

lldacing commented Jan 8, 2025

hi, lldacing ,gguf still not work, #158

image

Please modify file brushnet_nodes.py, I think it will be work. (I haven't tested)

    if model.model.model_config.custom_operations is None:
        fp8 = model.model.model_config.optimizations.get("fp8", model.model.model_config.scaled_fp8 is not None)
        operations = comfy.ops.pick_operations(model.model.model_config.unet_config.get("dtype", None), model.model.manual_cast_dtype,
                                               fp8_optimizations=fp8, scaled_fp8=model.model.model_config.scaled_fp8)
    else:
        operations = model.model.model_config.custom_operations

@xueqing0622
Copy link

hi, lldacing ,gguf still not work, #158

image

Please modify file brushnet_nodes.py, I think it will be work. (I haven't tested)

    if model.model.model_config.custom_operations is None:
        fp8 = model.model.model_config.optimizations.get("fp8", model.model.model_config.scaled_fp8 is not None)
        operations = comfy.ops.pick_operations(model.model.model_config.unet_config.get("dtype", None), model.model.manual_cast_dtype,
                                               fp8_optimizations=fp8, scaled_fp8=model.model.model_config.scaled_fp8)
    else:
        operations = model.model.model_config.custom_operations

It works , thx lldacing, very cool!

@kadirnar
Copy link

This worked for me. Thanks ❤️

@buy3601223
Copy link

出现这个问题:'NoneType' object is not subscriptable ,无解了

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.

4 participants