Nodes/ComfyUI-ZML-Image/ZML_LLM 参数设置
ComfyUI Node

ZML_LLM 参数设置

The temperature, top-p, and timeout knobs for your LLM node

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_LLM 参数设置
    • 参数包
    温度0.70
    最大Token数-1
    核采样1.00
    频率惩罚0.00
    存在惩罚0.00
    超时时间120

    Every ZML LLM workflow needs a params input on the Chat node, and ZML_LLM_Parameters is the neat little box that supplies it. It's a settings bundle - six number fields in, one 参数包 (LLM_PARAMS) wire out. Nothing loads, nothing runs; it just exists so your sampling parameters have a visible home in the graph instead of being buried in a prompt.

    The six fields map straight onto standard chat-API parameters:

    • 温度 (temperature) - 0 to 2, default 0.7. Lower is more deterministic; 0.7 is a sane all-rounder. For JSON/structured output you'll often want it lower, like 0.2–0.4, because creativity actively hurts formatting.
    • 最大Token数 (max_tokens) - default -1, meaning "don't send it" (the node only forwards max_tokens when it's greater than 0). Set it when a model keeps stopping mid-reply on long captioning jobs.
    • 核采样 (top_p) - the "nucleus sampling" knob, 0 to 1, default 1 (off). Most people leave it at 1 and use temperature instead; they're two ways of controlling the same randomness budget.
    • 频率惩罚 (frequency_penalty) and 存在惩罚 (presence_penalty) - both -2 to 2, default 0. Frequency penalty discourages repeating words; presence penalty nudges the model to talk about new topics. Good for captioning loops that keep regurgitating the same tags.
    • 超时时间 (timeout) - 10 to 3600 seconds, default 120. This one matters more than people expect: the Chat node streams its response, and a slow API on a long prompt can blow past 120s, handing you an empty or partial reply. If you're captioning batches of images, bump this up.

    That's the whole node. Wire 参数包 into ZML_LLM_Chat's params socket and forget about it.

    The two things worth knowing beyond the labels. First, the node sends each field to the API only when it's actually meaningful: temperature and top_p always go, max_tokens only when positive, and the timeout is used client-side to bound the request. So a "default" bundle is genuinely fine for a first run - you can start with this node untouched and only tune when output misbehaves. Second, seed isn't here - it's a separate input on the Chat node, and it's only forwarded when > 0. If you want reproducible LLM output, set the seed there, and understand that many hosted APIs ignore seeds anyway, so don't chase it too hard.

    Install is pack-standard: ComfyUI Manager search "ComfyUI-ZML-Image", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-ZML-Image
    

    then restart. It shows up under ZML 图像 → LLM (Chinese UI unless you apply the English patch). No extra dependencies beyond what the pack already installs - this node doesn't even touch the network. If you're comfortable setting these on the Chat node's sibling nodes, you could skip it, but keeping the bundle visible is nicer for a workflow you'll revisit months later.

    Categoryimage/ZML_图像/LLM

    Inputs (6)

    NameTypeDefaultDescription
    温度FLOAT0.700–2
    最大Token数INT-1-1–32768
    核采样FLOAT1.000–1
    频率惩罚FLOAT0.00-2–2
    存在惩罚FLOAT0.00-2–2
    超时时间INT12010–3600

    Outputs (1)

    NameTypeDescription
    参数包LLM_PARAMS