Text-to-Image
Diffusers
TensorBoard
Safetensors
diffusion
stable-diffusion
stable-diffusion-3
controlnet
causal-inference
counterfactual-generation
causal-adapter
Instructions to use LeiTong/Causal-Adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use LeiTong/Causal-Adapter with Diffusers:
pip install -U diffusers transformers accelerate
from diffusers import ControlNetModel, StableDiffusionControlNetPipeline controlnet = ControlNetModel.from_pretrained("LeiTong/Causal-Adapter") pipe = StableDiffusionControlNetPipeline.from_pretrained( "lambda/miniSD-diffusers,stabilityai/stable-diffusion-3-medium-diffusers", controlnet=controlnet ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
| 1 |
-
下面是完整 Markdown,可直接复制到 HF README:
|
| 2 |
-
|
| 3 |
-
````markdown
|
| 4 |
---
|
| 5 |
-
base_model:
|
| 6 |
-
- lambda/miniSD-diffusers
|
| 7 |
-
- stabilityai/stable-diffusion-3-medium-diffusers
|
| 8 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# Causal-Adapter Pretrained Weights
|
|
@@ -24,24 +31,26 @@ An example configuration can be found in:
|
|
| 24 |
|
| 25 |
```text
|
| 26 |
notebook_benchmarks/counterfactuals_celeba.ipynb
|
| 27 |
-
```
|
| 28 |
|
| 29 |
## Base Models
|
| 30 |
|
| 31 |
The released checkpoints are based on the following pretrained diffusion backbones:
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
## Benchmark Resources
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
| 39 |
[CausalVAE Pendulum](https://github.com/huawei-noah/trustworthyAI/blob/master/research/CausalVAE/causal_data/pendulum.py)
|
| 40 |
|
| 41 |
-
|
| 42 |
[counterfactual-benchmark](https://github.com/gulnazaki/counterfactual-benchmark)
|
| 43 |
|
| 44 |
-
|
| 45 |
[CelebAMask-HQ](https://github.com/switchablenorms/CelebAMask-HQ)
|
| 46 |
|
| 47 |
## Example Configuration
|
|
@@ -78,9 +87,21 @@ DATASET = "celeA_complex"
|
|
| 78 |
SIZE = 256
|
| 79 |
```
|
| 80 |
|
| 81 |
-
##
|
| 82 |
|
| 83 |
-
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- lambda/miniSD-diffusers
|
| 5 |
+
- stabilityai/stable-diffusion-3-medium-diffusers
|
| 6 |
+
library_name: diffusers
|
| 7 |
+
pipeline_tag: text-to-image
|
| 8 |
+
tags:
|
| 9 |
+
- diffusion
|
| 10 |
+
- stable-diffusion
|
| 11 |
+
- stable-diffusion-3
|
| 12 |
+
- controlnet
|
| 13 |
+
- causal-inference
|
| 14 |
+
- counterfactual-generation
|
| 15 |
+
- causal-adapter
|
| 16 |
---
|
| 17 |
|
| 18 |
# Causal-Adapter Pretrained Weights
|
|
|
|
| 31 |
|
| 32 |
```text
|
| 33 |
notebook_benchmarks/counterfactuals_celeba.ipynb
|
| 34 |
+
```
|
| 35 |
|
| 36 |
## Base Models
|
| 37 |
|
| 38 |
The released checkpoints are based on the following pretrained diffusion backbones:
|
| 39 |
|
| 40 |
+
- **SD1.5-style structure:** `lambda/miniSD-diffusers`
|
| 41 |
+
- **SD3-style structure:** `stabilityai/stable-diffusion-3-medium-diffusers`
|
| 42 |
|
| 43 |
## Benchmark Resources
|
| 44 |
|
| 45 |
+
The released weights are evaluated on benchmark settings built from the following resources:
|
| 46 |
+
|
| 47 |
+
- **Pendulum dataset generation:**
|
| 48 |
[CausalVAE Pendulum](https://github.com/huawei-noah/trustworthyAI/blob/master/research/CausalVAE/causal_data/pendulum.py)
|
| 49 |
|
| 50 |
+
- **CelebA and ADNI benchmark configuration:**
|
| 51 |
[counterfactual-benchmark](https://github.com/gulnazaki/counterfactual-benchmark)
|
| 52 |
|
| 53 |
+
- **CelebA-HQ dataset:**
|
| 54 |
[CelebAMask-HQ](https://github.com/switchablenorms/CelebAMask-HQ)
|
| 55 |
|
| 56 |
## Example Configuration
|
|
|
|
| 87 |
SIZE = 256
|
| 88 |
```
|
| 89 |
|
| 90 |
+
## Repository Structure
|
| 91 |
|
| 92 |
+
The checkpoint files are organized by benchmark and model component. A typical setting may include:
|
| 93 |
|
| 94 |
+
- Causal-Adapter / ControlNet weights
|
| 95 |
+
- Learned pseudo-token embeddings
|
| 96 |
+
- Optional pretrained SCM head
|
| 97 |
+
- Example notebooks for counterfactual image generation
|
| 98 |
+
|
| 99 |
+
## Usage
|
| 100 |
+
|
| 101 |
+
Please refer to the notebook examples for loading the pretrained weights and running counterfactual generation:
|
| 102 |
+
|
| 103 |
+
[Notebook Benchmarks](https://github.com/LeiTong02/Causal-Adapter/tree/main/notebook_benchmarks)
|
| 104 |
+
|
| 105 |
+
## License
|
| 106 |
+
|
| 107 |
+
This repository is released under the Apache-2.0 license.
|