File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -1198,7 +1198,12 @@ export class OptionsComponent implements OnInit {
11981198 return { ...historyLora , strength } ;
11991199 } ) ;
12001200
1201- return resolved . slice ( 0 , this . maxLoras ) ;
1201+ const targetBaseModel = this . models_types ?. [ this . generationRequest . model ] ;
1202+ const filtered = targetBaseModel
1203+ ? resolved . filter ( ( lora ) => lora ?. base_model === targetBaseModel )
1204+ : resolved ;
1205+
1206+ return filtered . slice ( 0 , this . maxLoras ) ;
12021207 }
12031208
12041209 // Send job to django api and retrieve job id.
@@ -1751,8 +1756,16 @@ export class OptionsComponent implements OnInit {
17511756 this . sharedService . setPrompt ( image . prompt ! ) ;
17521757 }
17531758
1754- const hasHistoryLoras = Array . isArray ( image . loras ) && image . loras . length > 0 ;
1759+ const historyLoras = Array . isArray ( image . loras ) ? image . loras : [ ] ;
1760+ const hasHistoryLoras = historyLoras . length > 0 ;
17551761 if ( hasHistoryLoras ) {
1762+ const targetBaseModel = this . models_types ?. [ this . generationRequest . model ] ;
1763+ const hasCompatibleLoras = ! targetBaseModel
1764+ ? true
1765+ : historyLoras . some ( ( lora ) => lora ?. base_model === targetBaseModel ) ;
1766+ if ( ! hasCompatibleLoras ) {
1767+ return ;
1768+ }
17561769 this . pendingLoraLoadImage = image ;
17571770 this . showLoraLoadPrompt = true ;
17581771 }
You can’t perform that action at this time.
0 commit comments