Made CLIP input optional in LoRA Loader, enabling compatibility with Hunyuan workflows

This commit is contained in:
Will Miao
2025-03-26 21:50:26 +08:00
parent 83582ef8a3
commit 0459710c9b
3 changed files with 7 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ class LoraManagerLoader:
return { return {
"required": { "required": {
"model": ("MODEL",), "model": ("MODEL",),
"clip": ("CLIP",), # "clip": ("CLIP",),
"text": (IO.STRING, { "text": (IO.STRING, {
"multiline": True, "multiline": True,
"dynamicPrompts": True, "dynamicPrompts": True,
@@ -75,11 +75,12 @@ class LoraManagerLoader:
logger.warning(f"Unexpected loras format: {type(loras_data)}") logger.warning(f"Unexpected loras format: {type(loras_data)}")
return [] return []
def load_loras(self, model, clip, text, **kwargs): def load_loras(self, model, text, **kwargs):
"""Loads multiple LoRAs based on the kwargs input and lora_stack.""" """Loads multiple LoRAs based on the kwargs input and lora_stack."""
loaded_loras = [] loaded_loras = []
all_trigger_words = [] all_trigger_words = []
clip = kwargs.get('clip', None)
lora_stack = kwargs.get('lora_stack', None) lora_stack = kwargs.get('lora_stack', None)
# First process lora_stack if available # First process lora_stack if available
if lora_stack: if lora_stack:

View File

@@ -2,16 +2,13 @@ import os
import logging import logging
import asyncio import asyncio
import json import json
import re
from typing import List, Dict, Optional, Any from typing import List, Dict, Optional, Any
from datetime import datetime
from ..config import config from ..config import config
from .recipe_cache import RecipeCache from .recipe_cache import RecipeCache
from .lora_scanner import LoraScanner from .lora_scanner import LoraScanner
from .civitai_client import CivitaiClient from .civitai_client import CivitaiClient
from ..utils.utils import fuzzy_match from ..utils.utils import fuzzy_match
import sys import sys
from contextlib import asynccontextmanager
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@@ -35,6 +35,10 @@ app.registerExtension({
// Enable widget serialization // Enable widget serialization
node.serialize_widgets = true; node.serialize_widgets = true;
node.addInput('clip', 'CLIP', {
"shape": 7
});
node.addInput("lora_stack", 'LORA_STACK', { node.addInput("lora_stack", 'LORA_STACK', {
"shape": 7 // 7 is the shape of the optional input "shape": 7 // 7 is the shape of the optional input
}); });