Downloads · 30 days
0
jrsh/sd-control-and-representation
sd-control-and-representation is a machine learning model from jrsh. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains Sparse Autoencoder (SAE) models trained on Stable Diffusion representations. These models enable interpretable analysis and control of the diffusion process by learning sparse feature decompos…
Downloads · 30 days
0
Access
Public
Updated Jan 28, 2026
Repo size
2 GB
Likes
0
Public
Click a slice to open those files.
.pt2.3 GB · 100%
From the Hugging Face model README
This repository contains Sparse Autoencoder (SAE) models trained on Stable Diffusion representations. These models enable interpretable analysis and control of the diffusion process by learning sparse feature decompositions of the model's internal activations.
Sparse Autoencoders decompose neural network activations into interpretable, sparse feature representations. These SAE models allow you to:
The repository is organized by model version and experiment type:
README.md
sd-v1-5/
└── sae/
├── exp32_topk16/
│ ├── config.json
│ ├── model.pt
│ └── merged_feature_sums.pt
├── exp36_topk32/
│ ├── config.json
│ ├── model.pt
│ └── merged_feature_sums.pt
└── exp36_topk64/
├── config.json
├── model.pt
└── merged_feature_sums.pt
Additional model versions and architectures will be added in separate directories.
config.json: SAE architecture configuration (dimensions, hyperparameters)model.pt: Trained SAE weights (encoder and decoder)merged_feature_sums.pt: Aggregated feature activation statistics across training datapip install huggingface_hub torch
from huggingface_hub import hf_hub_download
import torch
import json
# Choose your model
REPO_ID = "jrsh/sd-control-and-representation"
SUBFOLDER = "sd-v1-5/sae/exp36_topk32" # Choose: exp32_topk16, exp36_topk32, or exp36_topk64
# 1. Load configuration
config_path = hf_hub_download(
repo_id=REPO_ID,
subfolder=SUBFOLDER,
filename="config.json"
)
with open(config_path, 'r') as f:
config = json.load(f)
# 2. Load model weights
model_path = hf_hub_download(
repo_id=REPO_ID,
subfolder=SUBFOLDER,
filename="model.pt"
)
sae_state_dict = torch.load(model_path, map_location='cpu')
# 3. Load feature statistics
feature_sums_path = hf_hub_download(
repo_id=REPO_ID,
subfolder=SUBFOLDER,
filename="merged_feature_sums.pt"
)
feature_sums = torch.load(feature_sums_path, map_location='cpu')
print(f"Successfully loaded SAE from {SUBFOLDER}")
print(f"Config: {config}")