restructure and rename to be more generic

This commit is contained in:
Tasha Upchurch
2023-05-25 14:41:25 -04:00
parent 9807e12198
commit d70859a5da
4 changed files with 120 additions and 92 deletions
+58 -27
View File
@@ -1,12 +1,21 @@
NODE_CLASS_MAPPINGS = {}
try:
import comfy.samplers
from custom_nodes.EternalKernelLiteGraphNodes.image import PreviewImageTest
from custom_nodes.EternalKernelLiteGraphNodes.image import TinyTxtToImg
use_generic_nodes = False
except:
use_generic_nodes = True
print("Failed to import comfy.samplers, assuming no comfyui skipping SD related nodes")
from custom_nodes.EternalKernelLiteGraphNodes.latent import LatentInterpolation
from custom_nodes.EternalKernelLiteGraphNodes.image import PadToMatch
from custom_nodes.EternalKernelLiteGraphNodes.image import PadToMatch
from custom_nodes.EternalKernelLiteGraphNodes.image import StackImages
from custom_nodes.EternalKernelLiteGraphNodes.image import ImageBC
from custom_nodes.EternalKernelLiteGraphNodes.image import RGBA_MOD
from custom_nodes.EternalKernelLiteGraphNodes.image import rgba_lower_clip
from custom_nodes.EternalKernelLiteGraphNodes.image import rgba_upper_clip
from custom_nodes.EternalKernelLiteGraphNodes.image import rgba_merge
from custom_nodes.EternalKernelLiteGraphNodes.image import rgba_split
from custom_nodes.EternalKernelLiteGraphNodes.image import select_from_batch
@@ -15,34 +24,56 @@ from custom_nodes.EternalKernelLiteGraphNodes.image import SelectFromRGBSimilari
from custom_nodes.EternalKernelLiteGraphNodes.image import LoadImage
from custom_nodes.EternalKernelLiteGraphNodes.image import PromptTemplate
from custom_nodes.EternalKernelLiteGraphNodes.image import ExecWidget
from custom_nodes.EternalKernelLiteGraphNodes.image import TinyTxtToImg
from custom_nodes.EternalKernelLiteGraphNodes.image import ImageDistanceMask
from custom_nodes.EternalKernelLiteGraphNodes.image import PreviewImageTest
from custom_nodes.EternalKernelLiteGraphNodes.image import ImageDistanceMask
from custom_nodes.EternalKernelLiteGraphNodes.nlp import NODE_CLASS_MAPPINGS as NLP_NODE_CLASS_MAPPINGS
NODE_CLASS_MAPPINGS = {
"Interpolation": LatentInterpolation,
"Image Pad To Match": PadToMatch,
"Image Stack": StackImages,
"Image B/C": ImageBC,
"Image RGBA Mod": RGBA_MOD,
"Image RGBA Lower Clip": rgba_lower_clip,
"Image RGBA Upper Clip": rgba_upper_clip,
"Image RGBA Merge": rgba_merge,
"Image RGBA Split": rgba_split,
"Select From Batch": select_from_batch,
"Quantize": Quantize,
"Select From RGB Similarity": SelectFromRGBSimilarity,
"Load Layered Image": LoadImage,
"Prompt Template": PromptTemplate,
"Eval Widget": ExecWidget,
"Tiny Txt 2 Img":TinyTxtToImg,
"Image Distance Mask":ImageDistanceMask,
"Preview Image Test":PreviewImageTest,
}
for k,v in NLP_NODE_CLASS_MAPPINGS.items():
NODE_CLASS_MAPPINGS[k] = v
if use_generic_nodes:
NODE_CLASS_MAPPINGS_GENERIC = {
"Interpolation": LatentInterpolation,
"Image Pad To Match": PadToMatch,
"Image Stack": StackImages,
"Image B/C": ImageBC,
"Image RGBA Mod": RGBA_MOD,
"Image RGBA Lower Clip": rgba_lower_clip,
"Image RGBA Upper Clip": rgba_upper_clip,
"Image RGBA Merge": rgba_merge,
"Image RGBA Split": rgba_split,
"Select From Batch": select_from_batch,
"Quantize": Quantize,
"Select From RGB Similarity": SelectFromRGBSimilarity,
"Load Layered Image": LoadImage,
"Eval Widget": ExecWidget,
"Image Distance Mask": ImageDistanceMask,
}
NODE_CLASS_MAPPINGS.update(NODE_CLASS_MAPPINGS_GENERIC)
else:
NODE_CLASS_MAPPINGS_COMFY = {
"Interpolation": LatentInterpolation,
"Image Pad To Match": PadToMatch,
"Image Stack": StackImages,
"Image B/C": ImageBC,
"Image RGBA Mod": RGBA_MOD,
"Image RGBA Lower Clip": rgba_lower_clip,
"Image RGBA Upper Clip": rgba_upper_clip,
"Image RGBA Merge": rgba_merge,
"Image RGBA Split": rgba_split,
"Select From Batch": select_from_batch,
"Quantize": Quantize,
"Select From RGB Similarity": SelectFromRGBSimilarity,
"Load Layered Image": LoadImage,
"Prompt Template": PromptTemplate,
"Eval Widget": ExecWidget,
"Tiny Txt 2 Img": TinyTxtToImg,
"Image Distance Mask": ImageDistanceMask,
"Preview Image Test": PreviewImageTest,
}
NODE_CLASS_MAPPINGS.update(NODE_CLASS_MAPPINGS_COMFY)
for k, v in NLP_NODE_CLASS_MAPPINGS.items():
NODE_CLASS_MAPPINGS[k] = v