Downloads · 30 days
0
oldman-dev/comfyui-stanno
comfyui-stanno is a machine learning model from oldman-dev. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A modern, open-source Python library implementing the Artificial Neurogenesis Network concept from US Patent 5,852,815 (Thaler, 1998). One network (the trainer) decides how another network (the trainee) should update…
Downloads · 30 days
0
Access
Public
Updated May 17, 2026
Repo size
—
Likes
1
Public
Click a slice to open those files.
.py41.6 KB · 69%
From the Hugging Face model README
A modern, open-source Python library implementing the Artificial Neurogenesis Network concept from US Patent 5,852,815 (Thaler, 1998). One network (the trainer) decides how another network (the trainee) should update its weights — no backpropagation needed. Multiple STANNOs can be chained into cascade pipelines, and any trained STANNO can be turned into a data scanner that finds matching rows in large datasets.
Attribution: This is a faithful, open-source implementation of Thaler's patented design with modern extensions (cascading, data scanning, ComfyUI integration). The original patent has expired. All core concepts are credited to the original patent.
STANNO is specialized, not a drop-in replacement for PyTorch.
Good for:
NOT for:
For details, see STANNO_IS_NOT.md.
What you can do with this:
Train networks on your data:
from stanno import STANNO
from stanno.config.schema import STANNOConfig
import numpy as np
config = STANNOConfig(layers=[784, 256, 10])
stanno = STANNO(config)
stanno.fit(x_train, y_train, epochs=100)
predictions = stanno.predict(x_test)
Chain into cascade pipelines:
from stanno import STANNO, STANNOConfig, CascadeSTANNO
# Encoder-decoder autoencoder
enc = STANNO(STANNOConfig(layers=[768, 256, 64], learning_rate=0.05))
dec = STANNO(STANNOConfig(layers=[64, 256, 768], learning_rate=0.05))
ae = CascadeSTANNO([enc, dec])
ae.fit(embeddings, embeddings, epochs=200) # end-to-end gradient cascade
# Extract compressed representations
codes = ae.intermediate_output(embeddings, stage=0) # (N, 64)
# Freeze the encoder, continue adapting the decoder
ae.freeze(0)
ae.fit(new_domain_embeddings, new_domain_embeddings, epochs=100)
Scan large datasets for matching rows (DSANNO):
from stanno import STANNO, STANNOConfig, DSANNO
# Train on known-good data
detector = STANNO(STANNOConfig(layers=[64, 128, 64], learning_rate=0.05))
detector.fit(normal_data, normal_data, epochs=200)
scanner = DSANNO(detector, mode="reconstruction")
# Auto-calibrate threshold from training distribution
threshold = scanner.calibrate_threshold(normal_data, percentile=95)
# Find matching rows in a large corpus
result = scanner.scan(large_corpus, threshold=threshold)
matching = large_corpus[result.matched_indices()]
# Or retrieve the top-k best matches
indices, scores, _ = scanner.top_k(large_corpus, k=20)
# Stream huge files without loading all at once
for batch_result in scanner.scan_stream(file_batches, threshold=threshold):
process(batch_result.matched_indices())
Detect when inputs are unusual (anomaly filter):
from stanno.integration.filter import STANNOFilter
# Train on normal data
stanno.fit(normal_data, normal_data, epochs=50)
# Score new input
score, metadata = stanno_filter.score(new_input)
# score ranges [0, 1]: low = normal, high = anomaly
Generate variations via "dream mode":
# Start with a seed input, add noise, generate a sequence
dream_sequence = stanno.dream(
num_steps=64,
input_seed=seed_vector,
noise_sigma=0.1 # controls creativity
)
Use in ComfyUI workflows (9 nodes):
pip install git+https://github.com/nitroxido/stanno.git
python -m stanno train --config examples/sin_regression.json
python -m stanno predict --config examples/sin_regression.json --input 0.5
python -m stanno dream --config examples/sin_regression.json
from stanno import STANNO
from stanno.config.schema import STANNOConfig
import numpy as np
# Reshape images to flat vectors (B, H*W*C)
x = images.reshape(images.shape[0], -1).astype('float32')
# Autoencoder: input and output have same size
config = STANNOConfig(layers=[x.shape[1], 256, x.shape[1]])
stanno = STANNO(config)
stanno.fit(x, x, epochs=100, batch_size=32)
# Get reconstruction
x_reconstructed = stanno.predict(x[:10])
from stanno.integration.continual import ContinualSTANNO
cont = ContinualSTANNO(stanno)
for sample, label in data_stream:
loss = cont.observe(sample, label)
if cont.steps % 100 == 0:
test_loss = cont.test_loss(x_test, y_test)
print(f"Step {cont.steps}: train_loss={loss:.4f}, test_loss={test_loss:.4f}")
from stanno.config.schema import FilterConfig
from stanno.integration.filter import STANNOFilter
# Train on normal embeddings
stanno.fit(normal_embeddings, normal_embeddings, epochs=50)
# Create filter
filt = STANNOFilter(stanno, FilterConfig(anomaly_threshold=0.7))
# Score new embedding
score, info = filt.score(new_embedding)
print(f"Anomaly score: {score:.3f} (0=normal, 1=anomaly)")
if info["blocked"]:
print("Blocked: input is too unusual")
The core idea:
The three trainer types:
| Type | Mechanism | Best for |
|---|---|---|
| Fixed | 4-module design (patent 5852815A), cascade-aware | Baseline, reproducibility, understanding the concept |
| LocalRule | Shared MLP per synapse | Adaptive training, interpretability |
| Evolutionary | Evolve per-layer scales (ES) | Unconventional problems, when autodiff fails |
On sin(x) regression (512 samples, 100 epochs):
Fixed MSE=0.047
LocalRule MSE=0.021 (learnable rules = better fit)
Evolutionary MSE=0.053
The comfyui-stanno custom node package provides nine nodes in the STANNO category:
| Node | What it does |
|---|---|
| STANNOLoad | Create or load a model (JSON config or .pkl file) |
| STANNOTrainImages | Train on image batches |
| STANNOScoreImages | Filter images by reconstruction error |
| STANNODreamCond | Modify CLIP embeddings with dream mode |
| STANNODynamicLoRA | Apply learned style as LoRA patches |
| STANNOCompositeCheck | Route images to whichever of two STANNOs matches best |
| STANNOScan | DSANNO scanner: auto-calibrated threshold + top-k image retrieval |
| STANNOCascadeLoad | Create or load a multi-stage CascadeSTANNO |
| STANNOCascadeTrainImages | Train a cascade end-to-end on an image batch |
Install via ComfyUI-Manager or manually.
STANNO is an open-source implementation of US Patent 5,852,815 (Artificial Neurogenesis Network), filed by Stephen L. Thaler. The patent has expired (US utility patents: 20 years from filing). We fully acknowledge and credit all core architectural concepts to the original patent.
This implementation adds:
See Citation below for how to cite the original patent and this implementation.
If you use STANNO in research, cite the original patent:
@patent{thaler1998artificial,
title={Artificial neurogenesis network},
author={Thaler, Stephen L},
year={1998},
number={5852815},
institution={United States Patent}
}
And mention this implementation:
@software{stanno2026,
title={STANNO: Self-Training Artificial Neural Network Object},
author={Raides J. Rodríguez},
year={2026},
url={https://github.com/nitroxido/stanno}
}
MIT
This integration requires the stanno core package.
Install with:
pip install git+https://github.com/nitroxido/stanno.git
``` {data-source-line="259"}