vLLM-T2I丨API
Text-to-image through your vLLM-Omni server, two endpoints in one node
- image
- raw_response
- status
- debug_info
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/completionswith your prompt as a user message, and tucks the generation parameters -width,height,num_inference_steps,true_cfg_scale,top_p,repetition_penalty,seed, andnegative_promptif provided - into anextra_bodyblock. vLLM-Omni reads those extra fields and returns an image in the chat response.images_generations- the OpenAI-style/v1/images/generationsendpoint, used in vLLM-Omni's LoRA examples and some other setups. Here the request is a flat OpenAI image call:sizeas"WxH",n(how many images),response_format(b64_jsonorurl), plustop_pandrepetition_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- defaulthttp://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 intoextra_body.true_cfg_scaleon the chat path. Note it's true_cfg_scale here - the I2I sibling usesguidance_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. Readraw_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_formatappear to do nothing. You're on thechat_completionspath where they're ignored. Switch toimages_generationsif you need batches.- Image looks soft or unguided.
true_cfg_scaleof 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.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | 图像生成提示词 | |
| negative_prompt | STRING | 负面提示词;若后端支持会随请求提交 | |
| platform | COMBO | vLLM | 服务平台(用于动态拉取 /v1/models) |
| model | STRING | default | 模型 id |
| base_url | STRING | http://127.0.0.1:8091 | 服务根地址 |
| t2i_endpoint | COMBO | chat_completions | chat_completions 为 vLLM-Omni 文档主路径;images_generations 用于部分 LoRA 等场景 |
| width | STRING | 1024 | 宽度(字符串整数) |
| height | STRING | 1024 | 高度(字符串整数) |
| num_inference_steps | INT | 501–250 | — |
| true_cfg_scale | FLOAT | 4.000–30 | 写入 extra_body.true_cfg_scale;更多参数请使用 advanced_options |
| top_p | FLOAT | 0.900–1 | — |
| repetition_penalty | FLOAT | 1.100.5–2 | — |
| seed | INT | 00–2147483647 | — |
| n | INT | 11–4 | 仅 images_generations 生效;n>1 时输出 IMAGE 批次 |
| response_format | COMBO | b64_json | 仅 images_generations 生效 |
| timeout_sec | INT | 1205–600 | — |
| api_keyopt | STRING | 留空时使用环境变量或 QING 配置 | |
| advanced_optionsopt | STRING | 高级选项节点输出的 JSON(可通过 custom_json 兜底扩展) |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| raw_response | STRING | — |
| status | STRING | — |
| debug_info | STRING | — |