# ComfyUI LoRA Manager

> **Revolutionize your workflow with the ultimate LoRA companion for ComfyUI!**

[![Discord](https://img.shields.io/discord/1346296675538571315?color=7289DA&label=Discord&logo=discord&logoColor=white)](https://discord.gg/vcqNrWVFvM)
[![Release](https://img.shields.io/github/v/release/willmiao/ComfyUI-Lora-Manager?include_prereleases&color=blue&logo=github)](https://github.com/willmiao/ComfyUI-Lora-Manager/releases)
[![Release Date](https://img.shields.io/github/release-date/willmiao/ComfyUI-Lora-Manager?color=green&logo=github)](https://github.com/willmiao/ComfyUI-Lora-Manager/releases)

A comprehensive toolset that streamlines organizing, downloading, and applying LoRA models in ComfyUI. With powerful features like recipe management, checkpoint organization, and one-click workflow integration, working with models becomes faster, smoother, and significantly easier. Access the interface at: `http://localhost:8188/loras`

![Interface Preview](https://github.com/willmiao/ComfyUI-Lora-Manager/blob/main/static/images/screenshot.png)

## 📺 Tutorial: One-Click LoRA Integration
Watch this quick tutorial to learn how to use the new one-click LoRA integration feature:

[![One-Click LoRA Integration Tutorial](https://github.com/willmiao/ComfyUI-Lora-Manager/blob/main/static/images/video-thumbnails/getting-started.jpg)](https://youtu.be/hvKw31YpE-U)

## 🌐 Browser Extension
Enhance your Civitai browsing experience with our companion browser extension! See which models you already have, download new ones with a single click, and manage your downloads efficiently.

![LM Civitai Extension Preview](https://raw.githubusercontent.com/wiki/willmiao/ComfyUI-Lora-Manager/wiki-images/civitai-models-page.png)

<div>
  <a href="https://chromewebstore.google.com/detail/lm-civitai-extension/capigligggeijgmocnaflanlbghnamgm?utm_source=item-share-cb" style="display: inline-block; background-color: #4285F4; color: white; padding: 8px 16px; text-decoration: none; border-radius: 4px; font-weight: bold; margin: 10px 0;">
    <img src="https://www.google.com/chrome/static/images/chrome-logo.svg" width="20" style="vertical-align: middle; margin-right: 8px;"> Get Extension from Chrome Web Store
  </a>
</div>

<div id="firefox-install" class="install-ok"><a href="https://github.com/willmiao/lm-civitai-extension-firefox/releases/latest/download/extension.xpi">📦 Install Firefox Extension (reviewed and verified by Mozilla)</a></div>

📚 [Learn More: Complete Tutorial](https://github.com/willmiao/ComfyUI-Lora-Manager/wiki/LoRA-Manager-Civitai-Extension-(Chrome-Extension))

---

## 🤝 Supporter Recognition

I'm incredibly grateful to everyone who has supported the development of this project. Seeing so many people value my work is the best motivation I could ask for. Your trust and support have played a vital role in shaping this tool into what it is today, and I want to personally recognize those who have helped make it possible.

<!-- SUPPORTERS-START -->

### 🌟 Special Thanks

**dispenser**, **EbonEagle**, **DanielMagPizza**, **Scott R**

### 💖 Supporters (922)

<details>
<summary>Click to view all awesome supporters</summary>
<br>

megakirbs, Brennok, 2018cfh, Rob Williams, Insomnia Art Designs, Arlecchino Shion, Charles Blakemore, stone9k, Mozzel, Gingko Biloba, Kiba, $MetaSamsara, onesecondinosaur, Christian Byrne, DM, Sen314, Estragon, W+K+White, Rosenthal, ClockDaemon, Francisco Tatis, Tobi_Swagg, SG, Andrew Wilson, Greybush, Ricky Carter, JongWon Han, VantAI, レプサイ, Michael Wong, Illrigger, Tom Corrigan, JackieWang, FreelancerZ, fnkylove, Robert Stacey, PM, Edgar Tejeda, Sterilized, Polymorphic Indeterminate, Liam MacDougal, Skalabananen, Marc Whiffen, Dogwalkerbr, Birdy, quarz, jean jahren, Reno Lam, Aleksander Wujczyk, AM Kuro, JSST, sig, J\B/ 8r0wns0n, Snaggwort, wackop, Phil, Carl G., Anthony+Rizzo, Dsperado, Baekdoosixt, Jonathan Ross, KD, Omnidex, Nolife_M, Melville Parrish, daniel dove, Tyler Trebuchon, Release Cabrakan, JW Sin, Alex, carozzz, Marlon Daniels, James Dooley, zenbound, Buzzard, jmack, Adam Shaw, Mark Corneglio, SarcasticHashtag, RedrockVP, James Todd, Wicked Choices by ASLPro3D, FinalyFree, Fyf, Timmy, Johnny, Tak, Lisster, Big Red, whudunit, Yushio, Vik71it, Bishoujoker, Echo, Lilleman, Todd Keck, Briton Heilbrun, wildnut, BadassArabianMofo, itismyelement, Pascal Dahle, Greg, Akira HentAI, MiraiKuriyamaSy, otaku fra, lmsupporter, andrew.tappan, Greenmoustache, wfpearl, Jack B Nimble, Lustre, JaxMax, bh, Jwk0205, Starkselle, Aaron Bleuer, LacesOut!, greebles, Some Guy Named Barry, M Postkasse, Jacob Hoehler, Matt Wenzel, Weasyl, Lex Song, Cory Paza, Gonzalo Andre Allendes Lopez, runte3221, Serge Bekenkamp, AIJimmy, Luc Job, dl0901dm, Philip Hempel, corde, dan, aai, Fraser Cross, Ran C, ViperC, Sangheili460, MagnaInsomnia, Karl P., Adam Taylor, Weird_With_A_Beard, Takkan, N/A, The Spawn, graysock, Pozadine1, Qarob, AIGooner, Luc, ProtonPrince, DiffDuck, zounic, fancypants, John+Edwards, jeaness, ElitaSSJ4, Matt+J, Joboshy, Digital, Bohemian Corporal, Dan, Bro Xie, yer fey, batblue, carey6409, Olive, 太郎 ゲーム, Roslynd, jinxedx, Resist's Creations - Spicy Edition 🔥, AELOX, Wolffen, Dankin-Pics, Nicfit23, Cristian Vazquez, wamekukyouzin, drum matthieu, DogmaR34, Frank Nitty, Magic Noob, Christopher Michel, DougPeterson, LeoZero, Antonio Pontes, nwalker94, kushiroK9, Kevin John Duck, Dustin Chen, Blackfish95, Tori, Mouthlessman, Paul Kroll, Bas Imagineer, John Statham, Dušan Ryban, LarsesFPC, decoy, elu3199, Hasturkun, Jon Sandman, Ubivis, CloudValley, thesoftwaredruid, wundershark, mr_dinosaur, Tyrswood, Ray Wing, Ranzitho, Gus, MJG, linnfrey, griffin+dahlberg, contrite831, Josef Lanzl, Nerezza, sanborondon, Error_Rule34_Not_found, jcay015, Erik Lopez, Mateo Curić, Geolog, Neco28, Eris3D, David Ortega, Gooohokrbe, OldBones, Zach Gonser, a _, Jeff, Bruce, James Coleman, Kevin Christopher, Chad Idk, dd, Sam, Penfore, Gordon Cole, sjon kreutz, AbstractAss, Metryman55, AlexDuKaNa, 地獄の禄, David LaVallee, ae, Tr4shP4nda, Gamalonia, capn, Joseph, Mirko Katzula, dan, Piccio08, kumakichi, cppbel, Moon Knight, Kland, Hailshem, Naomi Hale Danchi, epicgamer0020690, Joshua Porrata, Jackthemind, takyamtom, Andrew, Brian M, Robert Wegemund, Littlehuggy, aezin, Thought2Form, RAIDiation, Sadlip, m, FloPro4Sho, Pierce McBride, Mikko Hemilä, Jacob McDaniel, Jamie Ogletree, Temikus, Artokun, Michael Taylor, Steven Owens, Martial, Emil Andersson, Ouro Boros, Atilla Berke Pekduyar, Decx _, Yuji Kaneko, Rops Alot, Saya, Xeeosat, Ace Ventura, yuxz69, 四糸凜音, esthe, ken, Crocket, keemun, SuBu, RedPIXel, Wind, Nexus, Ramneek“Guy”Ashok, squid_actually, Nat_20, Edward Weeks, kyoumei, RadStorm04, JohnDoe42054, BillyHill, emyth, chriphost, KitKatM, socrasteeze, MudkipMedkitz, deanbrian, Alex Wortman, Cody, emadsultan, InformedViewz, Bubbafett, leaf, Adam Rinehart, IamAyam, gzmzmvp, Aberr, Andrew Marshall, Gregory Kozhemiak, Brian Buie, Taylor Funk, Gerald Welly, Tee Gee, tarek helmi, Eric Whitney, Joey Callahan, Ivan Tadic, Max Marklund, Mike Simone, John J Linehan, Joshua Gray, Elliot E, Morgandel, Theerat Jiramate, X, SloanSteddyAI, hexxish, Derek Baker, lh qwe, conner, Michael Anthony Scott, Princess Bright Eyes, NICHOLAS BAXLEY, Ed Wang, Douglas Gaspar, George, dw, FrxzenSnxw, WRL_SPR, momokai, 몽타주, kudari, OrganicArtifact, ResidentDeviant, Ginnie, CHKeeho80, Skyfire83, Pitpe11, TheD1rtyD03, moonpetal, g9p0o, Pkrsky, TheHolySheep, Monte Won, SpringBootisTrash, carsten, ikok, quantenmecha, Jason+Nash, DarkRoast, letzte, Nasty+Hobbit, Sora+Yori, Duk3+Rand0m, Nathen+Choi, T, David Schenck, Richard, Wolfe7D1, 奚明 刘, 준희 김, elleshar666, ACTUALLY_the_Real_Willem_Dafoe, Михал Михалыч, Kauffy, Tomohiro Baba, Noora, Edward Kennedy, Nick Kage, Noah, Vane Holzer, psytrax, Cyrus Fett, Xenon Xue, notedfakes, Steam Steam, Michael Scott, CryptoTraderJK, Davaitamin, Solixer, Nathan, Jimmy Borup, tedcor, Wes Sims, Fotek Design, Donor4115, Filippo Ferrari, Nihongasuki, MadSpin, inbijiburu, Nick “Loadstone” D, starbugx, dc7431, Whitepinetrader, Raku, Vir, nanana, Alex, Karru, ChaChanoKo, ghoulars, redcarrot, null, Beau, powerbot99, Fthehappy, Ko-fi+Supporter, J, Alan+Cano, FeralOpticsAI, Pavlaki, Doug+Rintoul, Noor, Yorunai, D, lrdchs2, Draven T, Time Valentine, りん あめ, Matt, Aquatic Coffee, Frogmilk, ethanfel, SPJ, Kor, Joseph Hanson, Bryan Rutkowski, Focuschannel, Anthony Faxlandez, battu, TenaciousD, Dmitry Ryzhov, DarkSunset, Edward Ten Eyck, Pat Hen, Pete Pain, Jordan Shaw, RHopkirk, jinksta187, g unit, Manu Thetug, Maxim, Lyavph, Distortik, JC, Prompt Pirate, uwutismxd, Marcus thronico, zenobeus, Inversity, ryoma, Stryker, smart.edge5178, Menard, SomeDude, raf8osz, Sildoren, Darv, Seon+Song, 2turbo, Dmitry+Viznesenskiy, tanjin90, sternenkrieger, Pascalou, Patrick+Bryan, lighthawke, low9, Winged, boston666, YassineKhaled, Y, MatteKey, gumbyte, Flob, ShiroSenpai, Inkognito, Tan+Huynh, Bob+Barker, Dark_Pest, Eldithor, cocona, blikkies, JBsuede, Tú Nguyễn Lý Hoàng, shira1011, Kalli Core, Ben D, G, Ronan Delevacq, Shock Shockor, Goldwaters, Zude, Dave Abraham, Joaquin Hierrezuelo, Locrospiel, Sean voets, Jarrid Lee, Poophead27 Blyat, Kyler, John Rednoulf, Justin Blaylock, Boba Smith, aRtFuL_DodGeR, MR.Bear, matt, somethingtosay8, ivistorm, Sauv, Steven, Ted Cart, Sage Himeros, Billy Gladky, Probis, Zeeble, Tania Nayelli Fernandez, Draconach, Tigon, ItsGeneralButtNaked, Karlanx, operationancut, Marcos Tortosa Carmona, Dkom22, Youguang, andrewzpong, BossGame, lrdchs, Tree Tagger, AIVORY3D, Kevinj, Mitchell Robson, dg, POPPIN, bakeliteboy, Nick, Gold_miner_ego, IshouI;_;, Monix, Trolinka, PredragR, Clauzmak, Nerick, SundayRage, matter, SRCRCOSS, imer, Akkas+Haque, AZ+Party+Oasis, Kevin+Isom, Kachac, SAVEagleBasement, Adam+Spreer, Rune+Osnes, PoorStudent, Alex+Zaw, Supporter, ExLightSaber, Mobius2020, YaboiRay, BillyBoy84, Buecyb99, Welkor, dubious1one, Obsidian.Studios, Zomba Mann, Aquaneo, moranqianlong, Wolf and Fox Legends, Neko Desco, Ninja Tom, Vinarus, Christian Schäfer, Josh Snyder, Leslie Andrew Ridings, Room Light, Patryk Serious, Kyron Mahan, Mythspire, Snorklebort, TBitz33, Anonym dkjglfleeoeldldldlkf, TheFusion, 3zS4QNQ4, Ezokewn, Terminuz, SendingRavens, Matt M., Ivan Imes, J M, JackJohnnyJim, Jack Lawfield, Khánh Đặng, Borte, Michael Docherty, yyuvuvu, Nomki, Paul Hartsuyker, elitassj, SkibidiRizzler, Jacob Winter, Ryan Presley Ng, Kalle Björk, Andrew Wilkinson, David, Meilo, Nacho Ferrando, shinonomeiro, Snille, MaartenAlbers, khanh duy, xybrightsummer, jreedatchison, PhilW, Janik, Cruel, MRBlack, Kiyoe, humptynutz, michael.isaza, Kalnei, Scott, Muratoraccio, D, meatyalien, Tony+V, draganjankovic1975dj528, miduzza, kinz, Mark+Staaf, Michael+Fürmann, Aether, JACKY, Otokomyouri+, d, YoruHime, Jasper, megameganck, thomasand01, Shiba+Sama, Somebody, Celestial+Kitten, TequiTequi, Homero+Banda, てぃんてぃんひーろー, you+halo9, cloudghost, Yongkwan+Lee, lucites, nickname, eriick, Lev+Lanevskiy, Jacky+Ho, generic404, abattoirblues, zounik, 4IXplr0r3r, hayden, ahoystan, Brandon Thomas, edk, Dustin Hendel, Liberation, Elemnt, Bradley Turner, ja s, Doug Mason, swra, JollRodrigo, scoreswazey, Oliverfish, uruksayshi, Owen Gwosdz, nk8, Nimhloth, Gentle Sartori, David Murcko, legostudio, Tsani Prodanov, Jack Dole, max blo, Slacks, Glenn Hoetker, Bouya shaka, Michael Hicks, Maso, Homero Banda, MadGod, Kevin Wallace, GhostyGhost, ChicRic, Bastard-Sama, mercur, inusanorthcape, Kane Sturzebecher, Never_M, Yavizu3d, Rudeff VonRod, Yves Poezevara, Teriak47, Just me, Raf Stahelin, Вячеслав Маринин, Cola Matthew, deadwishd, OniNoKen, Iain Wisely, Zertens, NOHOW, Apo, nekotxt, choowkee, Clusters, ibrahim, Highlandrise, philcoraz, mztn, ImagineerNL, MrAcrtosSursus, al300680, pixl, Robin, chahknoir, nd, keno94d, James Melzer, Bartleby, Renvertere, Rahuy, Hermann003, D, Foolish, RevyHiep, Captain_Swag, obkircher, gwyar, ResidentDeviant, D, edgecase, Neoxena, mrmhalo, Maarten Harms, Israel, SelfishMedic, adderleighn, EnragedAntelope, MilkyMai, Krash, PP, babydjac, belligerencebk, tortor, Cryphius, Peter+Timothy+Stover, Joel+Magnusson, anon, Anton, actual, kindofblue, Connor+Hall, Neko1967, sniff, Macho+Grump, AIBot, Morcoddd, Darren+Brown, Nick, kluu324, copycatmay, MackeMan, conkisdonkis, badnews, Lorabitch, 21omen, NopeNahGoodTy, Brandon+G, fazefour33, plonk, Kotetsu, Anvil+G, MrSEIGE88, yarsev, Somebody, KB, shw, Jim, JoL, Srdb, jcx29, Drizzly, Nebuleux, Join+Chun, GDS+DEV, 4rt+r3d, Somebody, Somebody, Crescent~San, AiGirlTS, datasl4ve, Somebody, koopa990, The+Forgetful+Dev, Mateusz+Kosela, Bula, KUJYAKU, Coeur+de+cochon, han b, Nico, Maximilian Krischan, socialcat, proto merp, _ G3n, Donovan Jenkins, Civitaier, Hans Meier, BakunyuuWaifu, jboul, Michael Eid, Joey Leto, Bob barker, karim ben brik, Anagra Nouma, tafapayo, Michael Zhu, Nemisu, Seraphy, 雨の心 落, AllTimeNoobie, jumpd, John C, Rim, Beuhwtf, yfx507, Jairus Knudsen, GJT, Xan Dionysus, Manuel Reyes, Nathan lee, lylepaul, FinoRulez, DafmanD2, Middo, Gary Chaboya, forbiddenatelierofficial, CHEL_C, Thomas Sankowski, DrB, wknight, Caleb Larson, Moneymaker412K, Justin Defer, Ben Brogger, Towelie, Alex Ross, V Bj, Jean-françois SEMA, Rj Joplin, Myrthrac, Taylor Dominy, Andrew Ly, Faith, john Greene, Faburizu, jimyjomson, JaeHyun Jang, Chase Kwon, Bob Ling, Inyoshu, Chad Barnes, redlines3, Adam Gardner, James Ming, vanditking, kripitonga, Rizzi, nimin, OMAR LUCIANO, Somebody, Somebody, Somebody, Somebody, CoffeeMage, Ken+Suzuki, hannibal, Jo+Example, BrentBertram, eumelzocker, dxjaymz, L C, Dude, Somebody, CK

</details>

<!-- SUPPORTERS-END -->



## **⚠ Important Note**: To use the CivitAI download feature, you'll need to:

1. Get your CivitAI API key from your profile settings
2. Add it to the LoRA Manager settings page
3. Save the settings

---

## Key Features

- 🚀 **High Performance**
  - Fast model loading and browsing
  - Smooth scrolling through large collections
  
- 🌐 **Rich Model Integration**
  - Direct download from CivitAI
  - Preview images and videos
  - Model descriptions and version selection
  - Trigger words at a glance
  - One-click workflow integration with preset values
  
- 🔄 **Checkpoint Management**
  - Scan and organize checkpoint models
  - Filter and search your collection
  - View and edit metadata
  - Clean up and manage disk space
  
- 🧩 **LoRA Recipes**
  - Save and share favorite LoRA combinations
  - Preserve generation parameters for future reference
  - Quick application to workflows
  - Import/export functionality for community sharing
  
- 💻 **User Friendly**
  - One-click access from ComfyUI menu
  - Context menu for quick actions
  - Custom notes and usage tips
  - Multi-folder support
  - Configurable mature blur threshold (`PG13` / `R` / `X` / `XXX`, default `R+`)
    - Example: setting threshold to `PG13` blurs `PG13`, `R`, `X`, and `XXX` previews when blur is enabled
  - Visual progress indicators during initialization

---

## Installation

### Option 1: **ComfyUI Manager** (Recommended for ComfyUI users)

1. Open **ComfyUI**.
2. Go to **Manager > Custom Node Manager**.
3. Search for `lora-manager`.
4. Click **Install**.

### Option 2: **Portable Standalone Edition** (No ComfyUI required)

1. Download the [Portable Package](https://github.com/willmiao/ComfyUI-Lora-Manager/releases/download/v1.0.10/lora_manager_portable.7z)
2. Copy the provided `settings.json.example` file to create a new file named `settings.json` in `comfyui-lora-manager` folder.
3. Edit the new `settings.json` to include your correct model folder paths and CivitAI API key
   - Set `"use_portable_settings": true` if you want the configuration to remain inside the repository folder instead of your user settings directory.
4. Run run.bat
    - To change the startup port, edit `run.bat` and modify the parameter (e.g. `--port 9001`)

### Option 3: **Manual Installation**

```bash
git clone https://github.com/willmiao/ComfyUI-Lora-Manager.git
cd ComfyUI-Lora-Manager
pip install -r requirements.txt
```

## Usage

1. There are two ways to access the LoRA manager:
   - Click the "Launch LoRA Manager" button in the ComfyUI menu
   - Visit http://localhost:8188/loras directly
2. From the interface, you can:
   - Browse and organize your LoRA models
   - Download models directly from CivitAI
   - Automatically fetch or manually set preview images
   - View and copy trigger words associated with each LoRA
   - Add personal notes and usage tips
3. To use LoRAs in your workflow:
   - Add the "Lora Loader (LoraManager)" node to your workflow
   - Select a LoRA in the manager interface
   - Click copy button or use right-click menu "Copy LoRA syntax"
   - Paste into the Lora Loader node's text input
   - The node will automatically apply preset strength and trigger words

### Wildcards for TextLM / PromptLM

`Text (LoraManager)` and `Prompt (LoraManager)` support `/wildcard` autocomplete plus runtime wildcard expansion.

- Wildcard files live in `{settings folder}/wildcards/`
- When you type `/wildcard` and no wildcard files exist yet, the autocomplete dropdown shows the exact folder path and lets you open it
- Supported formats: `.txt`, `.yaml`, `.yml`, `.json`

Format rules:

- `wildcards/animals/cat.txt` becomes `__animals/cat__`
- `.txt` files use one option per line
- YAML / JSON files use nested keys that end in string arrays

Examples:

```txt
# wildcards/color.txt
red
blue
green
```

Use it as `__color__`.

```yaml
# wildcards/colors.yaml
palette:
  warm:
    - red
    - orange
```

Use it as `__palette/warm__`.

### Filename Format Patterns for Save Image Node

The Save Image Node supports dynamic filename generation using pattern codes. You can customize how your images are named using the following format patterns:

#### Available Pattern Codes

##### Cross-Node Placeholders (ComfyUI Standard)

- `%NodeTitle.WidgetName%` - Reference any widget value from any node in your workflow, for example:
  - `%KSampler.seed%` - The seed from a KSampler node
  - `%Empty Latent Image.width%` - The width from an Empty Latent Image node
  - `%KSampler.steps%` - The steps value from a KSampler node
  - Nodes are matched by their "Node name for S&R" property, then by their title

##### Generation Metadata Placeholders (LoRA Manager)

- `%seed%` - Inserts the generation seed number
- `%width%` - Inserts the image width
- `%height%` - Inserts the image height
- `%pprompt:N%` - Inserts the positive prompt (limited to N characters)
- `%nprompt:N%` - Inserts the negative prompt (limited to N characters)
- `%model:N%` - Inserts the model/checkpoint name (limited to N characters)

##### Date/Time Placeholders

- `%date%` - Inserts current date/time as "yyyyMMddhhmmss"
- `%date:FORMAT%` - Inserts date using custom format with:
  - `yyyy` - 4-digit year
  - `yy` - 2-digit year
  - `MM` - 2-digit month
  - `dd` - 2-digit day
  - `hh` - 2-digit hour
  - `mm` - 2-digit minute
  - `ss` - 2-digit second

#### Examples

- `image_%seed%` → `image_1234567890`
- `gen_%width%x%height%` → `gen_512x768`
- `%model:10%_%seed%` → `dreamshape_1234567890`
- `%date:yyyy-MM-dd%` → `2025-04-28`
- `%pprompt:20%_%seed%` → `beautiful landscape_1234567890`
- `%model%_%date:yyMMdd%_%seed%` → `dreamshaper_v8_250428_1234567890`
- `%KSampler.seed%` → `1234567890` (resolved from the KSampler node's widget)
- `%Empty Latent Image.width%x%Empty Latent Image.height%` → `512x768`
- `%KSampler.seed%_%KSampler.steps%` → `1234567890_25`

You can combine multiple patterns to create detailed, organized filenames for your generated images. Cross-node and metadata placeholders can be mixed freely — for example: `%KSampler.seed%_%model%_%date:yyyyMMdd%`.

##### Organizing Images into Subdirectories

Including a path separator (`/` on all platforms) in the filename prefix creates subdirectories automatically, which is especially powerful when combined with placeholders:

| Pattern | Result |
|---|---|
| `%date:yyyy-MM-dd%/%seed%` | Saves to `2025-04-28/1234567890.png` |
| `%model%/%date:yyMMdd%_%seed%` | Saves to `dreamshaper_v8/250428_1234567890.png` |
| `%KSampler.seed%/%model%` | Saves to `1234567890/dreamshaper_v8.png` |
| `%date:yyyy/MM/dd%/%seed%` | Saves to `2025/04/28/1234567890.png` (nested year/month/day) |
| `%model%/training/%seed%` | Saves to `dreamshaper_v8/training/1234567890.png` |

> **Note**: The subdirectory is created relative to your ComfyUI output directory (configurable via `--output-directory`). Characters invalid for folder names are automatically replaced with underscores.

### Standalone Mode

You can now run LoRA Manager independently from ComfyUI:

1. **For ComfyUI users**:
   - Launch ComfyUI with LoRA Manager at least once to initialize the necessary path information in the `settings.json` file located in your user settings folder (see paths above).
   - Make sure dependencies are installed: `pip install -r requirements.txt`
   - From your ComfyUI root directory, run:
     ```bash
     python custom_nodes\comfyui-lora-manager\standalone.py
     ```
   - Access the interface at: `http://localhost:8188/loras`
   - You can specify a different host or port with arguments:
     ```bash
     python custom_nodes\comfyui-lora-manager\standalone.py --host 127.0.0.1 --port 9000
     ```

2. **For non-ComfyUI users**:
   - Copy the provided `settings.json.example` file to create a new file named `settings.json`. Update the API key, optional language, and folder paths only—the library registry is created automatically when LoRA Manager starts.
   - Edit `settings.json` to include your correct model folder paths and CivitAI API key (you can leave the defaults until ready to configure them)
   - Enable portable mode by setting `"use_portable_settings": true` if you prefer LoRA Manager to read and write the `settings.json` located in the project directory.
   - Install required dependencies: `pip install -r requirements.txt`
   - Run standalone mode:
     ```bash
     python standalone.py
     ```
   - Access the interface through your browser at: `http://localhost:8188/loras`

   > **Note:** Existing installations automatically migrate the legacy `settings.json` from the plugin folder to the user settings directory the first time you launch this version.

This standalone mode provides a lightweight option for managing your model and recipe collection without needing to run the full ComfyUI environment, making it useful even for users who primarily use other stable diffusion interfaces.

## Testing & Coverage

### Backend

Install the development dependencies and run pytest with coverage reports:

```bash
pip install -r requirements-dev.txt
COVERAGE_FILE=coverage/backend/.coverage pytest \
  --cov=py \
  --cov=standalone \
  --cov-report=term-missing \
  --cov-report=html:coverage/backend/html \
  --cov-report=xml:coverage/backend/coverage.xml \
  --cov-report=json:coverage/backend/coverage.json
```

HTML, XML, and JSON artifacts are stored under `coverage/backend/` so you can inspect hot spots locally or from CI artifacts.

### Frontend

Run the Vitest coverage suite to analyze widget hot spots:

```bash
npm run test:coverage
```

---

## Documentation

- **[metadata.json Schema Documentation](docs/metadata-json-schema.md)** — Complete reference for the `.metadata.json` sidecar file format, including all fields, types, and examples for LoRA, Checkpoint, and Embedding models.

---

## Contributing

Thank you for your interest in contributing to ComfyUI LoRA Manager! As this project is currently in its early stages and undergoing rapid development and refactoring, we are temporarily not accepting pull requests.

However, your feedback and ideas are extremely valuable to us:
- Please feel free to open issues for any bugs you encounter
- Submit feature requests through GitHub issues
- Share your suggestions for improvements

We appreciate your understanding and look forward to potentially accepting code contributions once the project architecture stabilizes.

---

## Credits

This project has been inspired by and benefited from other excellent ComfyUI extensions:

- [ComfyUI-QwenImageLoraLoader](https://github.com/ussoewwin/ComfyUI-QwenImageLoraLoader) - For the experimental Nunchaku Qwen-Image LoRA support
- [ComfyUI-SaveImageWithMetaData](https://github.com/nkchocoai/ComfyUI-SaveImageWithMetaData) - For the image metadata functionality
- [rgthree-comfy](https://github.com/rgthree/rgthree-comfy) - For the lora loader functionality

---

## ☕ Support

If you find this project helpful, consider supporting its development:

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/pixelpawsai)

[![Patreon](https://img.shields.io/badge/Become%20a%20Patron-F96854.svg?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/PixelPawsAI)

WeChat: [Click to view QR code](https://raw.githubusercontent.com/willmiao/ComfyUI-Lora-Manager/main/static/images/wechat-qr.webp)

## 💬 Community

Join our Discord community for support, discussions, and updates:
[Discord Server](https://discord.gg/vcqNrWVFvM)
