Nodes/Hugging Face LoRA Uploader/Hugging Face LoRA Uploader
ComfyUI Node

Hugging Face LoRA Uploader

Ship your trained LoRA to Hugging Face without leaving the graph

By vioaki·Created about a year ago·Updated 10 months ago· 0
Hugging Face LoRA Uploader
    • status_message
    lora_name
    hf_tokenhf_YOUR_HUGGINGFACE_TOKEN_HERE
    repo_idusername/repo_name
    commit_messageUpload LoRA model via ComfyUI
    path_in_repo
    create_repo_if_not_existstrue
    private_repofalse

    If you've ever trained a LoRA, you know the actual hard part is done the moment the .safetensors lands in models/loras. The last fiddly step is publishing it - logging into the Hugging Face website, dragging a file into a browser tab, or fumbling through huggingface-cli in a terminal. This node deletes that step. It's a small, dead-simple "output" node that takes a LoRA sitting in your ComfyUI folder and pushes it to a Hugging Face model repo, all from inside the graph. You run your workflow, it uploads, done.

    It's for people who actually train - the node does nothing to help you generate. There's no inference, no image output, just a status string. But if you're using ai-toolkit or kohya and share your results publicly (or just want a backup off your disk), this is the missing piece between "trained" and "shared." It's also a nice fit for the workflow-sharing culture of ComfyUI: your whole training-and-publish pipeline lives in one JSON file.

    How it works

    The name is a small lie: it doesn't call some external upload API service. Under the hood it uses Hugging Face's own huggingface_hub Python library (the HfApi class) - the exact same machinery the huggingface-cli command wraps. The node checks whether your target repo exists, optionally creates it with the correct privacy setting, then uploads the file with your commit message. Because it's the official library, everything that's true about the HF website applies here: your token needs write permission on the target repo (or on your account, for new ones).

    The inputs that matter

    The required set is small, and you'll set four of them:

    • lora_name - a dropdown of every LoRA ComfyUI currently sees in models/loras. Heads up: that list is snapshotted when ComfyUI starts, so a freshly trained LoRA won't appear until you restart.
    • hf_token - your Hugging Face access token (Settings → Access Tokens). It must start with hf_; the node rejects anything else before making a single network call.
    • repo_id - target repository in username/repo_name or org/repo_name format.
    • commit_message - describe the upload; whatever you type becomes the repo commit message.

    The optional trio is where the useful tweaks live. path_in_repo drops the file into a subfolder like loras/ - handy for repos that hold several LoRAs. create_repo_if_not_exists defaults to true, so you can point at a repo that doesn't exist yet and the node makes it for you. private_repo (default false) controls privacy for newly created repos.

    The single output, status_message, is a string: a URL to the uploaded file on success, or a plain-English error on failure. Wire it into a Text node if you want it visible on the canvas instead of buried in the console.

    Installing it

    The straightforward way is ComfyUI Manager: search for "Hugging Face LoRA Uploader" (or the pack name ComfyUI-HuggingFaceLoraUploader) and install. Otherwise:

    cd ComfyUI/custom_nodes
    git clone https://github.com/violet0927/ComfyUI-HuggingFaceLoraUploader.git
    cd ComfyUI-HuggingFaceLoraUploader
    pip install -r requirements.txt
    

    Then restart ComfyUI. One genuine trap: the README's own Quick Start shows git clone https://github.com/vioaki/... - a typo for violet0927, and that URL goes nowhere. Use the one above. The requirements.txt installs huggingface_hub and modelscope; the pack imports both even if you only use this HF node, so both land in your environment. Manager handles all this automatically.

    Common issues

    The big one: your token is in your workflow JSON, in plain text. The README warns about this explicitly. If you share a workflow that ran this node, you've shared your token. Generate a fresh token per purpose and never post a workflow containing one - or accept that you'll be rotating tokens.

    401 / 403 errors during the run mean your token can't write to that repo: check that it has write permission, or that you own (or are a member of) the target repo. "Invalid repository ID" before any network call just means repo_id lacked a slash. And if your LoRA isn't in the dropdown, restart ComfyUI - the list only refreshes at startup. Slow uploads on big LoRAs are normal; the node is just pumping a file over the network.

    It's a quiet, single-purpose utility with zero flash - but if you publish LoRAs on Hugging Face at all, it's the one you'd reach for.

    CategoryUploaders/HuggingFace

    Inputs (7)

    NameTypeDefaultDescription
    lora_nameCOMBO1 options: None (Ensure LoRA paths are set and files exist)
    hf_tokenSTRINGhf_YOUR_HUGGINGFACE_TOKEN_HERE
    repo_idSTRINGusername/repo_name
    commit_messageSTRINGUpload LoRA model via ComfyUI
    path_in_repooptSTRING
    create_repo_if_not_existsoptBOOLEANtrue
    private_repooptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    status_messageSTRING