rgthree-comfy icon indicating copy to clipboard operation
rgthree-comfy copied to clipboard

feat: Add Super Power Lora Loader with enhanced features

Open HenkDz opened this issue 4 months ago • 13 comments

Super Power Lora Loader - Enhanced LoRA Management

This PR introduces a new Super Power Lora Loader node that extends the original Power Lora Loader with advanced features while keeping the original implementation completely unchanged.

✨ Features Added

🔗 Trigger Words Integration

  • Individual trigger word fields for each LoRA
  • Automatic combination of trigger words into text output
  • Text input/output for seamless prompt integration
  • Toggle trigger words visibility on/off

📋 Template Management

  • Save Template: Store LoRA configurations as reusable templates
  • Load Template: Quickly apply saved LoRA sets with search functionality
  • Delete Templates: Remove unwanted templates with confirmation
  • Template persistence across sessions

🎨 Enhanced UI

  • Improved header with trigger words toggle
  • Modern template browser with search filtering
  • Professional visual polish and responsive design
  • Minimum width adjustment for trigger word fields

🏗️ Implementation

Clean Separation

  • Original Power Lora Loader: Remains 100% unchanged - matches upstream exactly
  • Super Power Lora Loader: New standalone node with enhanced features
  • No conflicts: Both nodes coexist independently

Backend Architecture

  • RgthreePowerLoraLoader: Original class (pristine)
  • RgthreeSuperPowerLoraLoader: Enhanced class with trigger word functionality
  • Proper inheritance structure with distinct input/output schemas
  • DELETE API endpoint for template management

Frontend Components

  • power_lora_loader.js: Original implementation (untouched)
  • super_power_lora_loader.js: New enhanced implementation
  • Enhanced template chooser with search and delete capabilities
  • Independent registration and node management

📸 Demo

image

Screenshot showing the enhanced interface with trigger words, template buttons, and text output

🔍 Testing

  • [x] Both nodes load correctly in ComfyUI
  • [x] Original Power Lora Loader functionality preserved
  • [x] Super variant trigger words work correctly
  • [x] Template save/load/delete functionality verified
  • [x] Text output properly combines trigger words
  • [x] Search functionality in template browser
  • [x] No conflicts between node variants

💡 Benefits

  1. Backward Compatibility: Existing workflows using Power Lora Loader continue unchanged
  2. Enhanced Workflow: Users can upgrade to Super version for advanced features
  3. Clean Architecture: Proper separation of concerns with no code duplication
  4. Future-Proof: Easy to maintain and extend independently
  5. Professional UX: Modern template management with search and delete

📋 Files Changed

Core Implementation

  • __init__.py - Register both node variants
  • py/power_lora_loader.py - Add Super class with text I/O
  • web/comfyui/super_power_lora_loader.js - Enhanced frontend
  • Super Power Lora Loader.png - Demo screenshot

Supporting Infrastructure

  • web/comfyui/constants.js - Add SUPER_POWER_LORA_LOADER constant
  • web/comfyui/utils_menu.js - Enhanced template chooser
  • web/common/rgthree_api.js - Template deletion API
  • py/server/routes_power_lora.py - DELETE endpoint
  • web/comfyui/power_lora_loader.js - Reverted to original state

This implementation provides users with choice: keep using the reliable original, or upgrade to the enhanced Super version with trigger words and templates.

HenkDz avatar Sep 11 '25 17:09 HenkDz

extremely useful

stef654547 avatar Sep 11 '25 19:09 stef654547

非常好,使用起来方便多了

w2253543w avatar Sep 12 '25 08:09 w2253543w

Super useful, thanks!

Galvo87 avatar Sep 12 '25 09:09 Galvo87

useful, thanks!

Mr-Wojack avatar Sep 12 '25 12:09 Mr-Wojack

Thanks for the PR, this is cool stuff. I can tell you've jumped in here and there's a lot of value you've added and I'm excited to see a contribution like this.

With that said, I don't want to pull this in as-is. Some of it is actually incompatible, but that's just because I never expected to see a PR like that and don't have a formal how-to-contribute doc; perhaps I should.

But the other reason is I've been thinking how to better incorporate some of these features into the regular Power Lora Loader node. The way I see it, there's no reason the normal PLL can't have some of these feature (other than it's easier to an outside contribute to create a new node than hack an existing one, noted). I do like some of the way you've handled trigger words in the node. You can get the trigger words today in rgthree-comfy by using the Power Puter combined with the Power Lora Loader, but I like how you're work here ties it to the workflow node too.

Anyway, if you're interested, we can go back and forth on a design and how to incorporate some of the features within the PLL, including some of the work I've been thinking of incorporating. But I'd want to separate it from this PR and break up the work a bit.

Or I can take some of your ideas here as inspiration and find time to incorporate it myself if you're not interested if fleshing out a proposal and design.

rgthree avatar Sep 13 '25 18:09 rgthree

But the other reason is I've been thinking how to better incorporate some of these features into the regular Power Lora Loader node. The way I see it, there's no reason the normal PLL can't have some of these feature (other than it's easier to an outside contribute to create a new node than hack an existing one, noted). I do like some of the way you've handled trigger words in the node. You can get the trigger words today in rgthree-comfy by using the Power Puter combined with the Power Lora Loader, but I like how you're work here ties it to the workflow node too.

Well I first started hacking the regular PPL, then I though it might be easier for you to merge if the node is totally separate from yours and doesn't affect anything from your orignal code, other than registering it.

Anyway, if you're interested, we can go back and forth on a design and how to incorporate some of the features within the PLL, including some of the work I've been thinking of incorporating. But I'd want to separate it from this PR and break up the work a bit.

Sure, I am all ears.

Or I can take some of your ideas here as inspiration and find time to incorporate it myself if you're not interested if fleshing out a proposal and design.

image

Yes, this can also help I have shown you what me and many others might really want to see in PLL, however, I am quite confident that it would be very challenging to "find time", I have this same issue. All depends on priorities.

HenkDz avatar Sep 14 '25 12:09 HenkDz

Here's current state of the new node, really struggled to add collpasiblity. I have also add a settings to help users only activate what they need. image

HenkDz avatar Sep 14 '25 12:09 HenkDz

+1 to something like this - its insanely frustrating to have to trawl the web to find info on a Lora you downloaded ages ago, to find the page down or removed.. when the information is in the metadata for the file!

PowerLoraLoader is a great tool, but being able to pull the trigger data out would be fantastic!

ThePowerOfMonkeys avatar Sep 21 '25 00:09 ThePowerOfMonkeys

+1 to something like this - its insanely frustrating to have to trawl the web to find info on a Lora you downloaded ages ago, to find the page down or removed.. when the information is in the metadata for the file!

PowerLoraLoader is a great tool, but being able to pull the trigger data out would be fantastic!

PowerLoraLoader does this already in the Show Info dialog, if possible. AFAICT, this PR doesn’t do anything further.

I do owe a breakdown on how we can get some of these other features into the PLL.

rgthree avatar Sep 21 '25 13:09 rgthree

Is this considered an upgrade?

image

HenkDz avatar Sep 21 '25 23:09 HenkDz

+1 to something like this - its insanely frustrating to have to trawl the web to find info on a Lora you downloaded ages ago, to find the page down or removed.. when the information is in the metadata for the file! PowerLoraLoader is a great tool, but being able to pull the trigger data out would be fantastic!

PowerLoraLoader does this already in the Show Info dialog, if possible. AFAICT, this PR doesn’t do anything further.

I do owe a breakdown on how we can get some of these other features into the PLL.

It does yeah, which is handy to get to the civitai page to see example prompts etc. its just a load more clicks & doesn't go with keyboard shortcuts to open / close dialogs (at least I dont think it does?) .. All I need is to quickly check what a trigger word is to update a complex prompt.. Just having the information in front of us is much more convenient. obviously your call:) & just stating a rationale!

I did try to get the triggers function working in the puter node (that's hugely powerful - nice work there!) but I'm not sure that's working after the latest comfy updates (asyncio error)

ThePowerOfMonkeys avatar Sep 26 '25 09:09 ThePowerOfMonkeys

Is this considered an upgrade? image

sir, i really need to know how the hell you have made the buttons in a single line... trying to create that also in one of my nodes, and Gemini is not been able to looking at how they appear, they don't seem to be "normal" buttons

Santodan avatar Sep 26 '25 14:09 Santodan

Is this considered an upgrade? image

sir, i really need to know how the hell you have made the buttons in a single line... trying to create that also in one of my nodes, and Gemini is not been able to looking at how they appear, they don't seem to be "normal" buttons

I refactore the whole thing, now you can just build on Vite, TS, Tailwind whatever. I have made an MD Guide for other LLMs to build the same. image

I built my own ND Super Lora node and it is super handy and with beautiful UIand UX.

image

HenkDz avatar Sep 26 '25 18:09 HenkDz