Nodes/ComfyUI-Florence2/DownloadAndLoadFlorence2Lora
ComfyUI Node Runs on cloud

DownloadAndLoadFlorence2Lora

Apply a caption finetune on top of base Florence-2

By kijai·Created 2 years ago·Updated 3 months ago· 1,728
DownloadAndLoadFlorence2Lora
    • lora
    model

    Let's be upfront: this is the niche one. It's a small helper node that fetches a LoRA adapter for Florence-2 and hands it out so you can bolt it onto a base model. It has exactly one download option and, judging by search traffic, almost nobody arrives here on purpose. But when you do want a finetuned Florence-2 without lugging around a whole separate model, this is the tidy way to get it.

    Here's the idea. A LoRA is a tiny low-rank adapter - a few megabytes of weights that nudge a base model's behavior in some direction - instead of a full multi-gigabyte finetuned checkpoint. Normally you'd grab a complete finetuned Florence-2 (CogFlorence, PromptGen, and so on) and load that directly. This node offers the other route: keep your base Florence-2, and layer just the adapter on top. Same base weights on disk, different captioning flavor at runtime.

    The one adapter it currently downloads is NikshepShetty/Florence-2-pixelprose, a caption-oriented finetune. That's the whole menu - the model input is an enum with a single choice. So this node isn't a general LoRA loader; it's specifically the on-ramp for that one finetune (and whatever kijai adds to the list later).

    How it works

    On execution the node pulls the adapter from Hugging Face - first run downloads it, later runs use the cache - and returns it as a PEFTLORA object. "PEFT" is Hugging Face's parameter-efficient finetuning library, the machinery that lets a small adapter modify a big frozen model. The node itself does the fetch-and-wrap; the actual merging happens downstream in the loader.

    The inputs and outputs that matter

    There's essentially one decision and one wire:

    • model (required) - the adapter to download. Right now that's just NikshepShetty/Florence-2-pixelprose.
    • lora (output, type PEFTLORA) - plug this into the lora input on Florence2ModelLoader. That's the only place it goes. The loader applies the adapter to whichever base Florence-2 you selected, and the combined model flows on to Florence2Run as usual.

    So the full chain is: DownloadAndLoadFlorence2LoraFlorence2ModelLoader (base model + this adapter) → Florence2Run. Skip the loader and there's nothing for the adapter to attach to.

    Common issues

    The big one is a mismatch trap: a LoRA only makes sense on the base it was trained against. The pixelprose adapter is for a specific Florence-2 base, so pairing it with an unrelated finetune can produce nonsense captions or an outright error. If you're not sure, load the plain base Florence-2 in the loader and let this adapter sit on top.

    The rest is standard pack hygiene. First run needs a working connection to Hugging Face to pull the adapter, and the whole pack expects its dependencies installed - transformers >= 4.38.0 plus PEFT from requirements.txt. If the node errors on a missing peft import, you cloned the repo without running the install step; do that and restart ComfyUI. And honestly - if you just want better captions and don't care about the LoRA plumbing, downloading a finetuned Florence-2 model whole is the simpler path. This node is for the case where the adapter route is genuinely what you want.

    CategoryFlorence2

    Inputs (1)

    NameTypeDefaultDescription
    modelCOMBO1 options: NikshepShetty/Florence-2-pixelprose

    Outputs (1)

    NameTypeDescription
    loraPEFTLORA