Causal-Adapter Pretrained Weights
Model Overview
This repository provides pretrained Causal-Adapter weights across four benchmark settings. The released checkpoints include Causal-Adapter models built on both SD1.5-style and SD3-style diffusion structures.
Causal-Adapter is designed to inject structured causal semantics into pretrained text-to-image diffusion models for controllable and causally consistent counterfactual image generation.
Detailed usage examples are available in our notebook benchmarks:
An example configuration can be found in:
notebook_benchmarks/counterfactuals_celeba.ipynb
Base Models
The released checkpoints are based on the following pretrained diffusion backbones:
SD1.5-style structure: lambda/miniSD-diffusers
SD3-style structure: stabilityai/stable-diffusion-3-medium-diffusers
Benchmark Resources
The released weights are evaluated on benchmark settings built from the following resources:
Pendulum dataset generation:
CausalVAE Pendulum
CelebA and ADNI benchmark configuration:
counterfactual-benchmark
CelebA-HQ dataset:
CelebAMask-HQ
Example Configuration
The following example shows the main paths required for running the CelebA counterfactual generation notebook.
1 import os
2
3 # Shared roots
4
5 # 1) Frozen SD1.5 backbone.
6 # For example: "lambda/miniSD-diffusers"
7 BASE_MODEL_PATH = ""
8
9 # 2) Causal-Adapter ControlNet checkpoint and the matching MCPL learned pseudo-tokens.
10 # Example ControlNet checkpoint:
11 # https://huggingface.co/LeiTong/Causal-Adapter/tree/main/celeba/controlnet/controlnet-steps-200000.safetensors
12 CONTROLNET_PATH = ""
13
14 # Example learned text embeddings:
15 # https://huggingface.co/LeiTong/Causal-Adapter/tree/main/celeba/controlnet/learned_embeds-steps-200000.safetensors
16 TEXT_EMBEDDING_PATH = ""
17
18 # 3) Optional pretrained SCM head from SCM_modeling/.
19 # Example SCM checkpoint:
20 # https://huggingface.co/LeiTong/Causal-Adapter/tree/main/celeba/scm/best_model.pt
21 SCM_PATH = ""
22
23 # 4) CelebA root expected by torchvision.datasets.CelebA(root=...).
24 DATA_ROOT = os . environ . get ( "DATA_ROOT" , "" )
25
26 DATASET = "celeA_complex"
27 SIZE = 256
Repository Structure
The checkpoint files are organized by benchmark and model component. A typical setting may include:
Causal-Adapter / ControlNet weights
Learned pseudo-token embeddings
Optional pretrained SCM head
Example notebooks for counterfactual image generation
Usage
Please refer to the notebook examples for loading the pretrained weights and running counterfactual generation:
License
This repository is released under the Apache-2.0 license.