mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-09 03:17:05 +08:00
Make CLIP nodes input 'type' more dynamic
This commit is contained in:
parent
7ecd5e9614
commit
a2a8d5195d
17
comfy/sd.py
17
comfy/sd.py
@ -704,6 +704,23 @@ class CLIPType(Enum):
|
|||||||
LUMINA2 = 12
|
LUMINA2 = 12
|
||||||
WAN = 13
|
WAN = 13
|
||||||
|
|
||||||
|
class SingleCLIP(Enum):
|
||||||
|
STABLE_DIFFUSION = "stable_diffusion"
|
||||||
|
STABLE_CASCADE = "stable_cascade"
|
||||||
|
SD3 = "sd3"
|
||||||
|
STABLE_AUDIO = "stable_audio"
|
||||||
|
MOCHI = "mochi"
|
||||||
|
LTXV = "ltxv"
|
||||||
|
PIXART = "pixart"
|
||||||
|
COSMOS = "cosmos"
|
||||||
|
LUMINA2 = "lumina2"
|
||||||
|
WAN = "wan"
|
||||||
|
|
||||||
|
class DualCLIP(Enum):
|
||||||
|
SDXL = "sdxl"
|
||||||
|
SD3 = "sd3"
|
||||||
|
FLUX = "flux"
|
||||||
|
HUNYUAN_VIDEO = "hunyuan_video"
|
||||||
|
|
||||||
def load_clip(ckpt_paths, embedding_directory=None, clip_type=CLIPType.STABLE_DIFFUSION, model_options={}):
|
def load_clip(ckpt_paths, embedding_directory=None, clip_type=CLIPType.STABLE_DIFFUSION, model_options={}):
|
||||||
clip_data = []
|
clip_data = []
|
||||||
|
|||||||
7
nodes.py
7
nodes.py
@ -31,6 +31,7 @@ import comfy.clip_vision
|
|||||||
|
|
||||||
import comfy.model_management
|
import comfy.model_management
|
||||||
from comfy.cli_args import args
|
from comfy.cli_args import args
|
||||||
|
from comfy.sd import SingleCLIP, DualCLIP
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
@ -916,8 +917,9 @@ class UNETLoader:
|
|||||||
class CLIPLoader:
|
class CLIPLoader:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
|
single_clip_types = [member.value for member in SingleCLIP]
|
||||||
return {"required": { "clip_name": (folder_paths.get_filename_list("text_encoders"), ),
|
return {"required": { "clip_name": (folder_paths.get_filename_list("text_encoders"), ),
|
||||||
"type": (["stable_diffusion", "stable_cascade", "sd3", "stable_audio", "mochi", "ltxv", "pixart", "cosmos", "lumina2", "wan"], ),
|
"type": (single_clip_types, ),
|
||||||
},
|
},
|
||||||
"optional": {
|
"optional": {
|
||||||
"device": (["default", "cpu"], {"advanced": True}),
|
"device": (["default", "cpu"], {"advanced": True}),
|
||||||
@ -943,9 +945,10 @@ class CLIPLoader:
|
|||||||
class DualCLIPLoader:
|
class DualCLIPLoader:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
|
dual_clip_types = [member.value for member in DualCLIP]
|
||||||
return {"required": { "clip_name1": (folder_paths.get_filename_list("text_encoders"), ),
|
return {"required": { "clip_name1": (folder_paths.get_filename_list("text_encoders"), ),
|
||||||
"clip_name2": (folder_paths.get_filename_list("text_encoders"), ),
|
"clip_name2": (folder_paths.get_filename_list("text_encoders"), ),
|
||||||
"type": (["sdxl", "sd3", "flux", "hunyuan_video"], ),
|
"type": (dual_clip_types, ),
|
||||||
},
|
},
|
||||||
"optional": {
|
"optional": {
|
||||||
"device": (["default", "cpu"], {"advanced": True}),
|
"device": (["default", "cpu"], {"advanced": True}),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user