Files
mushroomfleetandClaude Opus 4.6 e436bf2d99 Initial commit: ZeroCLIP nodes for ComfyUI
Complete node pack with ZeroCLIP-A through ZeroCLIP-D conditioning nodes,
shared utilities, core modules, vocab files, and example workflows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:12:01 +01:00

104 lines
4.2 KiB
Python

"""ZeroClip-nodes: ComfyUI custom node pack for ZeroCLIP A/B/C/D conditioning.
Provides text-free, deterministic CLIP conditioning for Stable Diffusion
via four distinct approaches: basis decomposition (A), learned MLP (B),
pure entropy (C), and self-bootstrapped prior anchors (D).
Install: copy this folder to ComfyUI/custom_nodes/ZeroClip-nodes/
"""
import os
import folder_paths
# Register a custom model directory for ZeroClip artifacts
ZEROCLIP_DIR = os.path.join(folder_paths.models_dir, "zeroclip")
os.makedirs(ZEROCLIP_DIR, exist_ok=True)
folder_paths.folder_names_and_paths["zeroclip"] = (
[ZEROCLIP_DIR],
{".npy", ".npz", ".pt"}
)
from .nodes_shared import (
ZeroClip_SeedPack,
ZeroClip_SeedFromRandom,
ZeroClip_EmptyConditioning,
ZeroClip_ConditioningBlend,
ZeroClip_ConditioningInfo,
)
from .nodes_a import (
ZeroClipA_LoadAnchors,
ZeroClipA_Conditioning,
ZeroClipA_ConditioningSDXL,
ZeroClipA_BatchConditioning,
)
from .nodes_b import (
ZeroClipB_LoadModel,
ZeroClipB_Conditioning,
ZeroClipB_ConditioningSDXL,
)
from .nodes_c import (
ZeroClipC_LoadProjection,
ZeroClipC_Conditioning,
ZeroClipC_CoherentEntropy,
ZeroClipC_ConditioningSDXL,
)
from .nodes_d import (
ZeroClipD_LoadAnchors,
ZeroClipD_Conditioning,
ZeroClipD_ConditioningSDXL,
ZeroClipD_BatchConditioning,
)
NODE_CLASS_MAPPINGS = {
# Shared
"ZeroClip_SeedPack": ZeroClip_SeedPack,
"ZeroClip_SeedFromRandom": ZeroClip_SeedFromRandom,
"ZeroClip_EmptyConditioning": ZeroClip_EmptyConditioning,
"ZeroClip_ConditioningBlend": ZeroClip_ConditioningBlend,
"ZeroClip_ConditioningInfo": ZeroClip_ConditioningInfo,
# A — Basis Decomposition
"ZeroClipA_LoadAnchors": ZeroClipA_LoadAnchors,
"ZeroClipA_Conditioning": ZeroClipA_Conditioning,
"ZeroClipA_ConditioningSDXL": ZeroClipA_ConditioningSDXL,
"ZeroClipA_BatchConditioning": ZeroClipA_BatchConditioning,
# B — Latent Coordinate MLP
"ZeroClipB_LoadModel": ZeroClipB_LoadModel,
"ZeroClipB_Conditioning": ZeroClipB_Conditioning,
"ZeroClipB_ConditioningSDXL": ZeroClipB_ConditioningSDXL,
# C — Pure Entropy
"ZeroClipC_LoadProjection": ZeroClipC_LoadProjection,
"ZeroClipC_Conditioning": ZeroClipC_Conditioning,
"ZeroClipC_CoherentEntropy": ZeroClipC_CoherentEntropy,
"ZeroClipC_ConditioningSDXL": ZeroClipC_ConditioningSDXL,
# D — Self-Bootstrapped
"ZeroClipD_LoadAnchors": ZeroClipD_LoadAnchors,
"ZeroClipD_Conditioning": ZeroClipD_Conditioning,
"ZeroClipD_ConditioningSDXL": ZeroClipD_ConditioningSDXL,
"ZeroClipD_BatchConditioning": ZeroClipD_BatchConditioning,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"ZeroClip_SeedPack": "ZeroClip Seed Pack",
"ZeroClip_SeedFromRandom": "ZeroClip Seed From Random",
"ZeroClip_EmptyConditioning": "ZeroClip Empty Conditioning",
"ZeroClip_ConditioningBlend": "ZeroClip Conditioning Blend",
"ZeroClip_ConditioningInfo": "ZeroClip Conditioning Info",
"ZeroClipA_LoadAnchors": "ZeroClip-A Load Anchors",
"ZeroClipA_Conditioning": "ZeroClip-A Conditioning",
"ZeroClipA_ConditioningSDXL": "ZeroClip-A Conditioning (SDXL)",
"ZeroClipA_BatchConditioning": "ZeroClip-A Batch Conditioning",
"ZeroClipB_LoadModel": "ZeroClip-B Load MLP",
"ZeroClipB_Conditioning": "ZeroClip-B Conditioning",
"ZeroClipB_ConditioningSDXL": "ZeroClip-B Conditioning (SDXL)",
"ZeroClipC_LoadProjection": "ZeroClip-C Load Projection",
"ZeroClipC_Conditioning": "ZeroClip-C Conditioning",
"ZeroClipC_CoherentEntropy": "ZeroClip-C Coherent Entropy",
"ZeroClipC_ConditioningSDXL": "ZeroClip-C Conditioning (SDXL)",
"ZeroClipD_LoadAnchors": "ZeroClip-D Load Anchors",
"ZeroClipD_Conditioning": "ZeroClip-D Conditioning",
"ZeroClipD_ConditioningSDXL": "ZeroClip-D Conditioning (SDXL)",
"ZeroClipD_BatchConditioning": "ZeroClip-D Batch Conditioning",
}
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]