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 {
"required": {
"model": ("MODEL",),
"clip": ("CLIP",),
# "clip": ("CLIP",),
"text": (IO.STRING, {
"multiline": True,
"dynamicPrompts": True,
@@ -75,11 +75,12 @@ class LoraManagerLoader:
logger.warning(f"Unexpected loras format: {type(loras_data)}")
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."""
loaded_loras = []
all_trigger_words = []
clip = kwargs.get('clip', None)
lora_stack = kwargs.get('lora_stack', None)
# First process lora_stack if available
if lora_stack:

View File

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

View File

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