HF Lora URL Builder
Type a repo and a filename, get a working HuggingFace URL
- lora_url
HuggingFace URLs have a shape: https://huggingface.co/<repo_id>/resolve/main/<filename>. Easy to type, easy to get one character wrong, and when you get it wrong the API silently fails or worse, resolves to something you didn't mean. This node exists to stop you typing them. You give it a repo ID and a filename, it gives you the correct, full resolve/main URL as a string. That's the whole node - and in an API-driven ComfyUI workflow where models travel as URLs, it's genuinely the thing you didn't know you needed.
Two required inputs, both plain strings:
repo_id- the HuggingFace repository, inowner/repoform, e.g.black-forest-labs/FLUX.2-klein-9B. Note the URL it builds always resolves againstmainas the revision, so if the file lives on a branch or tag, this node's simple form won't get you there.filename- the file inside that repo, e.g.lora.safetensors.
Single output: lora_url - the assembled https://huggingface.co/<repo_id>/resolve/main/<filename> string. It trims whitespace on both inputs, and if either is empty it returns an empty string rather than building a broken URL, which is a nice touch: a half-configured node degrades to nothing instead of a typo'd link.
Where it fits in the pack's flow: this is the first step of the LoRA chain - HF Lora URL Builder produces a single URL, HF Lora Combiner bundles several into an array, and the array feeds a generation node that accepts LoRA weights. For anything else that takes a model URL (a downloader, an API model selector), the output wires straight in as a string.
Under the hood it's trivially simple - it calls the same build_safetensor_url helper the pack's HuggingFace code uses everywhere, so it's consistent with the URLs the more magical HF Model Selector produces from its dropdown. No network, no API token, no cost. Another of the pack's few nodes that works on a bare install with zero environment variables set.
Install is the shared pack flow - ComfyUI Manager (search ComfyUI-API-DockerCPU), or:
cd ComfyUI/custom_nodes
git clone https://github.com/trustypangolin/ComfyUI-API-DockerCPU
cd ComfyUI-API-DockerCPU
pip install -r requirements.txt
Restart and look under π¨ DockerCPU API/π€ HuggingFace.
The honest limits: it only builds resolve/main URLs, so non-main revisions are out of reach without typing the URL manually; and it doesn't validate that the repo or file actually exists - garbage in, garbage URL out. If a downstream node reports a 404 or a "repo not found" error, check the two inputs for typos first, then check the file actually exists in the repo's main branch on HF. That's where this node's failures live: not in the URL building, but in what you typed into it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| repo_id | STRING | β | |
| filename | STRING | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| lora_url | STRING | β |