Nodes/ComfyUI_ChatGLM_API/Glm_Lcoal_Or_Repo
ComfyUI Node

Glm_Lcoal_Or_Repo

The boring GLM-4 selector node your local chat nodes are built around

By smthemex·Created 2 years ago·Updated 2 years ago· 25
Glm_Lcoal_Or_Repo
    • repo_id
    local_model_path
    repo_id

    Glm_Lcoal_Or_Repo is the unglamorous glue of this pack - a one-output helper that decides which GLM-4 model the local nodes use. You won't care about it until you hit the local chat nodes, and then you'll care a lot, because both Glm_4_9b_Chat and Glm_4v_9b expose their repo_id as a forced input: they refuse to accept a typed-in value and demand a wire. This node exists to hand them that wire.

    How it works

    It's a picker, not a runner - no model gets loaded here. You choose either a HuggingFace repo id or a folder on disk, and the node just returns the resolved string. The two inputs are:

    • repo_id - an enum with none plus four presets: THUDM/glm-4-9b-chat, THUDM/glm-4v-9b, THUDM/glm-4-9b, and THUDM/glm-4-9b-chat-1m (the 1M-context variant). Pick one and you're done.
    • local_model_path - a dropdown that scans ComfyUI/models/diffusers for folders containing a model.safetensors.index.json (i.e. locally-downloaded GLM diffusers checkpoints). If you have none, it reads none and you ignore it.

    The logic: if you picked a repo id, that's the output. If repo_id is none but a local path is set, it converts the folder name into a full absolute path under models/diffusers. If both are none, the source raises a blunt "you need choice repo_id or download model in diffusers directory".

    Output: a STRING named repo_id, wired straight into the repo_id input of Glm_4_9b_Chat or Glm_4v_9b. That's the entire job.

    The one thing to know about the name

    "Lcoal" isn't your typo - it's the author's, baked into the class name. It also has nothing to do with the cloud API half of this pack: no config.json, no API key, no network. It's purely local plumbing.

    Installing it

    Part of the pack - install once, get all six nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/smthemex/ComfyUI_ChatGLM_API
    

    Restart ComfyUI. The node lives under ChatGlm_Api in the menu. No model downloads happen here - the download triggers later, when the chat/vision node first loads whatever repo you selected (budget ~20GB for glm-4-9b-chat, ~26GB for glm-4v-9b).

    This is a three-second node once you understand it, but it's mandatory infrastructure if you want the local nodes to work at all. Think of it as the power socket the rest of the local half plugs into.

    CategoryChatGlm_Api

    Inputs (2)

    NameTypeDefaultDescription
    local_model_pathCOMBO1 options: none
    repo_idCOMBO5 options: none, THUDM/glm-4-9b-chat, THUDM/glm-4v-9b, THUDM/glm-4-9b, THUDM/glm-4-9b-chat-1m

    Outputs (1)

    NameTypeDescription
    repo_idSTRING