Upload To HuggingFace
Push your finished LoRA straight to the Hub from ComfyUI
- network_trainer
- network_trainer
- status
You just trained a LoRA. Now you want it off your machine and somewhere you can pull it from - a cloud pod, a friend's setup, or just backup. UploadToHuggingFace pushes the trained file straight to a Hugging Face repo without you ever leaving the ComfyUI graph. It's a convenience node that closes the loop: train, save, upload, all on one canvas.
It's especially handy if you train on a rented GPU. Finish the run, upload to the Hub as the last node in your workflow, and the file's safe before you tear the instance down. That last part is the real value - losing a finished LoRA because you shut a pod down before copying it off is a mistake everyone makes exactly once.
How it works
The node takes the network_trainer (NETWORKTRAINER) so it knows about the run, plus the details of where to send the file:
source_path- the path to the file you're uploading (the LoRA that FluxTrainEnd or FluxTrainSaveModel wrote).repo_id- the destination repo, inusername/repo-nameform. It'll be created if it doesn't exist.revision- an optional branch/revision to push to.private(default true) - whether the repo is private. It defaults to private, which is the sane choice; flip it off deliberately if you mean to publish.token(optional) - your Hugging Face write token. Without a valid token with write access, the upload can't authenticate.
Outputs are the forwarded network_trainer and a status string telling you how the upload went.
Installing the pack
ComfyUI Manager: search ComfyUI Flux Trainer, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-FluxTrainer
pip install -r ComfyUI-FluxTrainer/requirements.txt
Torch 2.4.0+ recommended, plus kijai's ComfyUI-KJNodes for the example workflows.
Common issues
Auth failures. The overwhelmingly common problem. You need a Hugging Face token with write permission - a read token won't do it. Generate one in your HF account settings and pass it to token. Check the status output if the upload silently didn't happen.
Careful with private. It defaults to true, which is good. If you flip it to false you're publishing to the world - fine if that's the plan, a surprise if it isn't. Double-check before uploading anything you don't want public, especially given what people train LoRAs on.
Wrong source_path. The node uploads whatever file the path points at. If you get the path wrong you'll upload nothing, or the wrong file. Wire it from the lora_path / model_path output of your End or Save node rather than typing it by hand, and confirm the file exists first.
Uploading mid-run vs at the end. Because the node takes the trainer object, you can slot it into the graph at various points - but the usual place is after FluxTrainEnd, once you actually have a final file worth keeping. Uploading a half-baked intermediate checkpoint just clutters your repo. Decide which checkpoint is the keeper first (that's what the validation previews are for), then upload that one.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| network_trainer | NETWORKTRAINER | — | |
| source_path | STRING | — | |
| repo_id | STRING | — | |
| revision | STRING | — | |
| private | BOOLEAN | true | If creating a new repo, leave it private |
| tokenopt | STRING | DO NOT LEAVE IN THE NODE or it might save in metadata, can also use the hf_token.json |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| network_trainer | NETWORKTRAINER | — |
| status | STRING | — |