Generate (Qwen)
Generate (Qwen) — prove a feature actually steers, in plain text
- model
- steer
- text
- info
Generate (Qwen) is the node that closes the loop on the whole pack: run a Qwen model's text generation with your steer plan active, and read whether the steering actually changed what the model says. It's model.generate() wrapped as a ComfyUI node, with an optional steer input that installs residual-steering hooks for the duration of the generation.
Why text generation matters when your goal is images: it's the cheapest, clearest way to verify a direction before you commit it to an image workflow. Steer a feature and ask the model to continue a prompt - if feature #8231 really is "seafaring" or whatever, the completion will drift in that direction, and you'll see it in a sentence instead of squinting at image differences. It's your ground-truth instrument for feature hunting.
How it works
Standard sampling with the knobs you'd expect - temperature, top_p, top_k, repetition_penalty, seed, max_new_tokens. A couple of behaviors worth knowing: temperature = 0 switches to greedy decoding (sampling only happens when temperature > 0), and seed only applies when non-zero - leave it at 0 for unseeded runs.
The steering part is where it gets interesting. If a steer plan is wired in, the node parses the plan's layer_spec against the model's actual layer count, scales each layer's weight by strength, and installs forward hooks on the residual stream inside a context manager - so the hooks live for exactly this generation and are removed when it finishes. Unlike Steer CLIP's persistent hooks, this is self-cleaning: no Clear CLIP Steering needed, because nothing leaks.
The inputs that matter
- model -
QSCOPE_MODELfrom Load Qwen Model. - prompt - the text to generate from. Use
template=thinkorno_thinkto match the ChatML format you'd actually use with Qwen. - steer (optional) - any
QSCOPE_STEER: from Feature → Direction, Load Lens, Combine Lenses, Train Lens, anywhere. No steer = plain generation, which is also useful as a baseline. - max_new_tokens - default 128, up to 4096. Short runs are enough to see steering effects.
Outputs: text - the generated continuation - and info reporting whether steering was applied, from what source, and how many layers it touched.
Installing it
Part of the one pack: ComfyUI Manager → search "ComfyUI QwenScope", or
cd ComfyUI/custom_nodes
git clone https://github.com/Nynxz/ComfyUI-QwenScope
restart. Dependencies (transformers, huggingface_hub, safetensors, Pillow, numpy) are the usual set. The model itself downloads from HF on first load - start with Qwen3.5-2B, which fits comfortably in VRAM alongside an image stack.
Common issues
The big one is VRAM: a 9B or 27B model for text generation is a lot of extra resident memory on top of your diffusion model, and the pack only keeps one LLM loaded at a time. If generation feels sluggish or OOMs, drop to the 2B and keep your analysis there. Also remember seed does nothing at 0 - if you're chasing reproducibility, set a real seed. And if steering produces nonsense at strength around 1, that's not a bug: it's a single-feature nudge, and features are narrow. That's when you grab a trained lens instead.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | QSCOPE_MODEL | — | |
| prompt | STRING | Once upon a time | — |
| template | COMBO | raw | 3 options: raw, think, no_think |
| max_new_tokens | INT | 1281–4096 | — |
| temperature | FLOAT | 0.700–2 | — |
| top_p | FLOAT | 0.950–1 | — |
| top_k | INT | 400–1000 | — |
| repetition_penalty | FLOAT | 1.050–2 | — |
| seed | INT | 00–4294967295 | — |
| skip_special_tokens | BOOLEAN | true | — |
| steeropt | QSCOPE_STEER | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| info | STRING | — |