ComfyUI Node Runs on cloud

OpenAI API

Connect GPT models to your ComfyUI graph

By sipherxyz·Created 3 years ago·Updated 4 months ago· 352
OpenAI API
    • LLM_API
    openai_api_key
    endpointhttps://api.openai.com/v1

    This is the "connect to OpenAI" node in the ArtVenture LLM set. It doesn't run a prompt on its own - it takes your API key, builds a connection, and outputs an LLM_API handle that the pack's LLM Chat or LLM Completion nodes use to actually talk to the model. Setup node, not a generation node. Wire it in once and forget it.

    What you do with it downstream is where the value is. GPT models are great at the text-shaped chores that surround image generation: writing and expanding prompts, captioning an input image (the vision models read pictures), turning a rough idea into a detailed description, or rewriting a prompt into a different style. Instead of hand-writing every prompt, you let a language model draft it inside the same workflow that renders it. That's the loop this node opens.

    How it works

    It assembles an API config aimed at OpenAI's endpoint, carrying your key, and passes it downstream. The request itself - which model, what messages, whether an image is attached - happens in the LLM node you connect this to. Because it's a plain endpoint config, it also works against anything that speaks the OpenAI protocol, which is the sleeper feature covered below.

    Inputs and outputs

    Two required inputs:

    • openai_api_key - your key from OpenAI. Typed straight into the node as a string.
    • endpoint - defaults to https://api.openai.com/v1. Usually left alone, but it's editable, and that's deliberately useful.

    The output is LLM_API - into an ArtVenture LLM Chat or LLM Completion node.

    The endpoint field is the interesting part

    Because you can change endpoint, this node isn't locked to OpenAI. Tons of tools - local runners like Ollama and LM Studio, and other providers - expose an OpenAI-compatible API. Point endpoint at one of those and you can drive a local model with the same node, no OpenAI account or bill involved. For anyone who wants LLM-assisted prompting without sending images and text to a third party, that's the move.

    Installing it

    Ships with the ArtVenture pack. ComfyUI Manager: search comfyui-art-venture, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sipherxyz/comfyui-art-venture
    

    Restart ComfyUI. No model download for the hosted path - the model lives on OpenAI's servers. For the local route, you run the model server yourself.

    Common issues

    Your key is saved into the workflow. The key gets typed into the node, so it's written into the workflow JSON and travels with the file. Don't share a workflow with a live key in it - strip it first, and rotate the key if you already have. On shared or cloud runners, assume anything in the graph is visible.

    401 or quota errors. Bad/expired key, or an account with no credit. Verify the key and billing on OpenAI's dashboard.

    Vision model won't read an image. Only certain models accept image input, and the image has to be wired into the downstream LLM node, not here. Pick a vision-capable model in the chat node and confirm the image input is connected there.

    Local endpoint refuses the connection. If you've repointed endpoint at a local server, make sure it's actually running and reachable, and that the model name you request downstream matches what that server serves. A wrong model ID there surfaces as an error even when this node is fine.

    CategoryArtVenture/LLM

    Inputs (2)

    NameTypeDefaultDescription
    openai_api_keySTRING
    endpointSTRINGhttps://api.openai.com/v1

    Outputs (1)

    NameTypeDescription
    LLM_APILLM_API