shiimizu / ComfyUI_smZNodes

Custom nodes for ComfyUI such as CLIP Text Encode++
GNU General Public License v3.0
190 stars 14 forks source link

SDXL Refiner error when using A1111 parser #13

Closed masslevel closed 11 months ago

masslevel commented 11 months ago

When setting the parser to A1111 the smZ CLIPTextEncode node connected to a sampler using the SDXL Refiner model shows the following error:

'NoneType' object has no attribute 'wrapped'
!!! Exception during processing !!!
Traceback (most recent call last):
  File "f:\ai\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "f:\ai\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "f:\ai\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "f:\ai\ComfyUI\custom_nodes\ComfyUI_smZNodes\nodes.py", line 57, in encode
    result = run(**params)
  File "f:\ai\ComfyUI\custom_nodes\ComfyUI_smZNodes\smZNodes.py", line 693, in run
    cond, pooled = clip_clone.encode_from_tokens(tokens, True)
  File "f:\ai\ComfyUI\comfy\sd.py", line 120, in encode_from_tokens
    cond, pooled = self.cond_stage_model.encode_token_weights(tokens)
  File "f:\ai\ComfyUI\custom_nodes\ComfyUI_smZNodes\smZNodes.py", line 545, in encode_token_weights
    try: g_out, g_pooled = self.clip_g.encode_token_weights(token_weight_pairs_g, steps, current_step, multi)
  File "f:\ai\ComfyUI\custom_nodes\ComfyUI_smZNodes\smZNodes.py", line 468, in encode_token_weights
    model_hijack.hijack(self)
  File "f:\ai\ComfyUI\custom_nodes\ComfyUI_smZNodes\modules\sd_hijack.py", line 110, in hijack
    model_embeddings = m.transformer.text_model.embeddings
AttributeError: 'SdConditioning' object has no attribute 'transformer'
masslevel commented 11 months ago

The refiner pass works without a problem now. Thank you!