Nodes/24oiduts-ComfyUI/πŸ€– Qwen Text Generator
ComfyUI Node

πŸ€– Qwen Text Generator

A real LLM inside ComfyUI β€” if your VRAM can feed it

By GeekyGhostΒ·Created 12 months agoΒ·Updated 10 months agoΒ· 0
πŸ€– Qwen Text Generator
    • output
    β—„promptOnce upon a timeβ–Ί
    β—„model_sizeQwen2-7Bβ–Ί
    β—„max_tokens100β–Ί
    β—„temperature0.7β–Ί
    β—„top_p0.90β–Ί
    β—„system_promptβ–Ί

    This is the node that actually does what the name says. Qwen Text Generator loads a real Qwen language model through HuggingFace transformers and runs it locally inside your ComfyUI graph. No API keys, no cloud calls - just a model that gets downloaded once and cached. It comes from the 24oiduts-ComfyUI pack (Studio42's "LCARS Edition"), which is worth knowing about because the same pack's "Wan" nodes do not do what their names say. This one does.

    Before you get excited, the honest part: the smallest choice here is Qwen2-7B, and the list goes up to Qwen-14B and Qwen-72B. Those are multi-gigabyte fp16 downloads on first use, and 7B still wants a decent GPU to generate at a usable pace. The 72B option is basically a joke on consumer hardware unless you have an unusual amount of VRAM or offload patience. Most people who reach for this node are either experimenting or already have Qwen weights cached from something else.

    What you set

    The inputs that matter are few:

    • prompt - your actual request. This is a raw LLM, not a diffusion prompt, so "write a haiku about a coffee machine" works.
    • model_size - Qwen-7B, Qwen-14B, Qwen-72B, or Qwen2-7B. Pick the smallest thing that fits your VRAM; Q8-era quantization tricks don't apply here, this node runs fp16 through AutoModelForCausalLM.
    • max_tokens - how long the reply can be. 100 is a short paragraph, 2048 is the cap.
    • temperature and top_p - the usual sampling knobs. Temperature 0.7, top_p 0.9 are sane defaults; drop temperature toward 0.1 for deterministic output.
    • system_prompt - optional, and where you steer persona or constraints. Leave blank and it just answers directly.

    It's a LCARSModelNode, so the model is loaded once and cached in memory. Your second generation after the first is dramatically faster than your first.

    What comes out

    The node hands you back the generated text to wire into any STRING input - prompt builders, text encoders, downstream formatting, whatever. The comfy.icu schema lists the output as output. One quirk of this pack: the schema metadata is loose, and if transformers isn't installed the node doesn't hard-fail, it silently returns a [FALLBACK] Generated text for... placeholder string. That's how you can end up "generating text" that's just the first 50 characters of your prompt. Check the ComfyUI console for a ⚠️ transformers not available warning if output looks canned.

    Installing it

    This node ships in the 24oiduts-ComfyUI pack, which you install once:

    • ComfyUI Manager: search for 24oiduts (pack title 24oiduts-ComfyUI), install, restart.
    • Manual:
      cd ComfyUI/custom_nodes/
      git clone https://github.com/GeekyGhost/24oiduts-ComfyUI
      cd 24oiduts-ComfyUI
      pip install -r requirements.txt
      then restart ComfyUI.

    The pack's requirements.txt lists transformers and timm for the AI bits - the README on GitHub is a stale Studio42 template that warns the project is "not recommended for use at this time" with no license. It's a template nobody updated; the code installs and runs fine. Just don't read the README as gospel.

    Troubleshooting

    • First run downloads for a long time. A 7B model is several GB from HuggingFace. This is normal, not a hang.
    • Out of memory: drop to Qwen2-7B or free VRAM. If ComfyUI's own model is already loaded, they share the card.
    • Placeholder text output: transformers isn't in your environment. pip install transformers inside the same venv as ComfyUI, restart.

    The big takeaway: this is one of the few genuinely-AI nodes in this pack, and it's a great way to get an LLM talking to your diffusion graph - as long as you respect the VRAM cost.

    CategoryStudio42/LCARS/Models

    Inputs (6)

    NameTypeDefaultDescription
    promptSTRINGOnce upon a timeβ€”
    model_sizeCOMBOQwen2-7B4 options: Qwen-7B, Qwen-14B, Qwen-72B, Qwen2-7B
    max_tokensINT1001–2048β€”
    temperatureFLOAT0.70.1–2β€”
    top_pFLOAT0.900–1β€”
    system_promptoptSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    outputIMAGEβ€”