Nodes/LoRA Txt Loader/LoRA Preview Saver
ComfyUI Node

LoRA Preview Saver

Your LoRA's Next Thumbnail Is One Click Away

By kwokkakiu233·Created 2 months ago·Updated 25 days ago· 2
LoRA Preview Saver
  • images
  • images
filename_prefixLoraPreview
lora_paths
lora_path_1
lora_path_2
lora_path_3
lora_path_4
lora_path_5
lora_path_6
lora_path_7
lora_path_8

LoRA Preview Saver is the one-click answer to a problem you've probably stopped noticing: half your LoRAs have no preview image, so your loader is a wall of gray placeholders and you're identifying models by filename memory. Every Civitai download ships with a thumbnail; your self-trained or long-ago-forgotten LoRAs don't, and nobody wants to crack open an image editor to fix that. This node closes the loop - when you generate an image you actually like with a LoRA, you save that very image as the LoRA's thumbnail. No new tool, no manual file juggling.

It's the newest node in the LoRA Txt Loader pack (kwokkakiu233's "optimized fork"), and it only makes sense as a companion to the pack's own loaders. Those loaders - LoRA Txt Loader and LoRA Txt Loader (From Path) - expose a lora_path output that points at the loaded .safetensors. That output is the handshake this node needs: it tells the saver which LoRA the image was made with. The same trigger-word-from-a-.txt philosophy carries over - everything is local, offline, and lives right next to the model file.

How it works

At the surface it's just an output node: you feed it images, it saves the batch to ComfyUI/output/ with your filename_prefix (default LoraPreview). The interesting part is the button on its face. Run the workflow once and the wired LoRA paths auto-fill into an editable lora_paths text area - the pack deliberately doesn't clobber your manual edits, it only fills paths you've actually connected. Then click 💾 Save as LoRA Previews. That button posts to the pack's /lora_txt_loader/save_lora_previews API, which for each path checks the file is really a model (.safetensors, .ckpt, etc. - it rejects .txt/.png paths so you can't accidentally overwrite something), checks whether a preview already exists, and if not, copies the saved image to {lora_name}.png sitting next to the model file.

That "skip if a preview exists" behavior is worth knowing: it will never overwrite a thumbnail you already have. LoRA with a preview gets skipped, LoRA without one gets saved, none present means all saved, both present means both skipped. Non-model paths come back as errors rather than silently writing junk.

The inputs that matter

  • images - connect from VAE Decode. The node still passes the tensor through as its images output, so it behaves like a Save Image you can keep inline.
  • filename_prefix - the output filename prefix, exactly like Save Image. Default LoraPreview.
  • lora_paths - the auto-filled, editable text area the button reads. This is the one you actually interact with.
  • lora_path_1lora_path_8 - optional inputs (up to eight) that accept the lora_path output of the pack's loaders. They're forceInput, so you wire them rather than type.

The workflow is: wire a LoRA Txt Loader's lora_path into lora_path_1 (and so on), wire VAE Decode into images, run, then delete any bypassed/muted LoRA lines from the text area before clicking save. If you leave a bypassed LoRA in the list, the saver happily writes your image as its preview even though it wasn't in the image - that's the one footgun, and it's why the README hammers "remove the ones you didn't use."

Install

Via ComfyUI Manager, search LoRA Txt Loader. Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/kwokkakiu233/comfyui-lora-txt-loader

Then restart ComfyUI. There are no extra dependencies - just Python stdlib plus the Pillow/numpy/torch that ship with ComfyUI. The saved {lora_name}.png is the same sidecar convention the pack's cascade browser hover reads, and anything else that honors Civitai-style previews will pick it up too. Thirty seconds of setup, and your LoRA folder finally stops looking like a missed connection ad.

Categoryloaders

Inputs (11)

NameTypeDefaultDescription
imagesIMAGE
filename_prefixSTRINGLoraPreview
lora_pathsSTRING
lora_path_1optSTRING
lora_path_2optSTRING
lora_path_3optSTRING
lora_path_4optSTRING
lora_path_5optSTRING
lora_path_6optSTRING
lora_path_7optSTRING
lora_path_8optSTRING

Outputs (1)

NameTypeDescription
imagesIMAGE