mirror of
https://github.com/tusharbhutt/Endless-Nodes.git
synced 2026-03-21 20:42:12 -03:00
Add files via upload
Forgot to upload the proper init that finds the web dev
This commit is contained in:
174
__init__.py
174
__init__.py
@@ -1,31 +1,62 @@
|
||||
# nodes/__init__.py
|
||||
|
||||
# Import NODE_CLASS_MAPPINGS and NODE_DISPLAY_NAME_MAPPINGS from each submodule if present
|
||||
try:
|
||||
from .batchers import NODE_CLASS_MAPPINGS as BATCH_PROCESSOR_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as BATCH_PROCESSOR_NAMES
|
||||
except ImportError:
|
||||
BATCH_PROCESSOR_CLASSES, BATCH_PROCESSOR_NAMES = {}, {}
|
||||
# =========================
|
||||
# 💉 Import Common
|
||||
# =========================
|
||||
|
||||
from .utils.common import inject_descriptions, NODE_DESCRIPTIONS
|
||||
|
||||
# =========================
|
||||
# 💉 Set JavaScript
|
||||
# =========================
|
||||
|
||||
WEB_DIRECTORY = "./web/"
|
||||
|
||||
|
||||
# =========================
|
||||
# 🧩 Submodule Imports
|
||||
# =========================
|
||||
|
||||
try:
|
||||
from .image_analysis import NODE_CLASS_MAPPINGS as IMG_ANALYSIS_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as IMG_ANALYSIS_NAMES
|
||||
except ImportError:
|
||||
IMG_ANALYSIS_CLASSES, IMG_ANALYSIS_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .image_loader import NODE_CLASS_MAPPINGS as IMAGE_LOADER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as IMAGE_LOADER_NAMES
|
||||
except ImportError:
|
||||
IMAGE_LOADER_CLASSES, IMAGE_LOADER_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .image_saver import NODE_CLASS_MAPPINGS as IMG_SAVER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as IMG_SAVER_NAMES
|
||||
except ImportError:
|
||||
IMG_SAVER_CLASSES, IMG_SAVER_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .image_scorer import NODE_CLASS_MAPPINGS as IMG_SCORER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as IMG_SCORER_NAMES
|
||||
except ImportError:
|
||||
IMG_SCORER_CLASSES, IMG_SCORER_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .batchers import NODE_CLASS_MAPPINGS as BATCH_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as BATCH_NAMES
|
||||
except ImportError:
|
||||
BATCH_CLASSES, BATCH_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .randomizers import NODE_CLASS_MAPPINGS as RANDOMIZER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as RANDOMIZER_NAMES
|
||||
except ImportError:
|
||||
RANDOMIZER_CLASSES, RANDOMIZER_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .random_prompt_selectors import NODE_CLASS_MAPPINGS as PROMPT_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as PROMPT_NAMES
|
||||
except ImportError:
|
||||
PROMPT_CLASSES, PROMPT_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .image_saver import NODE_CLASS_MAPPINGS as SAVER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as SAVER_NAMES
|
||||
except ImportError:
|
||||
SAVER_CLASSES, SAVER_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .image_loader import NODE_CLASS_MAPPINGS as LOADER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as LOADER_NAMES
|
||||
except ImportError:
|
||||
LOADER_CLASSES, LOADER_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .text_switches import NODE_CLASS_MAPPINGS as TEXT_SWITCH_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as TEXT_SWITCH_NAMES
|
||||
except ImportError:
|
||||
TEXT_SWITCH_CLASSES, TEXT_SWITCH_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .int_switches import NODE_CLASS_MAPPINGS as INT_SWITCH_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as INT_SWITCH_NAMES
|
||||
except ImportError:
|
||||
@@ -37,55 +68,106 @@ except ImportError:
|
||||
INT_WIDGET_CLASSES, INT_WIDGET_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .random_prompt_selectors import NODE_CLASS_MAPPINGS as PROMPT_SELECTOR_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as PROMPT_SELECTOR_NAMES
|
||||
from .type_converter import NODE_CLASS_MAPPINGS as TYPE_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as TYPE_NAMES
|
||||
except ImportError:
|
||||
PROMPT_SELECTOR_CLASSES, PROMPT_SELECTOR_NAMES = {}, {}
|
||||
TYPE_CLASSES, TYPE_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .randomizers import NODE_CLASS_MAPPINGS as RANDOMIZER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as RANDOMIZER_NAMES
|
||||
except ImportError:
|
||||
RANDOMIZER_CLASSES, RANDOMIZER_NAMES = {}, {}
|
||||
from .embedders.endless_embedder_nodes import NODE_CLASS_MAPPINGS as EMBEDDER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as EMBEDDER_NAMES
|
||||
except Exception as e:
|
||||
EMBEDDER_CLASSES, EMBEDDER_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .text_switches import NODE_CLASS_MAPPINGS as TEXT_SWITCH_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as TEXT_SWITCH_NAMES
|
||||
except ImportError:
|
||||
TEXT_SWITCH_CLASSES, TEXT_SWITCH_NAMES = {}, {}
|
||||
from .utils import NODE_CLASS_MAPPINGS as UTILS_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as UTILS_NAMES
|
||||
except Exception as e:
|
||||
UTILS_CLASSES, UTILS_NAMES = {}, {}
|
||||
|
||||
try:
|
||||
from .type_converter import NODE_CLASS_MAPPINGS as TYPE_CONVERTER_CLASSES, NODE_DISPLAY_NAME_MAPPINGS as TYPE_CONVERTER_NAMES
|
||||
except ImportError:
|
||||
TYPE_CONVERTER_CLASSES, TYPE_CONVERTER_NAMES = {}, {}
|
||||
|
||||
# Combine all NODE_CLASS_MAPPINGS
|
||||
# =====================
|
||||
# 📦 Dependency Check (v1.3+)
|
||||
# =====================
|
||||
|
||||
|
||||
_missing = []
|
||||
_required = {
|
||||
"clip": "CLIP embeddings",
|
||||
"ftfy": "CLIP text cleanup",
|
||||
"imagehash": "Legacy image hashing",
|
||||
"scipy": "Saliency / Structural analysis",
|
||||
"sentencepiece": "Tokenizer backend for T5 models",
|
||||
"skimage": "Statistical image metrics",
|
||||
"transformers": "T5 / HuggingFace model support",
|
||||
}
|
||||
|
||||
|
||||
for lib, purpose in _required.items():
|
||||
try:
|
||||
__import__(lib)
|
||||
except ImportError:
|
||||
_missing.append(f"{lib} ({purpose})")
|
||||
|
||||
if _missing:
|
||||
print("⚠️ [Endless 🌊✨] Missing dependencies detected:")
|
||||
for m in _missing:
|
||||
print(f" ⛔ {m}")
|
||||
print("👉 Run this to fix: pip install -r requirements.txt\n")
|
||||
else:
|
||||
print("✅ [Endless 🌊✨] All runtime dependencies detected.")
|
||||
|
||||
|
||||
# =========================
|
||||
# 🧠 Compose Mappings
|
||||
# =========================
|
||||
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_CLASS_MAPPINGS.update(BATCH_PROCESSOR_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(IMG_ANALYSIS_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(IMAGE_LOADER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(IMG_SAVER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(IMG_SCORER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(BATCH_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(RANDOMIZER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(PROMPT_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(SAVER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(LOADER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(TEXT_SWITCH_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(INT_SWITCH_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(INT_WIDGET_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(PROMPT_SELECTOR_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(RANDOMIZER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(TEXT_SWITCH_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(TYPE_CONVERTER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(TYPE_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(EMBEDDER_CLASSES)
|
||||
NODE_CLASS_MAPPINGS.update(UTILS_CLASSES)
|
||||
|
||||
# Combine all NODE_DISPLAY_NAME_MAPPINGS
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(BATCH_PROCESSOR_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(IMG_ANALYSIS_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(IMAGE_LOADER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(IMG_SAVER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(IMG_SCORER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(BATCH_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(RANDOMIZER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(PROMPT_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(SAVER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(LOADER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(TEXT_SWITCH_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(INT_SWITCH_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(INT_WIDGET_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(PROMPT_SELECTOR_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(RANDOMIZER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(TEXT_SWITCH_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(TYPE_CONVERTER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(TYPE_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(EMBEDDER_NAMES)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(UTILS_NAMES)
|
||||
|
||||
# =====================
|
||||
# ✅ Finalization
|
||||
# =====================
|
||||
|
||||
# Inject tooltip descriptions for display names
|
||||
for cls in NODE_CLASS_MAPPINGS.values():
|
||||
inject_descriptions(cls, NODE_DESCRIPTIONS)
|
||||
|
||||
# Count only nodes that are meant to be shown (have display names)
|
||||
visible_node_count = sum(
|
||||
1 for k in NODE_CLASS_MAPPINGS
|
||||
if NODE_DISPLAY_NAME_MAPPINGS.get(k, "").strip()
|
||||
)
|
||||
|
||||
# Version info
|
||||
__version__ = "1.2.2"
|
||||
__version__ = "1.3.0"
|
||||
|
||||
print(f"Endless Sea of Stars Custom Nodes v{__version__} loaded successfully!")
|
||||
print("Nodes available under 'Endless 🌊✨' menu")
|
||||
print("\n===============================")
|
||||
print(f"Endless Sea of Stars Custom Nodes v{__version__} loaded successfully! 🌠")
|
||||
print(f"{visible_node_count} nodes available under the 'Endless 🌊✨' menu")
|
||||
print("🔧 If things are missing, try: pip install -r requirements.txt")
|
||||
print("===============================\n")
|
||||
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "endless-nodes"
|
||||
description = "A small set of nodes I created for myself. Features multiple simultaneous prompts in batches, an image saver with ability to have JSON saved to separate folder, image analysis nodes, switches for text and numbers, and more."
|
||||
version = "1.3.0"
|
||||
version = "1.3.2"
|
||||
license = { file = "LICENSE" }
|
||||
dependencies = ""
|
||||
|
||||
@@ -11,5 +11,5 @@ Repository = "https://github.com/tusharbhutt/Endless-Nodes"
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "tusharbhutt"
|
||||
DisplayName = "Endless 🌊✨ Nodes"
|
||||
DisplayName = "Endless-Nodes"
|
||||
Icon = "https://raw.githubusercontent.com/tusharbhutt/Endless-Nodes/main/img/icon.png"
|
||||
|
||||
Reference in New Issue
Block a user