ComfyUI Node

LLM Client

The config node that powers Image2Markdown

By ciga2011·Created 2 years ago·Updated about a year ago· 9
LLM Client
    • llm_client
    base_url
    api_key
    model
    promptWrite a detailed description for this image.

    This node doesn't do anything by itself, and that's the first thing to understand about it. LLM Client is a wiring node: it bundles an OpenAI-compatible endpoint, API key, model name, and a prompt into a single LLM_CLIENT object that the pack's Image2Markdown node consumes. Nothing calls an API when you run this node - it just packages the config. If you never convert images, you can skip it entirely.

    Why it exists

    Microsoft's markitdown can describe images, but only if you hand it an LLM client to talk to. The pack needs a way to configure that client inside the graph, and this is it. The README's sample workflow uses Groq, but any OpenAI-compatible endpoint works: OpenAI itself, Groq, or a local server like Ollama or LM Studio with a vision model loaded. Local is nice - no key, no network, and your images never leave your machine.

    The inputs that matter

    Four fields, all strings, all required by the schema:

    • base_url - the endpoint. Leave blank or point at your server; defaults from the DEFAULT_LLM_BASE_URL env var if set.
    • api_key - your key for cloud endpoints; can be anything for local servers. Defaults from DEFAULT_LLM_API_KEY.
    • model - the model name the endpoint expects (e.g. a Groq vision model or llava on Ollama). Defaults from DEFAULT_LLM_MODEL.
    • prompt - the instruction sent alongside the image. The default, "Write a detailed description for this image.", is honestly fine for most uses.

    The pack runs load_dotenv() at import, so you can put those three DEFAULT_LLM_* variables in a .env file in the folder ComfyUI launches from and leave the fields blank.

    What you get out

    One output: llm_client, a LLM_CLIENT wire that you connect directly into WIZ_IMAGE2MARKDOWN's llm_client input. That's the entire job. Think of it as a config card you fill in once and leave on the canvas.

    Installing it

    Same pack, same story as every node here - ComfyUI Manager, search "ComfyUI MarkItDown", install, restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ciga2011/ComfyUI-MarkItDown
    

    The requirements pull in openai, which is the client library this node uses under the hood. No model downloads.

    Gotchas

    The model you name must be vision-capable, because markitdown sends the image as a base64 data URI in a chat.completions call - a text-only model errors out. And remember this node is inert on its own: if you run a workflow with an LLM Client and see no output worth keeping, that's expected. The actual API call happens when Image2Markdown runs, and that's also when your API key actually gets used.

    CategoryMarkItDown

    Inputs (4)

    NameTypeDefaultDescription
    base_urlSTRING
    api_keySTRING
    modelSTRING
    promptSTRINGWrite a detailed description for this image.

    Outputs (1)

    NameTypeDescription
    llm_clientLLM_CLIENT