ComfyUI-ZeroCLIP-nodes
A ComfyUI custom node pack that provides text-free, deterministic CLIP conditioning for Stable Diffusion image generation using integer seeds instead of text prompts.
ZeroClip-nodes
A ComfyUI custom node pack that provides text-free, deterministic CLIP conditioning for Stable Diffusion image generation. Instead of typing text prompts, you supply integer seeds. The same seed produces the same conditioning vector — and therefore the same image — on any machine, in any session, forever.
Four distinct conditioning strategies are available, each as its own set of nodes. All output standard ComfyUI CONDITIONING that plugs directly into KSampler. 20 nodes total, with SDXL support, batch generation, conditioning blending, and debug tools.
For more information, visit the edu-site: https://scuffedepoch.com/zeroclip-edu/
Installation
Copy the ZeroClip-nodes/ folder into your ComfyUI custom nodes directory:
ComfyUI/custom_nodes/ZeroClip-nodes/
Restart ComfyUI. Nodes appear under the ZeroClip/ category in the node menu.
No pip install required. The pack uses only torch and numpy, which ComfyUI already provides.
Model Files
Download pre-built model files from: https://huggingface.co/mushroomfleet/zeroclip
Place your artifact files (.npy, .npz, .pt) into:
ComfyUI/models/zeroclip/
This directory is created automatically on first load. Loader nodes provide dropdown file pickers that scan this directory.
Building Artifacts
Use the included build script from inside the ZeroClip-nodes/ directory:
# ZeroCLIP-A: Build anchor library (~2 min on CPU)
python build_artifacts.py --variant A --out ../../models/zeroclip/anchors.npy
# ZeroCLIP-B: Build dataset + train MLP (~10 min on CPU)
python build_artifacts.py --variant B --out ../../models/zeroclip/zerocliP_b.pt
# ZeroCLIP-C guided: Build PCA projection (~2 min on CPU)
python build_artifacts.py --variant C --out ../../models/zeroclip/projection.npz
# ZeroCLIP-C pure: No build needed — works immediately
# ZeroCLIP-D: See instructions printed by:
python build_artifacts.py --variant D --out ../../models/zeroclip/anchors_bootstrap.npy --device cuda
Requires pip install transformers for variants A, B, C. Variant D also requires diffusers accelerate.
Node Reference
Shared Utility Nodes
ZeroClip Seed Pack
Category: ZeroClip
Packs four integer values into a single seed object that all ZeroCLIP conditioner nodes accept.
| Input | Type | Default | Description | |-------|------|---------|-------------| | concept_id | INT | 1000 | Primary semantic axis (0-65535). Nearby values produce related outputs. | | style_id | INT | 500 | Secondary style axis (0-65535). Controls visual aesthetic. | | mood_salt | INT | 0 | Mood channel salt (0-65535). Adds variation without changing core concept/style. | | world_seed | INT | 42 | Universe identifier (u64). Different worlds = entirely different semantic layouts. |
ZeroClip Seed From Random
Category: ZeroClip
Derives a ZeroCLIP seed tuple from a single integer, enabling ComfyUI's standard seed randomization widget to drive exploration. Uses FNV-1a child hashes to split one seed into four independent values.
| Input | Type | Default | Description | |-------|------|---------|-------------| | seed | INT | 0 | Master seed (use ComfyUI's randomize widget) |
ZeroClip Empty Conditioning
Category: ZeroClip
Produces a zero-vector conditioning tensor for the negative/unconditional input to KSampler. Supports both SD1.x/SD2.x and SDXL formats.
| Input | Type | Default | Description | |-------|------|---------|-------------| | dimension | INT | 768 | 768 (SD1.x), 1024 (SD2.x), 2048 (SDXL seq) | | sdxl | BOOLEAN | false | Enable SDXL format with pooled_output | | pooled_dimension | INT (opt) | 1280 | SDXL pooled dimension |
ZeroClip Conditioning Blend
Category: ZeroClip
Blends two CONDITIONING inputs via weighted linear interpolation with L2 renormalization. Handles pooled_output for SDXL automatically.
| Input | Type | Default | Description | |-------|------|---------|-------------| | conditioning_a | CONDITIONING | - | First conditioning | | conditioning_b | CONDITIONING | - | Second conditioning | | weight_b | FLOAT | 0.5 | 0.0=100% A, 1.0=100% B |
Use this to blend ZeroCLIP conditioning with standard CLIP text conditioning, or to mix two different seed-derived conditionings.
ZeroClip Conditioning Info
Category: ZeroClip
Debug node that displays conditioning tensor information: shape, dtype, norm, mean, std, range, and pooled_output details if present. Marked as OUTPUT_NODE so it displays in the UI.
| Input | Type | Description | |-------|------|-------------| | conditioning | CONDITIONING | Any conditioning to inspect |
ZeroCLIP-A: Basis Decomposition
Conditioning as weighted sums over a pre-built library of CLIP embeddings.
| Node | Description |
|------|-------------|
| ZeroClip-A Load Anchors | Loads anchors.npy from models/zeroclip/. Dropdown file picker. Auto-reloads on file change. |
| ZeroClip-A Conditioning | Takes anchors + seed, outputs CONDITIONING. Uses coherent noise for smooth softmax weights. |
| ZeroClip-A Conditioning (SDXL) | Takes two anchor libraries (sequence D=2048 + pooled D=1280) + seed, outputs SDXL CONDITIONING with pooled_output. |
| ZeroClip-A Batch Conditioning | Sweeps concept_id from start to end, outputs batch CONDITIONING of shape [B, 77, D] for grid generation. |
ZeroCLIP-B: Latent Coordinate MLP
Conditioning via a tiny neural network (~50k params) that maps 3D coordinates to CLIP embeddings.
| Node | Description |
|------|-------------|
| ZeroClip-B Load MLP | Loads zerocliP_b.pt from models/zeroclip/. Dropdown file picker. Auto-reloads on file change. |
| ZeroClip-B Conditioning | Takes MLP model + seed, outputs CONDITIONING. Microsecond inference. |
| ZeroClip-B Conditioning (SDXL) | Takes two MLP models (sequence + pooled) + seed, outputs SDXL CONDITIONING. |
ZeroCLIP-C: Pure Entropy
Conditioning by sampling directly from the CLIP unit hypersphere.
| Node | Description |
|------|-------------|
| ZeroClip-C Load Projection | Loads projection.npz for guided mode. Not needed for pure mode. |
| ZeroClip-C Conditioning | Takes seed + mode (pure/guided) + dimension, outputs CONDITIONING. Pure mode requires zero offline artifacts. |
| ZeroClip-C Coherent Entropy | Blends local + regional entropy samples via slerp. Use same region_seed for visual family resemblance. |
| ZeroClip-C Conditioning (SDXL) | Entropy sampling with separate sequence/pooled dimensions and optional projections. |
ZeroCLIP-D: Self-Bootstrapped Prior Anchors
Conditioning from anchors discovered by the diffusion model itself — no text encoder at any stage.
| Node | Description |
|------|-------------|
| ZeroClip-D Load Anchors | Loads anchors_bootstrap.npy. Dropdown file picker. |
| ZeroClip-D Conditioning | Takes bootstrap anchors + seed, outputs CONDITIONING. Same algorithm as A, but text-free anchors. |
| ZeroClip-D Conditioning (SDXL) | Takes two bootstrap anchor libraries + seed, outputs SDXL CONDITIONING. |
| ZeroClip-D Batch Conditioning | Sweeps concept_id range for batch generation. |
Workflow Examples
Example workflow JSON files are included in the workflows/ directory. Import them into ComfyUI by dragging the JSON file onto the canvas.
| Workflow | Description |
|----------|-------------|
| zeroclip_a_basic.json | SeedPack -> A-Load -> A-Conditioning -> KSampler |
| zeroclip_b_basic.json | SeedPack -> B-Load -> B-Conditioning -> KSampler |
| zeroclip_c_pure.json | C-Conditioning (pure, no loader needed) -> KSampler |
| zeroclip_c_guided.json | C-Load -> C-Conditioning (guided) -> KSampler |
| zeroclip_d_basic.json | SeedPack -> D-Load -> D-Conditioning -> KSampler |
| zeroclip_blend_example.json | Two seeds -> Two conditionings -> Blend -> KSampler |
Which Variant Should I Use?
| Variant | Offline Setup | Runtime Speed | Visual Character | Best For | |---------|--------------|---------------|------------------|----------| | A | Build anchor library (~2 min) | Fast | Smooth blends of known concepts | General-purpose text-free conditioning | | B | Train MLP (~10 min) | Fastest (microseconds) | Continuous manifold navigation | Minimal runtime footprint | | C pure | None | Fast | Unpredictable, pure prior resonance | Zero-setup exploration | | C guided | Build projection (~2 min) | Fast | Near-language, semantically plausible | Structured entropy | | D | Bootstrap (~5 hours GPU) | Fast | Model-discovered semantics | Research into text-free priors |
Seed Semantics
- concept_id and style_id form a 2D coordinate. Nearby coordinates produce visually similar results (coherent noise).
- mood_salt adds a third axis of variation.
- world_seed selects which procedural universe to explore. Same coordinates, different worlds = unrelated results.
You can sweep concept_id, grid concept_id x style_id, walk between seeds, or fix world_seed and explore one universe.
File Structure
ZeroClip-nodes/
+-- __init__.py # Node registration (20 nodes)
+-- utils.py # Conditioning format conversion (SD + SDXL + batch)
+-- nodes_shared.py # SeedPack, SeedFromRandom, EmptyConditioning, Blend, Info
+-- nodes_a.py # A: LoadAnchors, Conditioning, SDXL, Batch
+-- nodes_b.py # B: LoadModel, Conditioning, SDXL
+-- nodes_c.py # C: LoadProjection, Conditioning, CoherentEntropy, SDXL
+-- nodes_d.py # D: LoadAnchors, Conditioning, SDXL, Batch
+-- build_artifacts.py # Offline artifact builder (A, B, C, D)
+-- core/ # Vendored ZeroCLIP core libraries
| +-- hash.py, noise.py, conditioning_a.py, model_b.py,
| +-- encode_b.py, conditioning_b.py, sampler_c.py,
| +-- coherent_entropy_c.py, conditioning_d.py
+-- vocabs/
| +-- default_vocab_1024.txt
| +-- default_vocab_2048.txt
+-- workflows/ # Example ComfyUI workflow JSONs
| +-- zeroclip_a_basic.json, zeroclip_b_basic.json,
| +-- zeroclip_c_pure.json, zeroclip_c_guided.json,
| +-- zeroclip_d_basic.json, zeroclip_blend_example.json
+-- README.md