Nodes/ComfyUI-LTX2-R2V/LTX2 R2V Browser LLM
ComfyUI Node

LTX2 R2V Browser LLM

An LLM node that runs entirely in your browser — no backend, no key on the server

By fangcun010·Created 7 months ago·Updated 7 months ago· 2
LTX2 R2V Browser LLM
  • image
  • text
system_prompt
prompt
api_endpointhttps://api.openai.com/v1/chat/completions
modelgpt-4o-mini
api_key
response

LTX2 R2V Browser LLM is the node that makes this whole pack click, and the first thing to know about it is that the "LLM" part is a slight trick. The Python side of this node does almost nothing - execute just echoes back whatever string is sitting in its response field. All the real work happens in your browser, where a JavaScript extension adds an Invoke button that calls an OpenAI-compatible chat completions endpoint and drops the reply straight into the response widget. No API key ever touches your backend, no Python dependencies, no server-side SDK. It's the sort of design that's either clever or a trap, and here it's mostly clever.

Why would you want an LLM inside a ComfyUI graph at all? LTX-2 is famously picky about its prompts - the community consensus is that it punishes short prompts and that writing long, structured ones by hand (or letting a good external model expand them from the official LTX-2 prompting guide template) meaningfully cuts your failure rate. This node is the author's shortcut for that: wire an LLM into your workflow so it can generate prompt text - and in this pack, specifically, the JSON that feeds the LTXVAddGuideMultiJsonFc and LTXVAddRefMultiJsonFc nodes. Think of it as a function-calling loop without leaving the graph.

How it works

The inputs that matter: system_prompt, prompt, api_endpoint (defaults to OpenAI's chat completions URL), model (defaults to gpt-4o-mini), api_key, and an optional image input. There's also a response field the frontend writes into. When you click Invoke, the browser builds the messages array, and if you've connected an image to the image input it grabs that image from the upstream node's own image widget and sends it as a base64 image_url - that's your free vision input, handy for describing a frame you want a guide JSON written from.

Then the API call happens directly from the page. On success the reply lands in response, which flows out of the single text output and can be piped anywhere a string is accepted - like into a JSON node's input. On failure, the button writes Error: <message> into the same field so you at least see what went wrong.

Gotchas worth knowing

  • The API key is stored in a browser cookie, not the workflow file. That's a privacy win (your key won't leak when you share a JSON workflow) but it means the key is machine-local - expect to re-enter it on a fresh browser.
  • Because the call is made by the page, a local endpoint like Ollama or LM Studio at localhost can hit CORS blocks. OpenAI's hosted API is fine; for local models you may need a server that sends CORS headers.
  • It only works when you actually run from the web UI - there's no button to press if you're executing headless via the API.

Install

It ships in the ComfyUI-LTX2-R2V pack, which has no requirements file and downloads no models - it leans entirely on ComfyUI's built-in LTX-2 stack, so keep ComfyUI current (this pack's other nodes need 0.8.1+ anyway).

cd ComfyUI/custom_nodes
git clone https://github.com/fangcun010/ComfyUI-LTX2-R2V

Restart ComfyUI and it's under LTX2. Or use ComfyUI Manager and search "ComfyUI-LTX2-R2V". One honest caveat: the repo is a single-commit, screenshots-only README with no real docs, so expect to poke at it - this node is the well-behaved part, and it's still worth a click before you judge the pack.

CategoryLTX2

Inputs (7)

NameTypeDefaultDescription
system_promptSTRINGSystem prompt passed to the LLM.
promptSTRINGUser prompt passed to the LLM.
api_endpointSTRINGhttps://api.openai.com/v1/chat/completionsOpenAI-compatible chat completions endpoint.
modelSTRINGgpt-4o-miniModel name to request.
api_keySTRINGAPI key (stored in browser cookie by frontend).
responseSTRINGLLM response populated by the frontend.
imageoptIMAGEOptional reference image input.

Outputs (1)

NameTypeDescription
textSTRING