Comfy-Org / Comfy-Org/ComfyUI

[ERROR] !!! Exception during processing !!! 'CLIPTextModel' object has no attribute 'generate'

Open
#16,237 0 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

NOT CRASH

### Actual Behavior

CRASH

### Steps to Reproduce

Load Clip -> gemma-3-4b-it-vl (fb16 or whatever) -> Generate Text -> CRASH
ClipLoader (GGUF) -> gemma-3-4b-it-vl (gguf quant) -> Generate Text -> WORKS

### Debug Logs

```powershell
[ERROR] Traceback (most recent call last):
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\execution.py", line 545, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\execution.py", line 344, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\execution.py", line 318, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\execution.py", line 306, in process_inputs
result = f(**inputs)
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\comfy_api\internal\__init__.py", line 149, in wrapped_func
return method(locked_class, **inputs)
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\comfy_api\latest\_io.py", line 1935, in EXECUTE_NORMALIZED
to_return = cls.execute(*args, **kwargs)
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\comfy_extras\nodes_textgen.py", line 63, in execute
generated_ids = clip.generate(
tokens,
...<8 lines>...
seed=seed
)
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\comfy\sd.py", line 473, in generate
return self.cond_stage_model.generate(tokens, do_sample=do_sample, max_length=max_length, temperature=temperature, top_k=top_k, top_p=top_p, min_p=min_p, repetition_penalty=repetition_penalty, seed=seed, presence_penalty=presence_penalty)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\comfy\sd1_clip.py", line 750, in generate
return getattr(self, self.clip).generate(tokens, do_sample=do_sample, max_length=max_length, temperature=temperature, top_k=top_k, top_p=top_p, min_p=min_p, repetition_penalty=repetition_penalty, seed=seed, presence_penalty=presence_penalty)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "S:\AI\ComfyUI_windows_portable_26\ComfyUI\comfy\sd1_clip.py", line 318, in generate
return self.transformer.generate(embeds, do_sample, max_length, temperature, top_k, top_p, min_p, repetition_penalty, seed, presence_penalty=presence_penalty)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "S:\AI\ComfyUI_windows_portable_26\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1967, in __getattr__
raise AttributeError(
f"'{type(self).__name__}' object has no attribute '{name}'"
)
AttributeError: 'CLIPTextModel' object has no attribute 'generate'
```

### Other

Found the bug and code changes back to march, in open and closed issues. So I pull this one up. GGUF is so low, please fix this crap. And no I am not running the latest, most instable version ever. I run V30.

Contributor guide

Open the contributing guide

Research direction

Start at comfy_extras/nodes_textgen.py and trace the Generate Text call through comfy/sd.py and comfy/sd1_clip.py, using the reported Gemma-3-4b-it-vl workflow to reproduce the failure. Compare the standard ClipLoader path with the working GGUF path. Done means Generate Text completes without the reported AttributeError for the affected model.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
backend, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.