BlenderNeko / ComfyUI_Cutoff

cutoff implementation for ComfyUI
GNU General Public License v3.0
344 stars 21 forks source link

Error occurred when executing BNK_CutoffRegionsToConditioning #24

Open Tornenado0 opened 3 months ago

Tornenado0 commented 3 months ago

Error occurred when executing BNK_CutoffRegionsToConditioning:

'SDXLClipModel' object has no attribute 'clip_layer'

File "C:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\StableDiffusion\ComfyUI_windows_portable\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 "C:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "C:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Cutoff\cutoff.py", line 282, in finalize return finalize_clip_regions(clip_regions, mask_token, strict_mask, start_from_masked) File "C:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Cutoff\cutoff.py", line 225, in finalize_clip_regions base_embedding_full, pool = encode_from_tokens(clip, base_weighted_tokens, token_normalization, weight_interpretation, True) File "C:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Cutoff\cutoff.py", line 192, in encode_from_tokens embsl, = advanced_encode_from_tokens(tokenized['l'], File "C:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Cutoff\adv_encode.py", line 183, in advanced_encode_from_tokens weighted_emb, pooled_base = encode_func(weighted_tokens) File "C:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Cutoff\cutoff.py", line 195, in lambda x: encode_token_weights(clip, x, encode_token_weights_l), File "C:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Cutoff\adv_encode.py", line 226, in encode_token_weights model.cond_stage_model.clip_layer(model.layer_idx) File "C:\StableDiffusion\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1614, in getattr raise AttributeError("'{}' object has no attribute '{}'".format(

KorDum commented 3 months ago

@Tornenado0 hello! You can replace a line in the same file as I did
https://github.com/BlenderNeko/ComfyUI_Cutoff/pull/25/commits/cc300a3e4cc1a51f91ffce020681d944ba33f1c1

Tornenado0 commented 3 months ago

@KorDum this solution is working for me, thank you