2020sys .path .insert (0 , os .path .join (os .path .dirname (os .path .realpath (__file__ )), "comfy" ))
2121
2222import comfy .diffusers_load
23- import comfy .samplers
23+ import comfy .samplersa
2424import comfy .sample
2525import comfy .sd
2626import comfy .utils
@@ -204,7 +204,6 @@ def append(self, conditioning, strength):
204204 c = node_helpers .conditioning_set_values (conditioning , {"strength" : strength })
205205 return (c , )
206206
207-
208207class ConditioningSetMask :
209208 @classmethod
210209 def INPUT_TYPES (s ):
@@ -392,7 +391,6 @@ def encode(self, vae, pixels, mask, grow_mask_by=6):
392391
393392 return ({"samples" :t , "noise_mask" : (mask_erosion [:,:,:x ,:y ].round ())}, )
394393
395-
396394class InpaintModelConditioning :
397395 @classmethod
398396 def INPUT_TYPES (s ):
@@ -444,7 +442,6 @@ def encode(self, positive, negative, pixels, vae, mask, noise_mask=True):
444442 out .append (c )
445443 return (out [0 ], out [1 ], out_latent )
446444
447-
448445class SaveLatent :
449446 def __init__ (self ):
450447 self .output_dir = folder_paths .get_output_directory ()
@@ -495,7 +492,6 @@ def save(self, samples, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=No
495492 comfy .utils .save_torch_file (output , file , metadata = metadata )
496493 return { "ui" : { "latents" : results } }
497494
498-
499495class LoadLatent :
500496 @classmethod
501497 def INPUT_TYPES (s ):
@@ -531,7 +527,6 @@ def VALIDATE_INPUTS(s, latent):
531527 return "Invalid latent file: {}" .format (latent )
532528 return True
533529
534-
535530class CheckpointLoader :
536531 @classmethod
537532 def INPUT_TYPES (s ):
@@ -596,7 +591,6 @@ def load_checkpoint(self, model_path, output_vae=True, output_clip=True):
596591
597592 return comfy .diffusers_load .load_diffusers (model_path , output_vae = output_vae , output_clip = output_clip , embedding_directory = folder_paths .get_folder_paths ("embeddings" ))
598593
599-
600594class unCLIPCheckpointLoader :
601595 @classmethod
602596 def INPUT_TYPES (s ):
@@ -803,7 +797,6 @@ def load_controlnet(self, model, control_net_name):
803797 controlnet = comfy .controlnet .load_controlnet (controlnet_path , model )
804798 return (controlnet ,)
805799
806-
807800class ControlNetApply :
808801 @classmethod
809802 def INPUT_TYPES (s ):
@@ -834,7 +827,6 @@ def apply_controlnet(self, conditioning, control_net, image, strength):
834827 c .append (n )
835828 return (c , )
836829
837-
838830class ControlNetApplyAdvanced :
839831 @classmethod
840832 def INPUT_TYPES (s ):
@@ -884,7 +876,6 @@ def apply_controlnet(self, positive, negative, control_net, image, strength, sta
884876 out .append (c )
885877 return (out [0 ], out [1 ])
886878
887-
888879class UNETLoader :
889880 @classmethod
890881 def INPUT_TYPES (s ):
@@ -1039,7 +1030,6 @@ def load_style_model(self, style_model_name):
10391030 style_model = comfy .sd .load_style_model (style_model_path )
10401031 return (style_model ,)
10411032
1042-
10431033class StyleModelApply :
10441034 @classmethod
10451035 def INPUT_TYPES (s ):
@@ -1200,7 +1190,6 @@ def generate(self, width, height, batch_size=1):
12001190 latent = torch .zeros ([batch_size , 4 , height // 8 , width // 8 ], device = self .device )
12011191 return ({"samples" :latent }, )
12021192
1203-
12041193class LatentFromBatch :
12051194 @classmethod
12061195 def INPUT_TYPES (s ):
@@ -1763,7 +1752,6 @@ def VALIDATE_INPUTS(s, image):
17631752
17641753 return True
17651754
1766-
17671755class LoadImageOutput (LoadImage ):
17681756 @classmethod
17691757 def INPUT_TYPES (s ):
@@ -1792,7 +1780,6 @@ def load_image_output(self, image):
17921780 def VALIDATE_INPUTS (s , image ):
17931781 return True
17941782
1795-
17961783class ImageScale :
17971784 upscale_methods = ["nearest-exact" , "bilinear" , "area" , "bicubic" , "lanczos" ]
17981785 crop_methods = ["disabled" , "center" ]
@@ -1960,74 +1947,73 @@ def expand_image(self, image, left, top, right, bottom, feathering):
19601947
19611948 return (new_image , mask )
19621949
1963-
19641950NODE_CLASS_MAPPINGS = {
1965- "KSampler" : KSampler ,
1966- "CheckpointLoaderSimple" : CheckpointLoaderSimple ,
1967- "CLIPTextEncode" : CLIPTextEncode ,
1968- "CLIPSetLastLayer" : CLIPSetLastLayer ,
1969- "VAEDecode" : VAEDecode ,
1970- "VAEEncode" : VAEEncode ,
1971- "VAEEncodeForInpaint" : VAEEncodeForInpaint ,
1972- "VAELoader" : VAELoader ,
1973- "EmptyLatentImage" : EmptyLatentImage ,
1974- "LatentUpscale" : LatentUpscale ,
1975- "LatentUpscaleBy" : LatentUpscaleBy ,
1976- "LatentFromBatch" : LatentFromBatch ,
1977- "RepeatLatentBatch" : RepeatLatentBatch ,
1978- "SaveImage" : SaveImage ,
1979- "PreviewImage" : PreviewImage ,
1980- "LoadImage" : LoadImage ,
1981- "LoadImageMask" : LoadImageMask ,
1982- "LoadImageOutput" : LoadImageOutput ,
1983- "ImageScale" : ImageScale ,
1984- "ImageScaleBy" : ImageScaleBy ,
1985- "ImageInvert" : ImageInvert ,
1986- "ImageBatch" : ImageBatch ,
1987- "ImagePadForOutpaint" : ImagePadForOutpaint ,
1988- "EmptyImage" : EmptyImage ,
1989- "ConditioningAverage" : ConditioningAverage ,
1990- "ConditioningCombine" : ConditioningCombine ,
1991- "ConditioningConcat" : ConditioningConcat ,
1992- "ConditioningSetArea" : ConditioningSetArea ,
1993- "ConditioningSetAreaPercentage" : ConditioningSetAreaPercentage ,
1994- "ConditioningSetAreaStrength" : ConditioningSetAreaStrength ,
1995- "ConditioningSetMask" : ConditioningSetMask ,
1996- "KSamplerAdvanced" : KSamplerAdvanced ,
1997- "SetLatentNoiseMask" : SetLatentNoiseMask ,
1998- "LatentComposite" : LatentComposite ,
1999- "LatentBlend" : LatentBlend ,
2000- "LatentRotate" : LatentRotate ,
2001- "LatentFlip" : LatentFlip ,
2002- "LatentCrop" : LatentCrop ,
2003- "LoraLoader" : LoraLoader ,
2004- "CLIPLoader" : CLIPLoader ,
2005- "UNETLoader" : UNETLoader ,
2006- "DualCLIPLoader" : DualCLIPLoader ,
2007- "CLIPVisionEncode" : CLIPVisionEncode ,
2008- "StyleModelApply" : StyleModelApply ,
2009- "unCLIPConditioning" : unCLIPConditioning ,
2010- "ControlNetApply" : ControlNetApply ,
2011- "ControlNetApplyAdvanced" : ControlNetApplyAdvanced ,
2012- "ControlNetLoader" : ControlNetLoader ,
2013- "DiffControlNetLoader" : DiffControlNetLoader ,
2014- "StyleModelLoader" : StyleModelLoader ,
2015- "CLIPVisionLoader" : CLIPVisionLoader ,
2016- "VAEDecodeTiled" : VAEDecodeTiled ,
2017- "VAEEncodeTiled" : VAEEncodeTiled ,
2018- "unCLIPCheckpointLoader" : unCLIPCheckpointLoader ,
2019- "GLIGENLoader" : GLIGENLoader ,
2020- "GLIGENTextBoxApply" : GLIGENTextBoxApply ,
2021- "InpaintModelConditioning" : InpaintModelConditioning ,
2022-
2023- "CheckpointLoader" : CheckpointLoader ,
2024- "DiffusersLoader" : DiffusersLoader ,
2025-
2026- "LoadLatent" : LoadLatent ,
2027- "SaveLatent" : SaveLatent ,
2028-
2029- "ConditioningZeroOut" : ConditioningZeroOut ,
2030- "ConditioningSetTimestepRange" : ConditioningSetTimestepRange ,
1951+ # "KSampler": KSampler,
1952+ # "CheckpointLoaderSimple": CheckpointLoaderSimple,
1953+ # "CLIPTextEncode": CLIPTextEncode,
1954+ # "CLIPSetLastLayer": CLIPSetLastLayer,
1955+ # "VAEDecode": VAEDecode,
1956+ # "VAEEncode": VAEEncode,
1957+ # "VAEEncodeForInpaint": VAEEncodeForInpaint,
1958+ # "VAELoader": VAELoader,
1959+ # "EmptyLatentImage": EmptyLatentImage,
1960+ # "LatentUpscale": LatentUpscale,
1961+ # "LatentUpscaleBy": LatentUpscaleBy,
1962+ # "LatentFromBatch": LatentFromBatch,
1963+ # "RepeatLatentBatch": RepeatLatentBatch,
1964+ # "SaveImage": SaveImage,
1965+ # "PreviewImage": PreviewImage,
1966+ # "LoadImage": LoadImage,
1967+ # "LoadImageMask": LoadImageMask,
1968+ # "LoadImageOutput": LoadImageOutput,
1969+ # "ImageScale": ImageScale,
1970+ # "ImageScaleBy": ImageScaleBy,
1971+ # "ImageInvert": ImageInvert,
1972+ # "ImageBatch": ImageBatch,
1973+ # "ImagePadForOutpaint": ImagePadForOutpaint,
1974+ # "EmptyImage": EmptyImage,
1975+ # "ConditioningAverage": ConditioningAverage ,
1976+ # "ConditioningCombine": ConditioningCombine,
1977+ # "ConditioningConcat": ConditioningConcat,
1978+ # "ConditioningSetArea": ConditioningSetArea,
1979+ # "ConditioningSetAreaPercentage": ConditioningSetAreaPercentage,
1980+ # "ConditioningSetAreaStrength": ConditioningSetAreaStrength,
1981+ # "ConditioningSetMask": ConditioningSetMask,
1982+ # "KSamplerAdvanced": KSamplerAdvanced,
1983+ # "SetLatentNoiseMask": SetLatentNoiseMask,
1984+ # "LatentComposite": LatentComposite,
1985+ # "LatentBlend": LatentBlend,
1986+ # "LatentRotate": LatentRotate,
1987+ # "LatentFlip": LatentFlip,
1988+ # "LatentCrop": LatentCrop,
1989+ # "LoraLoader": LoraLoader,
1990+ # "CLIPLoader": CLIPLoader,
1991+ # "UNETLoader": UNETLoader,
1992+ # "DualCLIPLoader": DualCLIPLoader,
1993+ # "CLIPVisionEncode": CLIPVisionEncode,
1994+ # "StyleModelApply": StyleModelApply,
1995+ # "unCLIPConditioning": unCLIPConditioning,
1996+ # "ControlNetApply": ControlNetApply,
1997+ # "ControlNetApplyAdvanced": ControlNetApplyAdvanced,
1998+ # "ControlNetLoader": ControlNetLoader,
1999+ # "DiffControlNetLoader": DiffControlNetLoader,
2000+ # "StyleModelLoader": StyleModelLoader,
2001+ # "CLIPVisionLoader": CLIPVisionLoader,
2002+ # "VAEDecodeTiled": VAEDecodeTiled,
2003+ # "VAEEncodeTiled": VAEEncodeTiled,
2004+ # "unCLIPCheckpointLoader": unCLIPCheckpointLoader,
2005+ # "GLIGENLoader": GLIGENLoader,
2006+ # "GLIGENTextBoxApply": GLIGENTextBoxApply,
2007+ # "InpaintModelConditioning": InpaintModelConditioning,
2008+ #
2009+ # "CheckpointLoader": CheckpointLoader,
2010+ # "DiffusersLoader": DiffusersLoader,
2011+ #
2012+ # "LoadLatent": LoadLatent,
2013+ # "SaveLatent": SaveLatent,
2014+ #
2015+ # "ConditioningZeroOut": ConditioningZeroOut,
2016+ # "ConditioningSetTimestepRange": ConditioningSetTimestepRange,
20312017 "LoraLoaderModelOnly" : LoraLoaderModelOnly ,
20322018}
20332019
@@ -2103,7 +2089,6 @@ def expand_image(self, image, left, top, right, bottom, feathering):
21032089# Dictionary of successfully loaded module names and associated directories.
21042090LOADED_MODULE_DIRS = {}
21052091
2106-
21072092def get_module_name (module_path : str ) -> str :
21082093 """
21092094 Returns the module name based on the given module path.
@@ -2125,7 +2110,6 @@ def get_module_name(module_path: str) -> str:
21252110 base_path = os .path .splitext (base_path )[0 ]
21262111 return base_path
21272112
2128-
21292113def load_custom_node (module_path : str , ignore = set (), module_parent = "custom_nodes" ) -> bool :
21302114 module_name = os .path .basename (module_path )
21312115 if os .path .isfile (module_path ):
@@ -2276,7 +2260,6 @@ def init_builtin_extra_nodes():
22762260
22772261 return import_failed
22782262
2279-
22802263def init_extra_nodes (init_custom_nodes = True ):
22812264 import_failed = init_builtin_extra_nodes ()
22822265
0 commit comments