ComfyUI Node

API Function

A plain HTTP request node for pulling data into your graph

By heshengtao·Created 2 years ago·Updated 2 months ago· 2,370
API Function
  • parameters
  • text
◄url被请求的网址►
◄api_key►
◄request_typeget►
◄timeout60►

Not every API call in an agent workflow should be left up to the LLM to decide on. Sometimes you already know exactly which endpoint you want hit and when - you just need the response text flowing into your graph. API Function is that: a plain, synchronous HTTP request node that fires the moment your workflow runs, no LLM judgment involved. It's the "app link" counterpart to api_tool, which wraps the same idea as something the agent chooses to call.

How it works

You give it a URL, and when the graph executes, it makes the request - GET or POST, your choice - and hands back whatever text comes back in the response. There's no decision-making here: this isn't a tool an LLM invokes conditionally, it's a node that runs every time, like any other step in the graph. Use it to pull data in before the LLM sees it (fetch a webpage, hit an internal API, check a status endpoint) or to push data out after the LLM has produced something.

The inputs and outputs that matter

  • url - the endpoint being called. No default beyond a placeholder reminding you to fill it in.
  • api_key - sent along with the request for endpoints that need authentication.
  • parameters - a DICT of whatever the request needs, sent as query params on a GET or as the body on a POST.
  • request_type (get / post, default get) and timeout (default 60 seconds) - the two knobs beginners actually need to touch: switch to post if you're submitting data rather than fetching it, and raise timeout if you're hitting something slow.
  • One output: text - the raw response body, ready to feed straight into an LLM's prompt, a persona builder, or wherever it needs to go.

How to install it

  • ComfyUI Manager - search "comfyui_LLM_party", install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/heshengtao/comfyui_LLM_party, then restart.

Then run pip install -r requirements.txt from inside the comfyui_LLM_party folder, in your ComfyUI Python environment (python_embeded\python.exe -m pip install -r requirements.txt on portable Windows). No special dependency beyond the pack's baseline requirements - this node just wraps a standard HTTP client call.

Common issues & troubleshooting

Request times out. The default 60-second timeout is generous for most APIs but not infinite - if you're calling something genuinely slow (a report-generation endpoint, a cold-starting serverless function), bump the timeout rather than assuming the node is broken.

Response comes back but the LLM can't parse it. text is the raw response - if the API returns JSON, you're getting a JSON string, not parsed fields. Downstream nodes or the LLM itself need to handle that structure; the node doesn't unpack it for you.

Be careful what you paste into api_key and url. This node runs unconditionally with whatever credentials you put on it, saved in your workflow JSON. If you share a workflow file, double-check you haven't left a live API key baked into the node before posting it publicly - custom-node ecosystems in general have a well-documented history of credentials leaking exactly this way, so treat any node that stores a key as something to scrub before sharing.

The pack won't load at all. Separate from this node, there's a real and current install failure mode where comfyui_LLM_party installs via Manager but nodes still refuse to import - usually a CUDA/PyTorch mismatch with no clear supported-version list to check against. Rule that out first if api_function isn't appearing in your node browser.

Category大模型派对(llm_party)/APP链接(app link)

Inputs (5)

NameTypeDefaultDescription
urlSTRING被请求的网址—
api_keySTRING—
parametersDICT—
request_typeoptCOMBOget2 options: get, post
timeoutoptINT60—

Outputs (1)

NameTypeDescription
textSTRING—