UrlExtract from Chat Response
Pull the URLs out of an API's chat response — image or video
- CONTENT
LLM and API nodes are chatty. Ask one to give you an image URL or a video link and it'll happily bury the actual link inside a paragraph of "Here is the image you requested: ..." prose. UrlExtract from Chat Response exists to strip that away. Feed it the raw response string and it hands you just the media URL (or URLs), formatted for the next node in your chain. It's the missing glue between "a model returned text" and "a loader wants a URL".
This is a genuinely useful little node in the right workflow. The pack's own Doubao Seedance node returns a response string containing a video URL - this is the node you'd chain after it to get a clean, loadable link. Same pattern applies anywhere a VLM or API answers in prose around an asset URL.
How it works
It's a URL-mining node with three modes, selected by content_type:
- text - passes the response through untouched. The "do nothing" mode, so the node always fits in a chain.
- image - extracts every http/https URL whose path ends in an image extension (
.jpg,.png,.webp,.gif, etc.), plus base64data:image/...data URIs via regex, dedupes them, and returns them comma-joined. - video - same idea for video extensions (
.mp4,.webm,.mov,.mkv...), deduped, and returns just the last URL.
It uses the urlextract library for robust URL finding and falls back to regex if that throws. The dedupe keeps the last occurrence per filename. Two details worth remembering: image mode returns a comma-separated list (which the pack's "Load Image from URL" node happily splits into a batch), and video mode returns exactly one URL - the last one found - because a video loader wants a single file.
The inputs that matter
response(STRING) - the chat/API output containing URLs. Wired in viaforceInput, so connect it rather than typing.content_type-text,image, orvideodropdown, defaulttext. This is the one you actually change.
Output: CONTENT (STRING) - the extracted, cleaned-up URL(s), comma-joined for images or single for video/text.
Installing it
Ships in AhBumm/ComfyUI_BillBum_Nodes. ComfyUI Manager search "billbum", or:
cd ComfyUI/custom_nodes
git clone https://github.com/AhBumm/ComfyUI_BillBum_APIset_Nodes.git
cd ComfyUI_BillBum_APIset_Nodes && pip install -r requirements.txt
Restart ComfyUI. Deps: the pack's usual set, with urlextract being the one this node actually leans on.
Where people get burned
- It filters by extension. A URL with no image/video extension (a signed blob link without
.png/.mp4in the path) won't match and you'll get an empty string. If a provider returns extension-less URLs, this node can't help - grab the link manually or use a different extractor. - Video mode drops all but the last URL. If you wanted all of them, that's the wrong mode.
- It returns text, not media. This node's output is a STRING; it still has to go into a load-image / load-video node (or the pack's url2image) before you have frames or a file.
textmode is a passthrough - if you expected it to clean up formatting, look at the pack's "Regular ResponseText to 1linePrompt" node instead.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| response | STRING | — | |
| content_type | COMBO | text | 3 options: text, image, video |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONTENT | STRING | — |