Comfy-Org / Comfy-Org/ComfyUI

Qwen2.5-VL text generation crashes: Qwen25_7BVLI_Config is missing stop_tokens

Open Beginner friendly
#15,032 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Description
Using a Qwen2.5-VL text encoder for text generation (e.g. the built-in `TextGenerate` node, or calling `clip.generate()` directly) crashes with:

AttributeError: 'Qwen25_7BVLI_Config' object has no attribute 'stop_tokens'

### Steps to reproduce
1. Load a Qwen2.5-VL text encoder (e.g. `Qwen2.5-VL-7B-Instruct` GGUF / safetensors).
2. Use the `TextGenerate` node, or call `clip.generate(prompt)` in code.
3. Generation starts and then raises `AttributeError` on `self.model.config.stop_tokens` inside `transformer.generate()` (comfy/text_encoders/llama.py).

### Root cause
`transformer.generate()` falls back to reading `self.model.config.stop_tokens` to know when to stop on EOS. Every other Qwen config in `comfy/text_encoders/llama.py` defines `stop_tokens = [151643, 151645]`, but `Qwen25_7BVLI_Config` omits it, so the attribute lookup fails.

### Expected
Generation completes and returns token ids (terminating on `<|im_end|>` / `<|endoftext|>`), instead of raising.

### Fix
Add `stop_tokens = [151643, 151645]` to `Qwen25_7BVLI_Config`. PR to follow.

Contributor guide

Open the contributing guide

Research direction

Open comfy/text_encoders/llama.py and inspect Qwen25_7BVLI_Config alongside the other Qwen configurations. Run the TextGenerate or clip.generate() reproduction with a Qwen2.5-VL encoder, then verify generation returns token IDs and terminates on the expected end tokens without the AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.