Nodes/ComfyUI-QING/vLLM-T2I丨API
ComfyUI Node

vLLM-T2I丨API

Text-to-image through your vLLM-Omni server, two endpoints in one node

By sheengoa·Created about a year ago·Updated 20 days ago· 16
vLLM-T2I丨API
    • image
    • raw_response
    • status
    • debug_info
    prompt
    negative_prompt
    platformvLLM
    modeldefault
    base_urlhttp://127.0.0.1:8091
    t2i_endpointchat_completions
    width1024
    height1024
    num_inference_steps50
    true_cfg_scale4.00
    top_p0.90
    repetition_penalty1.10
    seed0
    n1
    response_formatb64_json
    timeout_sec120
    api_key
    advanced_options

    VLLMT2IAPI is the text-to-image member of the QING vLLM trio. Give it a prompt, and it asks a running vLLM-Omni server to generate an image, then drops the result back into the graph as a normal IMAGE tensor - ready for a Preview or Save node like any locally-sampled output.

    Display name: "vLLM-T2I丨API".

    The two endpoint paths (this is the important choice)

    The node's t2i_endpoint dropdown picks which HTTP path the request takes, and they behave differently:

    • chat_completions (default) - the vLLM-Omni documented main path. The node POSTs to <base_url>/v1/chat/completions with your prompt as a user message, and tucks the generation parameters - width, height, num_inference_steps, true_cfg_scale, top_p, repetition_penalty, seed, and negative_prompt if provided - into an extra_body block. vLLM-Omni reads those extra fields and returns an image in the chat response.
    • images_generations - the OpenAI-style /v1/images/generations endpoint, used in vLLM-Omni's LoRA examples and some other setups. Here the request is a flat OpenAI image call: size as "WxH", n (how many images), response_format (b64_json or url), plus top_p and repetition_penalty.

    So the two knobs that say "only images_generations" in their tooltips - n and response_format - are exactly that: on the default chat path they're ignored. Set t2i_endpoint first, then the path-specific settings make sense.

    What you'll actually set

    • prompt, negative_prompt - the generation text.
    • model - the model id, matching the server's /v1/models.
    • base_url - default http://127.0.0.1:8091, your vLLM server.
    • width / height - strings, not numbers, in this node. Default "1024"/"1024".
    • num_inference_steps - default 50.
    • true_cfg_scale - default 4.0. This is the Flux-family guidance parameter vLLM-Omni expects; it's written into extra_body.true_cfg_scale on the chat path. Note it's true_cfg_scale here - the I2I sibling uses guidance_scale - so don't copy settings across the two nodes blindly.
    • seed, top_p, repetition_penalty, timeout_sec - the rest.
    • Outputs: image (IMAGE), raw_response, status, debug_info.

    The advanced_options input merges in extra JSON from VLLMAdvancedOptions on top of everything, which is how you add guidance scale, CFG, resolution, layers, or a LoRA without waiting for new widgets.

    The OOM safety net (a genuinely nice touch)

    If the server responds with a CUDA out-of-memory error, the node detects it and does two things: it returns a placeholder image instead of crashing your run, and it appends hints to raw_response - drop to 768×640 or lower, cut steps to 20–30, or restart the server with PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True. It's a small thing, but it turns the most common failure mode from "mystery placeholder" into "actionable advice."

    Installing it

    Ships in ComfyUI-QING:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GAO-SHIQING/ComfyUI-QING
    cd ComfyUI-QING
    python install_dependencies.py
    

    Restart ComfyUI, or install "ComfyUI-QING" via ComfyUI Manager.

    Troubleshooting

    • Placeholder image + status error. Read raw_response - it's the server's own message. Connection refused means no server on that port; 400 usually means a bad model id or a param the endpoint doesn't accept.
    • n / response_format appear to do nothing. You're on the chat_completions path where they're ignored. Switch to images_generations if you need batches.
    • Image looks soft or unguided. true_cfg_scale of 4.0 is a starting point, not a law; some models want 3–7. Move one knob, compare, repeat.
    • Took ages then failed. Raise timeout_sec (max 600) - big diffusion requests at 50 steps can exceed the default 120s on a busy server.

    As with its siblings, this node runs no model itself - it's an HTTP client for a server that does (external-api-nodes.md). If you already have a vLLM-Omni instance serving an image model, it's the fastest way to get that model's output into a ComfyUI graph as a first-class IMAGE.

    CategoryQING/API

    Inputs (18)

    NameTypeDefaultDescription
    promptSTRING图像生成提示词
    negative_promptSTRING负面提示词;若后端支持会随请求提交
    platformCOMBOvLLM服务平台(用于动态拉取 /v1/models)
    modelSTRINGdefault模型 id
    base_urlSTRINGhttp://127.0.0.1:8091服务根地址
    t2i_endpointCOMBOchat_completionschat_completions 为 vLLM-Omni 文档主路径;images_generations 用于部分 LoRA 等场景
    widthSTRING1024宽度(字符串整数)
    heightSTRING1024高度(字符串整数)
    num_inference_stepsINT501–250
    true_cfg_scaleFLOAT4.000–30写入 extra_body.true_cfg_scale;更多参数请使用 advanced_options
    top_pFLOAT0.900–1
    repetition_penaltyFLOAT1.100.5–2
    seedINT00–2147483647
    nINT11–4仅 images_generations 生效;n>1 时输出 IMAGE 批次
    response_formatCOMBOb64_json仅 images_generations 生效
    timeout_secINT1205–600
    api_keyoptSTRING留空时使用环境变量或 QING 配置
    advanced_optionsoptSTRING高级选项节点输出的 JSON(可通过 custom_json 兜底扩展)

    Outputs (4)

    NameTypeDescription
    imageIMAGE
    raw_responseSTRING
    statusSTRING
    debug_infoSTRING