π€ Leon LLM Chat API
A vision-capable LLM call inside ComfyUI β with GPT-4o, Claude, Gemini and more
- input_image
- image_array
- response
Leon LLM Chat API is the pack's text brain: a chat-completion node that points at a standard OpenAI-style /v1/chat/completions endpoint (default https://api.hyprlab.io/v1/chat/completions) and returns the model's reply as a string. Wire a Model Selector into model, type a question into user_message, and the answer pops out as a response STRING you can route to a ShowText node, feed into a prompt builder, or use to drive the next step of a workflow.
What makes it more than a bare chat call is the vision support. There are three image inputs - input_image (a single IMAGE tensor), image_url (a hosted URL), and image_array (an IMAGE_ARRAY from the pack's Array Builder) - and the node assembles them into OpenAI-style content blocks so any vision-capable model you point it at can actually see what's in your graph. That's the workflow the pack's README highlights: LoadImage β LLM Chat API β Text Output, for captioning, "analyze this image", or critique loops on your own generations.
How it works
The node builds a messages array - optional system_message first, then a user message that may contain image content - and POSTs it with a Bearer token, reusing a shared LLM base class with the pack's 5-attempt exponential-backoff retry. The model name is a free-form string (default gemini-flash-latest), because the endpoint accepts a long list: the pack's own docs mention GPT-4o, Claude, Gemini and more.
The inputs that matter:
model- any model string the endpoint serves. This is where the Model Selector node plugs in.user_messageandsystem_message- the conversation. The system message sets behavior; leave it empty and the assistant has no special instructions.temperature(default 0.7),top_p(default 1.0),max_tokens(default 128000) - standard sampling controls.- The three image inputs for vision.
Single output: response (STRING).
Installing it
Pack-wide install:
cd ComfyUI/custom_nodes
git clone https://github.com/l3ony2k/comfyui-leon-nodes
pip install -r requirements.txt
Restart ComfyUI, or install "ComfyUI Leon Nodes" via ComfyUI Manager. Light dependencies, no local models - the model runs wherever your endpoint serves it.
Where people get burned
Three things. First, the endpoint and key matter: the default is HyprLab's OpenAI-compatible endpoint, so YOUR_HYPRLAB_API_KEY is a placeholder - but because api_url is exposed, you can repoint this node at any OpenAI-compatible API (OpenAI, OpenRouter, a local vLLM, whatever). A bad key fails slowly thanks to the retry backoff, so check the console. Second, keep image inputs to one path at a time: mixing an image_url with an input_image socket can produce a payload the model refuses. Third, max_tokens defaults to 128000 which is enormous - most replies don't need it, and some endpoints cap it lower. For text-in/image-out workflows that want an LLM to judge their own output, this is the pack's hub.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | STRING | gemini-flash-latest | Model name to use for chat completion |
| user_message | STRING | Hello! How can you help me today? | User message to send to the model |
| api_url | STRING | https://api.hyprlab.io/v1/chat/completions | API URL for chat completions |
| api_key | STRING | YOUR_HYPRLAB_API_KEY | Your HyprLab API key |
| system_messageopt | STRING | System message to set the assistant's behavior | |
| max_tokensopt | INT | 1280001β1048576 | Maximum number of tokens to generate |
| temperatureopt | FLOAT | 0.70β2 | Sampling temperature (0.0 to 2.0) |
| top_popt | FLOAT | 1.00β1 | Nucleus sampling parameter |
| input_imageopt | IMAGE | Optional single image input for vision-capable models | |
| image_urlopt | STRING | Optional image URL for vision-capable models | |
| image_arrayopt | IMAGE_ARRAY | Optional array of images (base64 or URLs) for vision-capable models |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | β |