Nodes/Comfyui_CXH_Phi_3.5/CXH_Phi_chat_load
ComfyUI Node

CXH_Phi_chat_load

A local text model for ComfyUI, loaded by one node (no API key)

By StartHua·Created 2 years ago·Updated 2 years ago· 18
CXH_Phi_chat_load
    • phi_min_mode
    model
    attentioneager

    The pack's text-only half. CXH_Phi_chat_load drops Microsoft's Phi-3.5-mini-instruct onto your GPU and hands you a chat-ready handle - no API key, no internet once the model is downloaded, just a 3.8B model doing the talking. It's the lighter sibling of the vision loader in this pack, and honestly the one you'll use more if your workflows are about text rather than images: it's a smaller download, eats less VRAM, and it feeds a node that can rewrite prompts, answer questions, or summarize inside a graph.

    One naming note before you go looking for OpenAI: the pack files this under the CXH/GPT category, but the model is a local Phi. "GPT" here is aspirational - the node calls nothing, sends nothing anywhere.

    How it works

    On first run it snapshots the model from HuggingFace into ComfyUI/models/LLM/microsoft/Phi-3.5-mini-instruct - a ~4GB download, about half the vision model's weight - then loads it with AutoModelForCausalLM and an AutoTokenizer. Like its sibling, it's hard-pinned to CUDA (device_map="cuda", torch_dtype="auto") and loads with trust_remote_code=True. The repo is not gated and it's MIT licensed, so no HF token, no license click-through.

    Once loaded, ComfyUI caches the output, so the model stays resident in VRAM across runs - change your prompt in the chat node all day and this node never re-executes.

    Inputs and output

    Two inputs, one of which you'll never touch:

    • model - a dropdown with a single option, Phi-3.5-mini-instruct. It's a menu with one item.
    • attention - eager (default), sdpa, or flash_attention_2. Leave it on eager unless you have flash-attn working; more on that below.

    The output is phi_min_mode (type PHI_MIN_MODE), a bundle holding the model and tokenizer. It feeds the model input of CXH_Phi_chat_min, which is where the actual chat happens. Load node → run node, same shape as the vision half of this pack, minus the images.

    Install

    The pack's README is a stub (screenshots, "Fast, Fast, Fast!"), so use the standard route: ComfyUI Manager, search Comfyui_CXH_Phi_3.5, install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StartHua/Comfyui_CXH_Phi_3.5
    # restart ComfyUI, then run this node once to pull the ~4GB model
    

    Where people get burned

    • The flash_attn==2.5.8 pin in requirements.txt. It's a compiled CUDA extension and the most likely thing to make the pack's install fail. You don't need it on the default eager attention path - comment the line out and move on.
    • VRAM and CUDA. device_map="cuda" is hardcoded, so no CPU-only runs. On the plus side, a 3.8B model fits alongside most diffusion setups without the shuffle the 4.2B vision model causes on smaller cards.
    • First-run patience. That ~4GB snapshot download happens on the very first queue run, which reads as "ComfyUI is frozen" if you weren't warned. It isn't; watch your network.

    For context on why this class of node exists in the first place: ComfyUI's default graph has no concept of a language model, and every LLM custom node is an island installing into the same Python environment as everything else. That's fine for a two-node pipeline like this - just don't be surprised if a future LLM pack pins a different transformers and the two quietly disagree.

    CategoryCXH/GPT

    Inputs (2)

    NameTypeDefaultDescription
    modelCOMBO1 options: Phi-3.5-mini-instruct
    attentionCOMBOeager3 options: flash_attention_2, sdpa, eager

    Outputs (1)

    NameTypeDescription
    phi_min_modePHI_MIN_MODE