LLM 图像编码器
Package an Image for a Multimodal Model
- image
- LLM_CONTENT_ITEM
LLMImageEncoder ("LLM 图像编码器") is the node that lets a vision-language model actually see an image inside this pack. It takes a ComfyUI IMAGE - whatever your Load Image node spat out - and repackages it into an LLM_CONTENT_ITEM, the pack's transport format for content that gets handed to the LLM. From there it wires into LLMTextGenerator's optional content_part inputs, and the model finally gets to look at your picture and tell you what it thinks.
Don't overthink what this node does, because it does exactly one thing. It takes the image tensor, clamps and converts it back to uint8, re-encodes it as a PNG, base64-encodes that, and bundles the result with a PIL copy. That's it. The image doesn't get analyzed here - this node does zero "understanding." It's packaging. The model you connect downstream does the seeing, and only if you loaded it in multimodal mode on LLMModelLoader. People get this wrong: they wire an image encoder into a text-only model and wonder why nothing happens. The model has to be vision-capable (Qwen2.5-VL, Gemma3, the Qwen3-VL family), and it has to be in multimodal mode, or the image is dropped with a warning.
What you actually do with it
The common workflow is captioning: load an image, run it through LLMImageEncoder, feed the result to LLMTextGenerator alongside a "describe this image in detail" prompt, and get a natural-language caption out. That's the VLM-captioning pattern from the wider ecosystem - the same job JoyCaption and Florence-2 do, just powered by whatever multimodal model you chose to load locally instead of a dedicated captioner. It's also how you seed an img2img or image-to-video workflow from an existing image: the model reads the picture and writes the prompt for it, in the same graph.
Inputs and outputs
- image - a standard ComfyUI
IMAGE. The only input, and the tooltip spells it out: "The image to be encoded into an LLM-compatible format." - output - one
LLM_CONTENT_ITEM, which you connect tocontent_part_1(or 2/3) on LLMTextGenerator.
If you want to send both an image and some text at once, you'll want the pack's LLMTextBlockNode for the text half and LLMContentConnector to merge them into one list before it hits the generator.
Installing it
Same pack, same steps, once: ComfyUI Manager → search comfyui-ez-llm, or:
cd ComfyUI/custom_nodes
git clone https://github.com/spawner1145/comfyui-ez-llm
Restart. Dependencies are transformers + accelerate, and the models live in models/LLM/<name>/ as full HuggingFace repos.
One honest limitation to carry into your expectations: multimodal models are heavier than the small text models this pack usually targets, and they share your card with the diffusion model. Keep force_offload on in the loader so it unloads between calls, and don't be surprised when the first caption after an idle stretch takes a while - that's the model reloading, not a hang. And if captions on multi-subject images keep mixing up who's wearing what, that's not this node or even your model being dumb - that's the one failure mode every VLM still shares.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | 需要编码成LLM可用的图像格式的图片。/ The image to be encoded into an LLM-compatible format. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LLM_CONTENT_ITEM | LLM_CONTENT_ITEM | — |