BlenderNeko / ComfyUI_Cutoff

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

'SDXLClipModel' object has no attribute 'clip_layer' #26

Open kakachiex2 opened 3 months ago

kakachiex2 commented 3 months ago

Error occurred when executing BNK_CutoffRegionsToConditioning_ADV:

'SDXLClipModel' object has no attribute 'clip_layer'

File "K:\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "K:\ComfyUI\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 "K:\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "K:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_Cutoff\cutoff.py", line 300, in finalize return finalize_clip_regions(clip_regions, mask_token, strict_mask, start_from_masked, token_normalization, weight_interpretation) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "K:\ComfyUI\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 "K:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_Cutoff\cutoff.py", line 192, in encode_from_tokens embsl, = advanced_encode_from_tokens(tokenized['l'], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "K:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_Cutoff\adv_encode.py", line 183, in advanced_encode_from_tokens weighted_emb, pooled_base = encode_func(weighted_tokens) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "K:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_Cutoff\cutoff.py", line 195, in lambda x: encode_token_weights(clip, x, encode_token_weights_l), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "K:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_Cutoff\adv_encode.py", line 226, in encode_token_weights model.cond_stage_model.clip_layer(model.layer_idx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "K:\ComfyUI\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1688, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")

KorDum commented 3 months ago

Check this I'm waiting for the developers to pay attention :)

kakachiex2 commented 3 months ago

Thanks @KorDum I added the fix from the link temporally, but I prefer the dev fix because it works but give some strange behaviors and I get lot of warning in the console.