ComfyUI Node

GLHF Chat

Run a 70B LLM to write your prompts, no GPU of your own

By fairy-root·Created 2 years ago·Updated about a year ago· 4
GLHF Chat
    • STRING
    promptEnter your prompt here...
    seed0
    modelLlama3.3 70b
    Console_logtrue
    enable_web_searchfalse
    num_search_results5
    keep_contexttrue
    custom_instructionNone

    Having an LLM write your image prompt isn't a fringe trick anymore - it's how a lot of people work now. If your model's text encoder is a language model reading an instruction (Flux, Z-Image, Anima, Qwen and friends all are), then getting another language model to write that instruction is just translating between two things that speak the same language. GLHF Chat is one node that bolts that step into your graph. You type a rough idea, it hands the idea to a big chat model, and you get polished text back out the other side.

    The twist, and the reason most people find this node: the model doesn't run on your machine. GLHF stands for glhf.chat, a hosted inference service that runs open Hugging Face models behind an OpenAI-compatible API. So even on a "potato PC" you can call Llama 3.3 70B or a 32B reasoner, because glhf.chat's servers do the heavy lifting. And it ships an uncensored (abliterated) Llama 3.3 70B, which matters more than it sounds - mainstream assistants refuse to help polish a spicy prompt, and demand for a model that just... does it is real and current. That's the differentiated reason to reach for this over a generic LLM node.

    How it works

    Under the hood the node is thin and honest: it sends your prompt, plus whichever system instruction you picked, to glhf.chat's OpenAI endpoint using an API key you paste into config.json, and returns the reply as text. Turn on web search and it goes a step further - it runs a Google search, scrapes the result pages with BeautifulSoup, and staples that text onto your prompt so the model can answer with fresh information. Leave context on and it remembers previous turns, so you can iterate ("now make it nighttime") instead of re-explaining every run.

    Inputs and outputs that matter

    There are a lot of toggles, but only a few earn your attention:

    • prompt - your text. Multiline, so write freely.
    • model - the dropdown is populated from config.json. Out of the box: Llama3.3 70b (the sensible default), QWQ 32b (a reasoning model, slower, better at hard multi-step asks), and Llama3.3 70b Uncensored (the one people actually came for).
    • custom_instruction - this is the sleeper. It's a dropdown of .txt system prompts from the custom_instructions folder. Set it to prompt generator and the node stops chatting and starts behaving like a dedicated image-prompt writer. Ships with python and custom instruction maker too, and you can drop in your own file.

    The rest - seed, the console-logging toggle, keep_context, enable_web_search, num_search_results (1–10) - are situational. The single output is one STRING. Wire it straight into a CLIP Text Encode's text input to prompt from it, or into a show-text node if you just want to read what it wrote before committing.

    Installing it

    Two ways, same as any node. In ComfyUI Manager, search "ComfyUI-GLHF" and install. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fairy-root/ComfyUI-GLHF.git
    

    Then install its deps - pip install openai requests bs4 googlesearch-python (the README shows the portable python_embeded path if you're on the Windows build) - and restart ComfyUI.

    The step everyone skips: the node does nothing until you sign up at glhf.chat, grab an API key from your settings page, and paste it into config.json in the node folder. No key, no output.

    Where people get burned

    The biggest thing to know isn't a bug, it's a dependency: this node is only as alive as glhf.chat. The service was free during its beta, and a "free API" that hinges on someone else's beta pricing is not a promise - if they change plans, your node changes with them. Budget for that.

    Web search is the flakiest feature. It leans on googlesearch-python, which scrapes Google, and Google throttles scrapers - so expect it to intermittently return nothing or garbage. Treat it as a bonus, not a load-bearing part of your graph, and leave it off unless you actually need live info.

    Worth saying plainly: your prompt leaves your computer and goes to a third party's servers. That's the trade for running a 70B model you can't host. If that's a dealbreaker, config.json has a baseurl field - point it at a local OpenAI-compatible server (koboldcpp, Ollama, LM Studio) and keep everything on your own box. And the usual ComfyUI reminder applies: custom nodes are arbitrary Python, so it's worth a glance at any node's code before you trust it with a key.

    One small gotcha to round it out: if you add a new .txt instruction file, it won't show in the dropdown until you restart ComfyUI.

    CategoryGLHF

    Inputs (8)

    NameTypeDefaultDescription
    promptSTRINGEnter your prompt here...
    seedINT0
    modeloptCOMBOLlama3.3 70b3 options: Llama3.3 70b, QWQ 32b, Llama3.3 70b Uncensored
    Console_logoptBOOLEANtrue
    enable_web_searchoptBOOLEANfalse
    num_search_resultsoptINT51–10
    keep_contextoptBOOLEANtrue
    custom_instructionoptCOMBONone4 options: None, prompt generator, python, custom instruction maker

    Outputs (1)

    NameTypeDescription
    STRINGSTRING