WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.19k stars 178 forks source link

NameError: name 'res' is not defined, line 12692, in encode #117

Closed cbaoth closed 1 year ago

cbaoth commented 1 year ago

https://github.com/WASasquatch/was-node-suite-comfyui/blob/f6b9c67d2fb6881764b6c38a8a15f32aeb7b1e66/WAS_Node_Suite.py#L12692

Error:

WAS Node Suite Warning: It doesn't seem ComfyUI_ADV_CLIP_emb is up to date. Falling back to legacy method.
!!! Exception during processing !!!
Traceback (most recent call last):
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 145, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 68, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui\WAS_Node_Suite.py", line 12692, in encode
    return ([[res[0][0][0], {}]], new_text, text, { "ui": { "string": new_text } } )
NameError: name 'res' is not defined

Solution:

It appears with your latest commit you mixed up the encode and res variables from the former try-catch block, now assigning encode but using the no longer existing res in the return statement. Replacing res with encode should fix the issue:

encode = AdvancedCLIPTextEncode().encode(clip, new_text, token_normalization, weight_interpretation)
return ([[encode[0][0][0], {}]], new_text, text, { "ui": { "string": new_text } } )
WASasquatch commented 1 year ago

Oh yeah, cause blenderneko added and removed affective pool outputs and that was a condition block. I have already patched that but spaced on pushing..