ComfyUI 选择器 + 综合输入模块组 双语版
import torch

from nodes import CLIPTextEncode

from comfy.sd import CLIP, VAE

import comfy.model_patcher

import comfy.sd

import folder_paths

MAX_RESOLUTION=8192
#------------------------------------------------------------------------------
def load_checkpoint(主模型,output_vae=True, output_clip=True):

        ckpt_path = folder_paths.get_full_path("checkpoints", 主模型)
        out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True,
                                                    embedding_directory=folder_paths.get_folder_paths("embeddings"))

        model = out[0]
        clip = out[1]
        vae = out[2]

        return model, clip, vae

#------------------------------------------------------------------------------
def load_lora(model, clip, Lora模型, Lora模型强度, Loraclip强度):

        lora_path = folder_paths.get_full_path("loras", Lora模型)
        lora = None
        if lora is None:
            lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
        model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, Lora模型强度, Loraclip强度)
        return (model_lora, clip_lora)

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

#------------------------------------------------------------------------------
class 综合输入器_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "Clip跳过层": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "交换宽高": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
                    "生成数量": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "正向提示词": ("STRING", {"default": "正向提示词", "multiline": True}),           
                    "负向提示词": ("STRING", {"default": "负向提示词", "multiline": True}),
                    "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
                    "步数": ("INT", {"default": 20, "min": 1, "max": 10000}),
                    "CFG": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}),
                    "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("INT", "INT", "INT", "INT", "STRING", "STRING", "INT", "INT", "FLOAT", "FLOAT",)
    RETURN_NAMES = ("Clip跳过层", "宽度", "高度", "生成数量", "正向提示词", "负向提示词", "seed", "步数", "CFG", "降噪值",  )
    
    FUNCTION = "Zho_co_input"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_input(self, Clip跳过层, 宽度, 高度, 生成数量, 正向提示词, 负向提示词, seed, 步数, CFG, denoise, 交换宽高=False ):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if 交换宽高:
            宽度, 高度 = swap_width_height(宽度, 高度)

        return (Clip跳过层, 宽度, 高度, 生成数量, 正向提示词, 负向提示词, seed, 步数, CFG, denoise,  )

#------------------------------------------------------------------------------
class 模型加载器_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "主模型": (folder_paths.get_filename_list("checkpoints"), ),
                    "Clip跳过层": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "VAE模型": (["自带VAE"] + folder_paths.get_filename_list("vae"), ),
                    "Lora模型": (["无"] + folder_paths.get_filename_list("loras"), ),
                    "Lora模型强度": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    "Loraclip强度": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("MODEL", "CLIP", "VAE",)
    RETURN_NAMES = ("主模型", "CLIP模型", "VAE模型",)
    
    FUNCTION = "Zho_co_model_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_model_loader(self, 主模型, Clip跳过层, VAE模型, Lora模型, Lora模型强度, Loraclip强度):

        model: ModelPatcher | None = None
        clip: CLIP | None = None
        vae: VAE | None = None
        
        #主模型
        model, clip, vae = load_checkpoint(主模型)
        
        #Lora模型
        if Lora模型 != "无":
            model, clip = load_lora(model, clip, Lora模型, Lora模型强度, Loraclip强度)

        #Clip跳过层        
        clip = clip.clone()
        clip.clip_layer(Clip跳过层)

        #VAE
        if VAE模型 != "自带VAE":        
           vae_path = folder_paths.get_full_path("vae", VAE模型)
           vae = comfy.sd.VAE(ckpt_path=vae_path)

        return (model, clip, vae, )

#------------------------------------------------------------------------------
class 参数加载器_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "clip": ("CLIP", ),
                    "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "生成数量": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "正向提示词": ("STRING", {"default": "正向提示词", "multiline": True}),           
                    "负向提示词": ("STRING", {"default": "负向提示词", "multiline": True}),
                    }}
    
    RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "LATENT",)
    RETURN_NAMES = ("正向条件", "负向条件", "LATENT",)
    
    FUNCTION = "Zho_co_parameter_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_parameter_loader(self, 正向提示词, 负向提示词, 宽度, 高度, 生成数量, clip):

        #潜空间图像
        latent = torch.zeros([生成数量, 4, 高度 // 8, 宽度 // 8])

        positive_encoded = negative_encoded = None
        positive_encoded = CLIPTextEncode().encode(clip, 正向提示词)[0]
        negative_encoded = CLIPTextEncode().encode(clip, 负向提示词)[0]

        return (positive_encoded, negative_encoded, {"samples":latent}, )

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

# 修改初始潜空间_Zho类
class 初始潜空间_交换_Zho:
    def __init__(self, device="cpu"):
        self.device = device

    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {
            "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "批次数": ("INT", {"default": 1, "min": 1, "max": 64}),
            "交换宽高": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
        }}

    RETURN_TYPES = ("LATENT",)
    RETURN_NAMES = ("潜空间",)
    FUNCTION = "generate"

    CATEGORY = "Zho模块组/Standard标准组"

    def generate(self, 宽度, 高度, 批次数=1, 交换宽高=False):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if 交换宽高:
            宽度, 高度 = swap_width_height(宽度, 高度)

        latent = torch.zeros([批次数, 4, 高度 // 8, 宽度 // 8])
        return ({"samples": latent}, )

#------------------------------------------------------------------------------
NODE_CLASS_MAPPINGS = {
    "综合输入器_Zho": 综合输入器_Zho,
    "模型加载器_Zho": 模型加载器_Zho,
    "参数加载器_Zho": 参数加载器_Zho,
    "初始潜空间_交换_Zho": 初始潜空间_交换_Zho,
}

Zho_CoInput_new/Zho_Standard__new.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
import torch

from nodes import CLIPTextEncode

from comfy.sd import CLIP, VAE

import comfy.model_patcher

import comfy.sd

import folder_paths

MAX_RESOLUTION=8192
#------------------------------------------------------------------------------
def load_checkpoint(ckpt_name,output_vae=True, output_clip=True):

        ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)
        out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True,
                                                    embedding_directory=folder_paths.get_folder_paths("embeddings"))

        model = out[0]
        clip = out[1]
        vae = out[2]

        return model, clip, vae

#------------------------------------------------------------------------------
def load_lora(model, clip, lora_name, strength_model, strength_clip):

        lora_path = folder_paths.get_full_path("loras", lora_name)
        lora = None
        if lora is None:
            lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
        model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, strength_model, strength_clip)
        return (model_lora, clip_lora)

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

#------------------------------------------------------------------------------
class Co_Input_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "clip_skip": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "swap": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
                    "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "positive": ("STRING", {"default": "+正向提示词", "multiline": True}),           
                    "negative": ("STRING", {"default": "-负向提示词", "multiline": True}),
                    "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
                    "steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
                    "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}),
                    "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("INT", "INT", "INT", "INT", "STRING", "STRING", "INT", "INT", "FLOAT", "FLOAT",)
    RETURN_NAMES = ("clip_skip", "width", "height", "batch_size", "positive", "negative", "seed", "steps", "cfg", "denoise",  )
    
    FUNCTION = "Zho_co_input"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_input(self, clip_skip, width, height, batch_size, positive, negative, seed, steps, cfg, denoise, swap=False ):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if swap:
            width, height = swap_width_height(width, height)

        return (clip_skip, width, height, batch_size, positive, negative, seed, steps, cfg, denoise,  )

#------------------------------------------------------------------------------
class Co_Loader_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
                    "clip_skip": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "vae_name": (["Baked VAE"] + folder_paths.get_filename_list("vae"), ),
                    "lora_name": (["None"] + folder_paths.get_filename_list("loras"), ),
                    "strength_model": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    "strength_clip": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("MODEL", "CLIP", "VAE",)
    RETURN_NAMES = ("Model", "CLIP", "VAE",)
    
    FUNCTION = "Zho_co_model_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_model_loader(self, ckpt_name, clip_skip, vae_name, lora_name, strength_model, strength_clip):

        model: ModelPatcher | None = None
        clip: CLIP | None = None
        vae: VAE | None = None
        
        #主模型
        model, clip, vae = load_checkpoint(model)
        
        #Lora模型
        if lora_name != "None":
            model, clip = load_lora(model, clip, lora_name, strength_model, strength_clip)

        #Clip跳过层        
        clip = clip.clone()
        clip.clip_layer(clip_skip)

        #VAE
        if vae_name != "Baked VAE":        
           vae_path = folder_paths.get_full_path("vae", vae_name)
           vae = comfy.sd.VAE(ckpt_path=vae_path)

        return (model, clip, vae, )

#------------------------------------------------------------------------------
class Parameter_Loader_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "clip": ("CLIP", ),
                    "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "positive": ("STRING", {"default": "Positive", "multiline": True}),           
                    "negative": ("STRING", {"default": "Negative", "multiline": True}),
                    }}
    
    RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "LATENT",)
    RETURN_NAMES = ("Positive", "Negative", "LATENT",)
    
    FUNCTION = "Zho_co_parameter_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_parameter_loader(self, positive, negative, width, height, batch_size, clip):

        #潜空间图像
        latent = torch.zeros([batch_size, 4, height // 8, width // 8])

        positive_encoded = negative_encoded = None
        positive_encoded = CLIPTextEncode().encode(clip, positive)[0]
        negative_encoded = CLIPTextEncode().encode(clip, negative)[0]

        return (positive_encoded, negative_encoded, {"samples":latent}, )

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

# 修改初始潜空间_Zho类
class EmptyLatent_Swap_Zho:
    def __init__(self, device="cpu"):
        self.device = device

    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {
            "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
            "swap": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
        }}

    RETURN_TYPES = ("LATENT",)
    RETURN_NAMES = ("LATENT",)
    FUNCTION = "generate"

    CATEGORY = "Zho模块组/Standard标准组"

    def generate(self, width, height, batch_size=1, swap=False):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if swap:
            width, height = swap_width_height(width, height)

        latent = torch.zeros([batch_size, 4, height // 8, width // 8])
        return ({"samples": latent}, )

#------------------------------------------------------------------------------
NODE_CLASS_MAPPINGS = {
    "Co_Input_Zho": Co_Input_Zho,
    "Co_Loader_Zho": Co_Loader_Zho,
    "Parameter_Loader_Zho": Parameter_Loader_Zho,
    "EmptyLatent_Swap_Zho": EmptyLatent_Swap_Zho,
}

Zho_CoInput_new/Zho_Standard__new_EN.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
from .Zho_Standard__new import NODE_CLASS_MAPPINGS as NODE_CLASS_MAPPINGS_ZHO
from .Zho_Standard__new_EN import NODE_CLASS_MAPPINGS  as NODE_CLASS_MAPPINGS_EN

# Combine the dictionaries
NODE_CLASS_MAPPINGS = {**NODE_CLASS_MAPPINGS_ZHO, **NODE_CLASS_MAPPINGS_EN}

__all__ = ['NODE_CLASS_MAPPINGS']

Zho_CoInput_new/__init__.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
import torch

from comfy.sd import ModelPatcher, CLIP, VAE

import comfy.sd

import folder_paths

MAX_RESOLUTION=8192
#------------------------------------------------------------------------------
def load_checkpoint(主模型,output_vae=True, output_clip=True):

        ckpt_path = folder_paths.get_full_path("checkpoints", 主模型)
        out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True,
                                                    embedding_directory=folder_paths.get_folder_paths("embeddings"))

        model = out[0]
        clip = out[1]
        vae = out[2]

        return model, clip, vae

#------------------------------------------------------------------------------
def load_lora(model, clip, Lora模型, Lora模型强度, Loraclip强度):

        lora_path = folder_paths.get_full_path("loras", Lora模型)
        lora = None
        if lora is None:
            lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
        model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, Lora模型强度, Loraclip强度)
        return (model_lora, clip_lora)

#------------------------------------------------------------------------------
class Zho综合输入器:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "Clip跳过层": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "交换宽高": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
                    "生成数量": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "正向提示词": ("STRING", {"default": "正向提示词", "multiline": True}),           
                    "负向提示词": ("STRING", {"default": "负向提示词", "multiline": True}),
                    "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
                    "步数": ("INT", {"default": 20, "min": 1, "max": 10000}),
                    "CFG": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}),
                    "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("INT", "INT", "INT", "INT", "STRING", "STRING", "INT", "INT", "FLOAT", "FLOAT",)
    RETURN_NAMES = ("Clip跳过层", "宽度", "高度", "生成数量", "正向提示词", "负向提示词", "seed", "步数", "CFG", "降噪值",  )
    
    FUNCTION = "Zho_co_input"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_input(self, Clip跳过层, 宽度, 高度, 生成数量, 正向提示词, 负向提示词, seed, 步数, CFG, denoise, 交换宽高=False  ):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if 交换宽高:
            宽度, 高度 = swap_width_height(宽度, 高度)

        return (Clip跳过层, 宽度, 高度, 生成数量, 正向提示词, 负向提示词, seed, 步数, CFG, denoise,  )

#------------------------------------------------------------------------------
class Zho模型加载器:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "主模型": (folder_paths.get_filename_list("checkpoints"), ),
                    "Clip跳过层": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "VAE模型": (["自带VAE"] + folder_paths.get_filename_list("vae"), ),
                    "Lora模型": (["无"] + folder_paths.get_filename_list("loras"), ),
                    "Lora模型强度": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    "Loraclip强度": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("MODEL", "CLIP", "VAE",)
    RETURN_NAMES = ("主模型", "CLIP模型", "VAE模型",)
    
    FUNCTION = "Zho_co_model_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_model_loader(self, 主模型, Clip跳过层, VAE模型, Lora模型, Lora模型强度, Loraclip强度):

        model: ModelPatcher | None = None
        clip: CLIP | None = None
        vae: VAE | None = None
        
        #主模型
        model, clip, vae = load_checkpoint(主模型)
        
        #Lora模型
        if Lora模型 != "无":
            model, clip = load_lora(model, clip, Lora模型, Lora模型强度, Loraclip强度)

        #Clip跳过层        
        clip = clip.clone()
        clip.clip_layer(Clip跳过层)

        #VAE
        if VAE模型 != "自带VAE":        
           vae_path = folder_paths.get_full_path("vae", VAE模型)
           vae = comfy.sd.VAE(ckpt_path=vae_path)

        return (model, clip, vae, )

#------------------------------------------------------------------------------
class Zho参数加载器:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "Clip输入": ("CLIP", ),
                    "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "生成数量": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "正向提示词": ("STRING", {"default": "正向提示词", "multiline": True}),           
                    "负向提示词": ("STRING", {"default": "负向提示词", "multiline": True}),
                    }}
    
    RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "LATENT",)
    RETURN_NAMES = ("正向条件", "负向条件", "LATENT",)
    
    FUNCTION = "Zho_co_parameter_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_parameter_loader(self, 正向提示词, 负向提示词, 宽度, 高度, 生成数量, Clip输入):

        #潜空间图像
        latent = torch.zeros([生成数量, 4, 高度 // 8, 宽度 // 8])

        return ([[Clip输入.encode(正向提示词), {}]], [[Clip输入.encode(负向提示词), {}]], {"samples":latent}, )

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

# 修改初始潜空间_Zho类
class Zho初始潜空间_交换:
    def __init__(self, device="cpu"):
        self.device = device

    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {
            "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "批次数": ("INT", {"default": 1, "min": 1, "max": 64}),
            "交换宽高": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
        }}

    RETURN_TYPES = ("LATENT",)
    RETURN_NAMES = ("潜空间",)
    FUNCTION = "generate"

    CATEGORY = "Zho模块组/Standard标准组"

    def generate(self, 宽度, 高度, 批次数=1, 交换宽高=False):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if 交换宽高:
            宽度, 高度 = swap_width_height(宽度, 高度)

        latent = torch.zeros([批次数, 4, 高度 // 8, 宽度 // 8])
        return ({"samples": latent}, )

#------------------------------------------------------------------------------
NODE_CLASS_MAPPINGS = {
    "Zho综合输入器": Zho综合输入器,
    "Zho模型加载器": Zho模型加载器,
    "Zho参数加载器": Zho参数加载器,
    "Zho初始潜空间_交换": Zho初始潜空间_交换,
}

Zho_CoInput_old/Zho_Standard.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
import torch

from comfy.sd import ModelPatcher, CLIP, VAE

import comfy.sd

import folder_paths

MAX_RESOLUTION=8192
#------------------------------------------------------------------------------
def load_checkpoint(ckpt_name,output_vae=True, output_clip=True):

        ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)
        out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True,
                                                    embedding_directory=folder_paths.get_folder_paths("embeddings"))

        model = out[0]
        clip = out[1]
        vae = out[2]

        return model, clip, vae

#------------------------------------------------------------------------------
def load_lora(model, clip, lora_name, strength_model, strength_clip):

        lora_path = folder_paths.get_full_path("loras", lora_name)
        lora = None
        if lora is None:
            lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
        model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, strength_model, strength_clip)
        return (model_lora, clip_lora)

#------------------------------------------------------------------------------
class Zho_Co_Input:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "clip_skip": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "swap": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
                    "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "positive": ("STRING", {"default": "+正向提示词", "multiline": True}),           
                    "negative": ("STRING", {"default": "-负向提示词", "multiline": True}),
                    "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
                    "steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
                    "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}),
                    "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("INT", "INT", "INT", "INT", "STRING", "STRING", "INT", "INT", "FLOAT", "FLOAT",)
    RETURN_NAMES = ("clip_skip", "width", "height", "batch_size", "positive", "negative", "seed", "steps", "cfg", "denoise",  )
    
    FUNCTION = "Zho_co_input"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_input(self, clip_skip, width, height, batch_size, positive, negative, seed, steps, cfg, denoise, swap=False ):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if swap:
            width, height = swap_width_height(width, height)

        return (clip_skip, width, height, batch_size, positive, negative, seed, steps, cfg, denoise,  )

#------------------------------------------------------------------------------
class Zho_Co_Loader:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
                    "clip_skip": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "vae_name": (["Baked VAE"] + folder_paths.get_filename_list("vae"), ),
                    "lora_name": (["None"] + folder_paths.get_filename_list("loras"), ),
                    "strength_model": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    "strength_clip": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("MODEL", "CLIP", "VAE",)
    RETURN_NAMES = ("Model", "CLIP", "VAE",)
    
    FUNCTION = "Zho_co_model_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_model_loader(self, ckpt_name, clip_skip, vae_name, lora_name, strength_model, strength_clip):

        model: ModelPatcher | None = None
        clip: CLIP | None = None
        vae: VAE | None = None
        
        #主模型
        model, clip, vae = load_checkpoint(ckpt_name)
        
        #Lora模型
        if lora_name != "None":
            model, clip = load_lora(model, clip, lora_name, strength_model, strength_clip)

        #Clip跳过层        
        clip = clip.clone()
        clip.clip_layer(clip_skip)

        #VAE
        if vae_name != "Baked VAE":        
           vae_path = folder_paths.get_full_path("vae", vae_name)
           vae = comfy.sd.VAE(ckpt_path=vae_path)

        return (model, clip, vae, )

#------------------------------------------------------------------------------
class Zho_Parameter_Loader:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "clip": ("CLIP", ),
                    "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "positive": ("STRING", {"default": "Positive", "multiline": True}),           
                    "negative": ("STRING", {"default": "Negative", "multiline": True}),
                    }}
    
    RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "LATENT",)
    RETURN_NAMES = ("Positive", "Negative", "LATENT",)
    
    FUNCTION = "Zho_co_parameter_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_parameter_loader(self, positive, negative, width, height, batch_size, clip):

        #潜空间图像
        latent = torch.zeros([batch_size, 4, height // 8, width // 8])


        return ([[clip.encode(positive), {}]], [[clip.encode(negative), {}]], {"samples":latent}, )

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

# 修改初始潜空间_Zho类
class Zho_EmptyLatent_Swap:
    def __init__(self, device="cpu"):
        self.device = device

    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {
            "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
            "swap": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
        }}

    RETURN_TYPES = ("LATENT",)
    RETURN_NAMES = ("LATENT",)
    FUNCTION = "generate"

    CATEGORY = "Zho模块组/Standard标准组"

    def generate(self, width, height, batch_size=1, swap=False):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if swap:
            width, height = swap_width_height(width, height)

        latent = torch.zeros([batch_size, 4, height // 8, width // 8])
        return ({"samples": latent}, )

#------------------------------------------------------------------------------
NODE_CLASS_MAPPINGS = {
    "Zho_Co_Input": Zho_Co_Input,
    "Zho_Co_Loader": Zho_Co_Loader,
    "Zho_Parameter_Loader": Zho_Parameter_Loader,
    "Zho_EmptyLatent_Swap": Zho_EmptyLatent_Swap,
}

Zho_CoInput_old/Zho_Standard_EN.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
from .Zho_Standard import NODE_CLASS_MAPPINGS as NODE_CLASS_MAPPINGS_ZHO
from .Zho_Standard_EN import NODE_CLASS_MAPPINGS as NODE_CLASS_MAPPINGS_EN

# Combine the dictionaries
NODE_CLASS_MAPPINGS = {**NODE_CLASS_MAPPINGS_ZHO, **NODE_CLASS_MAPPINGS_EN}

__all__ = ['NODE_CLASS_MAPPINGS']

Zho_CoInput_old/__init__.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
class Model_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "model_1": ("MODEL",),
                "model_2": ("MODEL",),
            },
            "optional": {
                "model_3": ("MODEL",),  
                "model_4": ("MODEL",), 
                "model_5": ("MODEL",), 
                "model_6": ("MODEL",), 
                "model_7": ("MODEL",), 
                "model_8": ("MODEL",), 
                "model_9": ("MODEL",), 
            }
        }

    RETURN_TYPES = ("MODEL",)
    FUNCTION = "model_selector"
    CATEGORY = "Zho模块组/Selector"

    def model_selector(self, model_1, model_2, select=1, 
                       model_3=None, model_4=None,
                       model_5=None, model_6=None,
                       model_7=None, model_8=None,
                       model_9=None):
        if select == 1:
            return (model_1, )
        elif select == 2:
            return (model_2, )
        elif select == 3:
            return (model_3, ) if model_3 is not None else ()
        elif select == 4:
            return (model_4, ) if model_4 is not None else ()
        elif select == 5:
            return (model_5, ) if model_5 is not None else ()
        elif select == 6:
            return (model_6, ) if model_6 is not None else ()
        elif select == 7:
            return (model_7, ) if model_7 is not None else ()
        elif select == 8:
            return (model_8, ) if model_8 is not None else ()
        elif select == 9:
            return (model_9, ) if model_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class LoRA_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "loar_1": ("MODEL",),
                "loar_2": ("MODEL",),
            },
            "optional": {
                "loar_3": ("MODEL",),  
                "loar_4": ("MODEL",), 
                "loar_5": ("MODEL",), 
                "loar_6": ("MODEL",), 
                "loar_7": ("MODEL",), 
                "loar_8": ("MODEL",), 
                "loar_9": ("MODEL",), 
            }
        }

    RETURN_TYPES = ("MODEL",)
    FUNCTION = "lora_selector" 
    CATEGORY = "Zho模块组/Selector"

    def lora_selector(self, loar_1, loar_2, select=1, 
                       loar_3=None, loar_4=None,
                       loar_5=None, loar_6=None,
                       loar_7=None, loar_8=None,
                       loar_9=None):
        if select == 1:
            return (loar_1, )
        elif select == 2:
            return (loar_2, )
        elif select == 3:
            return (loar_3, ) if loar_3 is not None else ()
        elif select == 4:
            return (loar_4, ) if loar_4 is not None else ()
        elif select == 5:
            return (loar_5, ) if loar_5 is not None else ()
        elif select == 6:
            return (loar_6, ) if loar_6 is not None else ()
        elif select == 7:
            return (loar_7, ) if loar_7 is not None else ()
        elif select == 8:
            return (loar_8, ) if loar_8 is not None else ()
        elif select == 9:
            return (loar_9, ) if loar_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class CLIP_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "clip_1": ("CLIP",),  # 更改为 CLIP
                "clip_2": ("CLIP",),  # 更改为 CLIP
            },
            "optional": {
                "clip_3": ("CLIP",),  # 更改为 CLIP
                "clip_4": ("CLIP",),  # 更改为 CLIP
                "clip_5": ("CLIP",),  # 更改为 CLIP
                "clip_6": ("CLIP",),  # 更改为 CLIP
                "clip_7": ("CLIP",),  # 更改为 CLIP
                "clip_8": ("CLIP",),  # 更改为 CLIP
                "clip_9": ("CLIP",),  # 更改为 CLIP
            }
        }

    RETURN_TYPES = ("CLIP",)  # 更改为 CLIP
    FUNCTION = "clip_selector" 
    CATEGORY = "Zho模块组/Selector"

    def clip_selector(self, clip_1, clip_2, select=1, 
                       clip_3=None, clip_4=None,
                       clip_5=None, clip_6=None,
                       clip_7=None, clip_8=None,
                       clip_9=None):
        if select == 1:
            return (clip_1, )
        elif select == 2:
            return (clip_2, )
        elif select == 3:
            return (clip_3, ) if clip_3 is not None else ()
        elif select == 4:
            return (clip_4, ) if clip_4 is not None else ()
        elif select == 5:
            return (clip_5, ) if clip_5 is not None else ()
        elif select == 6:
            return (clip_6, ) if clip_6 is not None else ()
        elif select == 7:
            return (clip_7, ) if clip_7 is not None else ()
        elif select == 8:
            return (clip_8, ) if clip_8 is not None else ()
        elif select == 9:
            return (clip_9, ) if clip_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class VAE_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "vae_1": ("VAE",),  # 更改为 VAE
                "vae_2": ("VAE",),  # 更改为 VAE
            },
            "optional": {
                "vae_3": ("VAE",),  # 更改为 VAE
                "vae_4": ("VAE",),  # 更改为 VAE
                "vae_5": ("VAE",),  # 更改为 VAE
                "vae_6": ("VAE",),  # 更改为 VAE
                "vae_7": ("VAE",),  # 更改为 VAE
                "vae_8": ("VAE",),  # 更改为 VAE
                "vae_9": ("VAE",),  # 更改为 VAE
            }
        }

    RETURN_TYPES = ("VAE",)  # 更改为 VAE
    FUNCTION = "vae_selector" 
    CATEGORY = "Zho模块组/Selector"

    def vae_selector(self, vae_1, vae_2, select=1, 
                       vae_3=None, vae_4=None,
                       vae_5=None, vae_6=None,
                       vae_7=None, vae_8=None,
                       vae_9=None):
        if select == 1:
            return (vae_1, )
        elif select == 2:
            return (vae_2, )
        elif select == 3:
            return (vae_3, ) if vae_3 is not None else ()
        elif select == 4:
            return (vae_4, ) if vae_4 is not None else ()
        elif select == 5:
            return (vae_5, ) if vae_5 is not None else ()
        elif select == 6:
            return (vae_6, ) if vae_6 is not None else ()
        elif select == 7:
            return (vae_7, ) if vae_7 is not None else ()
        elif select == 8:
            return (vae_8, ) if vae_8 is not None else ()
        elif select == 9:
            return (vae_9, ) if vae_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Text_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "text_1": ("STRING", {"multiline": True}),
                "text_2": ("STRING", {"multiline": True}),
            },
            "optional": {
                "text_3": ("STRING", {"multiline": True}),  
                "text_4": ("STRING", {"multiline": True}),
                "text_5": ("STRING", {"multiline": True}),
                "text_6": ("STRING", {"multiline": True}),
                "text_7": ("STRING", {"multiline": True}),
                "text_8": ("STRING", {"multiline": True}),
                "text_9": ("STRING", {"multiline": True}), 
            }
        }

    RETURN_TYPES = ("STRING",)  # Change this to "STRING"
    FUNCTION = "txt_selector"  # Change this to "txt_selector"
    CATEGORY = "Zho模块组/Selector"

    def txt_selector(self, text_1, text_2, select=1, 
                     text_3=None, text_4=None,
                     text_5=None, text_6=None,
                     text_7=None, text_8=None,
                     text_9=None):
        if select == 1:
            return (text_1, )
        elif select == 2:
            return (text_2, )
        elif select == 3:
            return (text_3, ) if text_3 is not None else ()
        elif select == 4:
            return (text_4, ) if text_4 is not None else ()
        elif select == 5:
            return (text_5, ) if text_5 is not None else ()
        elif select == 6:
            return (text_6, ) if text_6 is not None else ()
        elif select == 7:
            return (text_7, ) if text_7 is not None else ()
        elif select == 8:
            return (text_8, ) if text_8 is not None else ()
        elif select == 9:
            return (text_9, ) if text_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Image_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "image_1": ("IMAGE",),
                "image_2": ("IMAGE",),
            },
            "optional": {
                "image_3": ("IMAGE",),  
                "image_4": ("IMAGE",), 
                "image_5": ("IMAGE",), 
                "image_6": ("IMAGE",), 
                "image_7": ("IMAGE",), 
                "image_8": ("IMAGE",), 
                "image_9": ("IMAGE",), 
            }
        }

    RETURN_TYPES = ("IMAGE",)
    FUNCTION = "image_selector"  # Change this to "image_selector"
    CATEGORY = "Zho模块组/Selector"

    def image_selector(self, image_1, image_2, select=1, 
                       image_3=None, image_4=None,
                       image_5=None, image_6=None,
                       image_7=None, image_8=None,
                       image_9=None):
        if select == 1:
            return (image_1, )
        elif select == 2:
            return (image_2, )
        elif select == 3:
            return (image_3, ) if image_3 is not None else ()
        elif select == 4:
            return (image_4, ) if image_4 is not None else ()
        elif select == 5:
            return (image_5, ) if image_5 is not None else ()
        elif select == 6:
            return (image_6, ) if image_6 is not None else ()
        elif select == 7:
            return (image_7, ) if image_7 is not None else ()
        elif select == 8:
            return (image_8, ) if image_8 is not None else ()
        elif select == 9:
            return (image_9, ) if image_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Latent_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "latent_1": ("LATENT",),
                "latent_2": ("LATENT",),
            },
            "optional": {
                "latent_3": ("LATENT",),  
                "latent_4": ("LATENT",), 
                "latent_5": ("LATENT",), 
                "latent_6": ("LATENT",), 
                "latent_7": ("LATENT",), 
                "latent_8": ("LATENT",), 
                "latent_9": ("LATENT",), 
            }
        }

    RETURN_TYPES = ("LATENT",)
    FUNCTION = "latent_selector" 
    CATEGORY = "Zho模块组/Selector"

    def latent_selector(self, latent_1, latent_2, select=1, 
                       latent_3=None, latent_4=None,
                       latent_5=None, latent_6=None,
                       latent_7=None, latent_8=None,
                       latent_9=None):
        if select == 1:
            return (latent_1, )
        elif select == 2:
            return (latent_2, )
        elif select == 3:
            return (latent_3, ) if latent_3 is not None else ()
        elif select == 4:
            return (latent_4, ) if latent_4 is not None else ()
        elif select == 5:
            return (latent_5, ) if latent_5 is not None else ()
        elif select == 6:
            return (latent_6, ) if latent_6 is not None else ()
        elif select == 7:
            return (latent_7, ) if latent_7 is not None else ()
        elif select == 8:
            return (latent_8, ) if latent_8 is not None else ()
        elif select == 9:
            return (latent_9, ) if latent_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Conditioning_Input_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "conditioning_1": ("CONDITIONING",),
                "conditioning_2": ("CONDITIONING",),
            },
            "optional": {
                "conditioning_3": ("CONDITIONING",),  
                "conditioning_4": ("CONDITIONING",), 
                "conditioning_5": ("CONDITIONING",), 
                "conditioning_6": ("CONDITIONING",), 
                "conditioning_7": ("CONDITIONING",), 
                "conditioning_8": ("CONDITIONING",), 
                "conditioning_9": ("CONDITIONING",), 
            }
        }

    RETURN_TYPES = ("CONDITIONING",)
    FUNCTION = "conditioning_input_selector"
    CATEGORY = "Zho模块组/Selector"

    def conditioning_input_selector(self, conditioning_1, conditioning_2, select=1, 
                                    conditioning_3=None, conditioning_4=None,
                                    conditioning_5=None, conditioning_6=None,
                                    conditioning_7=None, conditioning_8=None,
                                    conditioning_9=None):
        if select == 1:
            return (conditioning_1, )
        elif select == 2:
            return (conditioning_2, )
        elif select == 3:
            return (conditioning_3, ) if conditioning_3 is not None else ()
        elif select == 4:
            return (conditioning_4, ) if conditioning_4 is not None else ()
        elif select == 5:
            return (conditioning_5, ) if conditioning_5 is not None else ()
        elif select == 6:
            return (conditioning_6, ) if conditioning_6 is not None else ()
        elif select == 7:
            return (conditioning_7, ) if conditioning_7 is not None else ()
        elif select == 8:
            return (conditioning_8, ) if conditioning_8 is not None else ()
        elif select == 9:
            return (conditioning_9, ) if conditioning_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Ctrlnet_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "ctrlnet_1": ("CONDITIONING",),
                "ctrlnet_2": ("CONDITIONING",),
            },
            "optional": {
                "ctrlnet_3": ("CONDITIONING",),  
                "ctrlnet_4": ("CONDITIONING",), 
                "ctrlnet_5": ("CONDITIONING",), 
                "ctrlnet_6": ("CONDITIONING",), 
                "ctrlnet_7": ("CONDITIONING",), 
                "ctrlnet_8": ("CONDITIONING",), 
                "ctrlnet_9": ("CONDITIONING",), 
            }
        }

    RETURN_TYPES = ("CONDITIONING",)
    FUNCTION = "ctrlnet_selector"
    CATEGORY = "Zho模块组/Selector"

    def ctrlnet_selector(self, ctrlnet_1, ctrlnet_2, select=1, 
                       ctrlnet_3=None, ctrlnet_4=None,
                       ctrlnet_5=None, ctrlnet_6=None,
                       ctrlnet_7=None, ctrlnet_8=None,
                       ctrlnet_9=None):
        if select == 1:
            return (ctrlnet_1, )
        elif select == 2:
            return (ctrlnet_2, )
        elif select == 3:
            return (ctrlnet_3, ) if ctrlnet_3 is not None else ()
        elif select == 4:
            return (ctrlnet_4, ) if ctrlnet_4 is not None else ()
        elif select == 5:
            return (ctrlnet_5, ) if ctrlnet_5 is not None else ()
        elif select == 6:
            return (ctrlnet_6, ) if ctrlnet_6 is not None else ()
        elif select == 7:
            return (ctrlnet_7, ) if ctrlnet_7 is not None else ()
        elif select == 8:
            return (ctrlnet_8, ) if ctrlnet_8 is not None else ()
        elif select == 9:
            return (ctrlnet_9, ) if ctrlnet_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
NODE_CLASS_MAPPINGS = {
    "Model_Selector_Zho": Model_Selector_Zho,
    "LoRA_Selector_Zho": LoRA_Selector_Zho,
    "CLIP_Selector_Zho": CLIP_Selector_Zho,
    "VAE_Selector_Zho": VAE_Selector_Zho,
    "Text_Selector_Zho": Text_Selector_Zho,
    "Image_Selector_Zho": Image_Selector_Zho,
    "Latent_Selector_Zho": Latent_Selector_Zho,
    "Conditioning_Input_Selector_Zho": Conditioning_Input_Selector_Zho,
    "Ctrlnet_Selector_Zho": Ctrlnet_Selector_Zho,
}

Zho_Selector.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
class Model_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "model_1": ("MODEL",),
                "model_2": ("MODEL",),
            },
            "optional": {
                "model_3": ("MODEL",),  
                "model_4": ("MODEL",), 
                "model_5": ("MODEL",), 
                "model_6": ("MODEL",), 
                "model_7": ("MODEL",), 
                "model_8": ("MODEL",), 
                "model_9": ("MODEL",), 
            }
        }

    RETURN_TYPES = ("MODEL",)
    FUNCTION = "model_selector"
    CATEGORY = "Zho模块组/Selector"

    def model_selector(self, model_1, model_2, select=1, 
                       model_3=None, model_4=None,
                       model_5=None, model_6=None,
                       model_7=None, model_8=None,
                       model_9=None):
        if select == 1:
            return (model_1, )
        elif select == 2:
            return (model_2, )
        elif select == 3:
            return (model_3, ) if model_3 is not None else ()
        elif select == 4:
            return (model_4, ) if model_4 is not None else ()
        elif select == 5:
            return (model_5, ) if model_5 is not None else ()
        elif select == 6:
            return (model_6, ) if model_6 is not None else ()
        elif select == 7:
            return (model_7, ) if model_7 is not None else ()
        elif select == 8:
            return (model_8, ) if model_8 is not None else ()
        elif select == 9:
            return (model_9, ) if model_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class LoRA_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "loar_1": ("MODEL",),
                "loar_2": ("MODEL",),
            },
            "optional": {
                "loar_3": ("MODEL",),  
                "loar_4": ("MODEL",), 
                "loar_5": ("MODEL",), 
                "loar_6": ("MODEL",), 
                "loar_7": ("MODEL",), 
                "loar_8": ("MODEL",), 
                "loar_9": ("MODEL",), 
            }
        }

    RETURN_TYPES = ("MODEL",)
    FUNCTION = "lora_selector" 
    CATEGORY = "Zho模块组/Selector"

    def lora_selector(self, loar_1, loar_2, select=1, 
                       loar_3=None, loar_4=None,
                       loar_5=None, loar_6=None,
                       loar_7=None, loar_8=None,
                       loar_9=None):
        if select == 1:
            return (loar_1, )
        elif select == 2:
            return (loar_2, )
        elif select == 3:
            return (loar_3, ) if loar_3 is not None else ()
        elif select == 4:
            return (loar_4, ) if loar_4 is not None else ()
        elif select == 5:
            return (loar_5, ) if loar_5 is not None else ()
        elif select == 6:
            return (loar_6, ) if loar_6 is not None else ()
        elif select == 7:
            return (loar_7, ) if loar_7 is not None else ()
        elif select == 8:
            return (loar_8, ) if loar_8 is not None else ()
        elif select == 9:
            return (loar_9, ) if loar_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class CLIP_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "clip_1": ("CLIP",),  # 更改为 CLIP
                "clip_2": ("CLIP",),  # 更改为 CLIP
            },
            "optional": {
                "clip_3": ("CLIP",),  # 更改为 CLIP
                "clip_4": ("CLIP",),  # 更改为 CLIP
                "clip_5": ("CLIP",),  # 更改为 CLIP
                "clip_6": ("CLIP",),  # 更改为 CLIP
                "clip_7": ("CLIP",),  # 更改为 CLIP
                "clip_8": ("CLIP",),  # 更改为 CLIP
                "clip_9": ("CLIP",),  # 更改为 CLIP
            }
        }

    RETURN_TYPES = ("CLIP",)  # 更改为 CLIP
    FUNCTION = "clip_selector" 
    CATEGORY = "Zho模块组/Selector"

    def clip_selector(self, clip_1, clip_2, select=1, 
                       clip_3=None, clip_4=None,
                       clip_5=None, clip_6=None,
                       clip_7=None, clip_8=None,
                       clip_9=None):
        if select == 1:
            return (clip_1, )
        elif select == 2:
            return (clip_2, )
        elif select == 3:
            return (clip_3, ) if clip_3 is not None else ()
        elif select == 4:
            return (clip_4, ) if clip_4 is not None else ()
        elif select == 5:
            return (clip_5, ) if clip_5 is not None else ()
        elif select == 6:
            return (clip_6, ) if clip_6 is not None else ()
        elif select == 7:
            return (clip_7, ) if clip_7 is not None else ()
        elif select == 8:
            return (clip_8, ) if clip_8 is not None else ()
        elif select == 9:
            return (clip_9, ) if clip_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class VAE_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "vae_1": ("VAE",),  # 更改为 VAE
                "vae_2": ("VAE",),  # 更改为 VAE
            },
            "optional": {
                "vae_3": ("VAE",),  # 更改为 VAE
                "vae_4": ("VAE",),  # 更改为 VAE
                "vae_5": ("VAE",),  # 更改为 VAE
                "vae_6": ("VAE",),  # 更改为 VAE
                "vae_7": ("VAE",),  # 更改为 VAE
                "vae_8": ("VAE",),  # 更改为 VAE
                "vae_9": ("VAE",),  # 更改为 VAE
            }
        }

    RETURN_TYPES = ("VAE",)  # 更改为 VAE
    FUNCTION = "vae_selector" 
    CATEGORY = "Zho模块组/Selector"

    def vae_selector(self, vae_1, vae_2, select=1, 
                       vae_3=None, vae_4=None,
                       vae_5=None, vae_6=None,
                       vae_7=None, vae_8=None,
                       vae_9=None):
        if select == 1:
            return (vae_1, )
        elif select == 2:
            return (vae_2, )
        elif select == 3:
            return (vae_3, ) if vae_3 is not None else ()
        elif select == 4:
            return (vae_4, ) if vae_4 is not None else ()
        elif select == 5:
            return (vae_5, ) if vae_5 is not None else ()
        elif select == 6:
            return (vae_6, ) if vae_6 is not None else ()
        elif select == 7:
            return (vae_7, ) if vae_7 is not None else ()
        elif select == 8:
            return (vae_8, ) if vae_8 is not None else ()
        elif select == 9:
            return (vae_9, ) if vae_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Text_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "text_1": ("STRING", {"multiline": True}),
                "text_2": ("STRING", {"multiline": True}),
            },
            "optional": {
                "text_3": ("STRING", {"multiline": True}),  
                "text_4": ("STRING", {"multiline": True}),
                "text_5": ("STRING", {"multiline": True}),
                "text_6": ("STRING", {"multiline": True}),
                "text_7": ("STRING", {"multiline": True}),
                "text_8": ("STRING", {"multiline": True}),
                "text_9": ("STRING", {"multiline": True}), 
            }
        }

    RETURN_TYPES = ("STRING",)  # Change this to "STRING"
    FUNCTION = "txt_selector"  # Change this to "txt_selector"
    CATEGORY = "Zho模块组/Selector"

    def txt_selector(self, text_1, text_2, select=1, 
                     text_3=None, text_4=None,
                     text_5=None, text_6=None,
                     text_7=None, text_8=None,
                     text_9=None):
        if select == 1:
            return (text_1, )
        elif select == 2:
            return (text_2, )
        elif select == 3:
            return (text_3, ) if text_3 is not None else ()
        elif select == 4:
            return (text_4, ) if text_4 is not None else ()
        elif select == 5:
            return (text_5, ) if text_5 is not None else ()
        elif select == 6:
            return (text_6, ) if text_6 is not None else ()
        elif select == 7:
            return (text_7, ) if text_7 is not None else ()
        elif select == 8:
            return (text_8, ) if text_8 is not None else ()
        elif select == 9:
            return (text_9, ) if text_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Image_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "image_1": ("IMAGE",),
                "image_2": ("IMAGE",),
            },
            "optional": {
                "image_3": ("IMAGE",),  
                "image_4": ("IMAGE",), 
                "image_5": ("IMAGE",), 
                "image_6": ("IMAGE",), 
                "image_7": ("IMAGE",), 
                "image_8": ("IMAGE",), 
                "image_9": ("IMAGE",), 
            }
        }

    RETURN_TYPES = ("IMAGE",)
    FUNCTION = "image_selector"  # Change this to "image_selector"
    CATEGORY = "Zho模块组/Selector"

    def image_selector(self, image_1, image_2, select=1, 
                       image_3=None, image_4=None,
                       image_5=None, image_6=None,
                       image_7=None, image_8=None,
                       image_9=None):
        if select == 1:
            return (image_1, )
        elif select == 2:
            return (image_2, )
        elif select == 3:
            return (image_3, ) if image_3 is not None else ()
        elif select == 4:
            return (image_4, ) if image_4 is not None else ()
        elif select == 5:
            return (image_5, ) if image_5 is not None else ()
        elif select == 6:
            return (image_6, ) if image_6 is not None else ()
        elif select == 7:
            return (image_7, ) if image_7 is not None else ()
        elif select == 8:
            return (image_8, ) if image_8 is not None else ()
        elif select == 9:
            return (image_9, ) if image_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Latent_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "latent_1": ("LATENT",),
                "latent_2": ("LATENT",),
            },
            "optional": {
                "latent_3": ("LATENT",),  
                "latent_4": ("LATENT",), 
                "latent_5": ("LATENT",), 
                "latent_6": ("LATENT",), 
                "latent_7": ("LATENT",), 
                "latent_8": ("LATENT",), 
                "latent_9": ("LATENT",), 
            }
        }

    RETURN_TYPES = ("LATENT",)
    FUNCTION = "latent_selector" 
    CATEGORY = "Zho模块组/Selector"

    def latent_selector(self, latent_1, latent_2, select=1, 
                       latent_3=None, latent_4=None,
                       latent_5=None, latent_6=None,
                       latent_7=None, latent_8=None,
                       latent_9=None):
        if select == 1:
            return (latent_1, )
        elif select == 2:
            return (latent_2, )
        elif select == 3:
            return (latent_3, ) if latent_3 is not None else ()
        elif select == 4:
            return (latent_4, ) if latent_4 is not None else ()
        elif select == 5:
            return (latent_5, ) if latent_5 is not None else ()
        elif select == 6:
            return (latent_6, ) if latent_6 is not None else ()
        elif select == 7:
            return (latent_7, ) if latent_7 is not None else ()
        elif select == 8:
            return (latent_8, ) if latent_8 is not None else ()
        elif select == 9:
            return (latent_9, ) if latent_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Conditioning_Input_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "conditioning_1": ("CONDITIONING",),
                "conditioning_2": ("CONDITIONING",),
            },
            "optional": {
                "conditioning_3": ("CONDITIONING",),  
                "conditioning_4": ("CONDITIONING",), 
                "conditioning_5": ("CONDITIONING",), 
                "conditioning_6": ("CONDITIONING",), 
                "conditioning_7": ("CONDITIONING",), 
                "conditioning_8": ("CONDITIONING",), 
                "conditioning_9": ("CONDITIONING",), 
            }
        }

    RETURN_TYPES = ("CONDITIONING",)
    FUNCTION = "conditioning_input_selector"
    CATEGORY = "Zho模块组/Selector"

    def conditioning_input_selector(self, conditioning_1, conditioning_2, select=1, 
                                    conditioning_3=None, conditioning_4=None,
                                    conditioning_5=None, conditioning_6=None,
                                    conditioning_7=None, conditioning_8=None,
                                    conditioning_9=None):
        if select == 1:
            return (conditioning_1, )
        elif select == 2:
            return (conditioning_2, )
        elif select == 3:
            return (conditioning_3, ) if conditioning_3 is not None else ()
        elif select == 4:
            return (conditioning_4, ) if conditioning_4 is not None else ()
        elif select == 5:
            return (conditioning_5, ) if conditioning_5 is not None else ()
        elif select == 6:
            return (conditioning_6, ) if conditioning_6 is not None else ()
        elif select == 7:
            return (conditioning_7, ) if conditioning_7 is not None else ()
        elif select == 8:
            return (conditioning_8, ) if conditioning_8 is not None else ()
        elif select == 9:
            return (conditioning_9, ) if conditioning_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
class Ctrlnet_Selector_Zho:
    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "select": ("INT", {"default": 1, "min": 1, "max": 9}),
                "ctrlnet_1": ("CONDITIONING",),
                "ctrlnet_2": ("CONDITIONING",),
            },
            "optional": {
                "ctrlnet_3": ("CONDITIONING",),  
                "ctrlnet_4": ("CONDITIONING",), 
                "ctrlnet_5": ("CONDITIONING",), 
                "ctrlnet_6": ("CONDITIONING",), 
                "ctrlnet_7": ("CONDITIONING",), 
                "ctrlnet_8": ("CONDITIONING",), 
                "ctrlnet_9": ("CONDITIONING",), 
            }
        }

    RETURN_TYPES = ("CONDITIONING",)
    FUNCTION = "ctrlnet_selector"
    CATEGORY = "Zho模块组/Selector"

    def ctrlnet_selector(self, ctrlnet_1, ctrlnet_2, select=1, 
                       ctrlnet_3=None, ctrlnet_4=None,
                       ctrlnet_5=None, ctrlnet_6=None,
                       ctrlnet_7=None, ctrlnet_8=None,
                       ctrlnet_9=None):
        if select == 1:
            return (ctrlnet_1, )
        elif select == 2:
            return (ctrlnet_2, )
        elif select == 3:
            return (ctrlnet_3, ) if ctrlnet_3 is not None else ()
        elif select == 4:
            return (ctrlnet_4, ) if ctrlnet_4 is not None else ()
        elif select == 5:
            return (ctrlnet_5, ) if ctrlnet_5 is not None else ()
        elif select == 6:
            return (ctrlnet_6, ) if ctrlnet_6 is not None else ()
        elif select == 7:
            return (ctrlnet_7, ) if ctrlnet_7 is not None else ()
        elif select == 8:
            return (ctrlnet_8, ) if ctrlnet_8 is not None else ()
        elif select == 9:
            return (ctrlnet_9, ) if ctrlnet_9 is not None else ()
        else:
            raise ValueError("Invalid select value")

#------------------------------------------------------------------------------
NODE_CLASS_MAPPINGS = {
    "Model_Selector_Zho": Model_Selector_Zho,
    "LoRA_Selector_Zho": LoRA_Selector_Zho,
    "CLIP_Selector_Zho": CLIP_Selector_Zho,
    "VAE_Selector_Zho": VAE_Selector_Zho,
    "Text_Selector_Zho": Text_Selector_Zho,
    "Image_Selector_Zho": Image_Selector_Zho,
    "Latent_Selector_Zho": Latent_Selector_Zho,
    "Conditioning_Input_Selector_Zho": Conditioning_Input_Selector_Zho,
    "Ctrlnet_Selector_Zho": Ctrlnet_Selector_Zho,
}

Zho_Selector/Zho_Selector.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
from .Zho_Selector import NODE_CLASS_MAPPINGS

__all__ = ['NODE_CLASS_MAPPINGS']
Zho_Selector/__init__.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
import torch

from nodes import CLIPTextEncode

from comfy.sd import CLIP, VAE

import comfy.model_patcher

import comfy.sd

import folder_paths

MAX_RESOLUTION=8192
#------------------------------------------------------------------------------
def load_checkpoint(主模型,output_vae=True, output_clip=True):

        ckpt_path = folder_paths.get_full_path("checkpoints", 主模型)
        out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True,
                                                    embedding_directory=folder_paths.get_folder_paths("embeddings"))

        model = out[0]
        clip = out[1]
        vae = out[2]

        return model, clip, vae

#------------------------------------------------------------------------------
def load_lora(model, clip, Lora模型, Lora模型强度, Loraclip强度):

        lora_path = folder_paths.get_full_path("loras", Lora模型)
        lora = None
        if lora is None:
            lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
        model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, Lora模型强度, Loraclip强度)
        return (model_lora, clip_lora)

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

#------------------------------------------------------------------------------
class 综合输入器_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "Clip跳过层": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "交换宽高": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
                    "生成数量": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "正向提示词": ("STRING", {"default": "正向提示词", "multiline": True}),           
                    "负向提示词": ("STRING", {"default": "负向提示词", "multiline": True}),
                    "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
                    "步数": ("INT", {"default": 20, "min": 1, "max": 10000}),
                    "CFG": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}),
                    "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("INT", "INT", "INT", "INT", "STRING", "STRING", "INT", "INT", "FLOAT", "FLOAT",)
    RETURN_NAMES = ("Clip跳过层", "宽度", "高度", "生成数量", "正向提示词", "负向提示词", "seed", "步数", "CFG", "降噪值",  )
    
    FUNCTION = "Zho_co_input"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_input(self, Clip跳过层, 宽度, 高度, 生成数量, 正向提示词, 负向提示词, seed, 步数, CFG, denoise, 交换宽高=False ):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if 交换宽高:
            宽度, 高度 = swap_width_height(宽度, 高度)

        return (Clip跳过层, 宽度, 高度, 生成数量, 正向提示词, 负向提示词, seed, 步数, CFG, denoise,  )

#------------------------------------------------------------------------------
class 模型加载器_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "主模型": (folder_paths.get_filename_list("checkpoints"), ),
                    "Clip跳过层": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "VAE模型": (["自带VAE"] + folder_paths.get_filename_list("vae"), ),
                    "Lora模型": (["无"] + folder_paths.get_filename_list("loras"), ),
                    "Lora模型强度": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    "Loraclip强度": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("MODEL", "CLIP", "VAE",)
    RETURN_NAMES = ("主模型", "CLIP模型", "VAE模型",)
    
    FUNCTION = "Zho_co_model_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_model_loader(self, 主模型, Clip跳过层, VAE模型, Lora模型, Lora模型强度, Loraclip强度):

        model: ModelPatcher | None = None
        clip: CLIP | None = None
        vae: VAE | None = None
        
        #主模型
        model, clip, vae = load_checkpoint(主模型)
        
        #Lora模型
        if Lora模型 != "无":
            model, clip = load_lora(model, clip, Lora模型, Lora模型强度, Loraclip强度)

        #Clip跳过层        
        clip = clip.clone()
        clip.clip_layer(Clip跳过层)

        #VAE
        if VAE模型 != "自带VAE":        
           vae_path = folder_paths.get_full_path("vae", VAE模型)
           vae = comfy.sd.VAE(ckpt_path=vae_path)

        return (model, clip, vae, )

#------------------------------------------------------------------------------
class 参数加载器_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "clip": ("CLIP", ),
                    "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "生成数量": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "正向提示词": ("STRING", {"default": "正向提示词", "multiline": True}),           
                    "负向提示词": ("STRING", {"default": "负向提示词", "multiline": True}),
                    }}
    
    RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "LATENT",)
    RETURN_NAMES = ("正向条件", "负向条件", "LATENT",)
    
    FUNCTION = "Zho_co_parameter_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_parameter_loader(self, 正向提示词, 负向提示词, 宽度, 高度, 生成数量, clip):

        #潜空间图像
        latent = torch.zeros([生成数量, 4, 高度 // 8, 宽度 // 8])

        positive_encoded = negative_encoded = None
        positive_encoded = CLIPTextEncode().encode(clip, 正向提示词)[0]
        negative_encoded = CLIPTextEncode().encode(clip, 负向提示词)[0]

        return (positive_encoded, negative_encoded, {"samples":latent}, )

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

# 修改初始潜空间_Zho类
class 初始潜空间_交换_Zho:
    def __init__(self, device="cpu"):
        self.device = device

    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {
            "宽度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "高度": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "批次数": ("INT", {"default": 1, "min": 1, "max": 64}),
            "交换宽高": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
        }}

    RETURN_TYPES = ("LATENT",)
    RETURN_NAMES = ("潜空间",)
    FUNCTION = "generate"

    CATEGORY = "Zho模块组/Standard标准组"

    def generate(self, 宽度, 高度, 批次数=1, 交换宽高=False):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if 交换宽高:
            宽度, 高度 = swap_width_height(宽度, 高度)

        latent = torch.zeros([批次数, 4, 高度 // 8, 宽度 // 8])
        return ({"samples": latent}, )

#------------------------------------------------------------------------------
NODE_CLASS_MAPPINGS = {
    "综合输入器_Zho": 综合输入器_Zho,
    "模型加载器_Zho": 模型加载器_Zho,
    "参数加载器_Zho": 参数加载器_Zho,
    "初始潜空间_交换_Zho": 初始潜空间_交换_Zho,
}

Zho_Standard__new.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
import torch

from nodes import CLIPTextEncode

from comfy.sd import CLIP, VAE

import comfy.model_patcher

import comfy.sd

import folder_paths

MAX_RESOLUTION=8192
#------------------------------------------------------------------------------
def load_checkpoint(ckpt_name, output_vae=True, output_clip=True):

        ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)
        out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True,
                                                    embedding_directory=folder_paths.get_folder_paths("embeddings"))

        model = out[0]
        clip = out[1]
        vae = out[2]

        return model, clip, vae

#------------------------------------------------------------------------------
def load_lora(model, clip, lora_name, strength_model, strength_clip):

        lora_path = folder_paths.get_full_path("loras", lora_name)
        lora = None
        if lora is None:
            lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
        model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, strength_model, strength_clip)
        return (model_lora, clip_lora)

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

#------------------------------------------------------------------------------
class Co_Input_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "clip_skip": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "swap": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
                    "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "positive": ("STRING", {"default": "+正向提示词", "multiline": True}),           
                    "negative": ("STRING", {"default": "-负向提示词", "multiline": True}),
                    "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
                    "steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
                    "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}),
                    "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("INT", "INT", "INT", "INT", "STRING", "STRING", "INT", "INT", "FLOAT", "FLOAT",)
    RETURN_NAMES = ("clip_skip", "width", "height", "batch_size", "positive", "negative", "seed", "steps", "cfg", "denoise",  )
    
    FUNCTION = "Zho_co_input"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_input(self, clip_skip, width, height, batch_size, positive, negative, seed, steps, cfg, denoise, swap=False ):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if swap:
            width, height = swap_width_height(width, height)

        return (clip_skip, width, height, batch_size, positive, negative, seed, steps, cfg, denoise,  )

#------------------------------------------------------------------------------
class Co_Loader_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
                    "clip_skip": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
                    "vae_name": (["Baked VAE"] + folder_paths.get_filename_list("vae"), ),
                    "lora_name": (["None"] + folder_paths.get_filename_list("loras"), ),
                    "strength_model": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    "strength_clip": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
                    }}
    
    RETURN_TYPES = ("MODEL", "CLIP", "VAE",)
    RETURN_NAMES = ("Model", "CLIP", "VAE",)
    
    FUNCTION = "Zho_co_model_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_model_loader(self, ckpt_name, clip_skip, vae_name, lora_name, strength_model, strength_clip):

        model: ModelPatcher | None = None
        clip: CLIP | None = None
        vae: VAE | None = None
        
        #主模型
        model, clip, vae = load_checkpoint(ckpt_name)
        
        #Lora模型
        if lora_name != "None":
            model, clip = load_lora(model, clip, lora_name, strength_model, strength_clip)

        #Clip跳过层        
        clip = clip.clone()
        clip.clip_layer(clip_skip)

        #VAE
        if vae_name != "Baked VAE":        
           vae_path = folder_paths.get_full_path("vae", vae_name)
           vae = comfy.sd.VAE(ckpt_path=vae_path)

        return (model, clip, vae, )

#------------------------------------------------------------------------------
class Parameter_Loader_Zho:
    @classmethod
    def INPUT_TYPES(s):
        return {"required": {
                    "clip": ("CLIP", ),
                    "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
                    "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
                    "positive": ("STRING", {"default": "Positive", "multiline": True}),           
                    "negative": ("STRING", {"default": "Negative", "multiline": True}),
                    }}
    
    RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "LATENT",)
    RETURN_NAMES = ("Positive", "Negative", "LATENT",)
    
    FUNCTION = "Zho_co_parameter_loader"

    CATEGORY = "Zho模块组/Standard标准组"

    def Zho_co_parameter_loader(self, positive, negative, width, height, batch_size, clip):

        #潜空间图像
        latent = torch.zeros([batch_size, 4, height // 8, width // 8])

        positive_encoded = negative_encoded = None
        positive_encoded = CLIPTextEncode().encode(clip, positive)[0]
        negative_encoded = CLIPTextEncode().encode(clip, negative)[0]

        return (positive_encoded, negative_encoded, {"samples":latent}, )

#------------------------------------------------------------------------------
# 添加一个辅助函数，用于交换宽度和高度
def swap_width_height(width, height):
    return height, width

# 修改初始潜空间_Zho类
class EmptyLatent_Swap_Zho:
    def __init__(self, device="cpu"):
        self.device = device

    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {
            "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
            "batch_size": ("INT", {"default": 1, "min": 1, "max": 64}),
            "swap": ("BOOLEAN", {"default": False}),  # 添加交换宽度和高度的按钮
        }}

    RETURN_TYPES = ("LATENT",)
    RETURN_NAMES = ("LATENT",)
    FUNCTION = "generate"

    CATEGORY = "Zho模块组/Standard标准组"

    def generate(self, width, height, batch_size=1, swap=False):
        # 如果用户选择交换宽度和高度，则调用交换函数
        if swap:
            width, height = swap_width_height(width, height)

        latent = torch.zeros([batch_size, 4, height // 8, width // 8])
        return ({"samples": latent}, )

#------------------------------------------------------------------------------
NODE_CLASS_MAPPINGS = {
    "Co_Input_Zho": Co_Input_Zho,
    "Co_Loader_Zho": Co_Loader_Zho,
    "Parameter_Loader_Zho": Parameter_Loader_Zho,
    "EmptyLatent_Swap_Zho": EmptyLatent_Swap_Zho,
}

Zho_Standard__new_EN.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual
from .Zho_Selector import NODE_CLASS_MAPPINGS  as NODE_CLASS_MAPPINGS_SELECTOR
from .Zho_Standard__new import NODE_CLASS_MAPPINGS as NODE_CLASS_MAPPINGS_ZHO
from .Zho_Standard__new_EN import NODE_CLASS_MAPPINGS  as NODE_CLASS_MAPPINGS_EN

# Combine the dictionaries
NODE_CLASS_MAPPINGS = {**NODE_CLASS_MAPPINGS_SELECTOR, **NODE_CLASS_MAPPINGS_ZHO, **NODE_CLASS_MAPPINGS_EN}

__all__ = ['NODE_CLASS_MAPPINGS']

__init__.py
ZHO-ZHO-ZHO/ComfyUI-Selector-CoInput-Multilingual