thanks to nota-ai ❤
Browse files- README.md +144 -0
- bk_sdm_tiny_2m.ckpt +3 -0
- feature_extractor/preprocessor_config.json +20 -0
- model_index.json +32 -0
- safety_checker/config.json +171 -0
- safety_checker/model.fp16.safetensors +3 -0
- safety_checker/model.safetensors +3 -0
- safety_checker/pytorch_model.bin +3 -0
- safety_checker/pytorch_model.fp16.bin +3 -0
- scheduler/.ipynb_checkpoints/scheduler_config-checkpoint.json +9 -0
- scheduler/scheduler_config.json +13 -0
- text_encoder/config.json +24 -0
- text_encoder/model.fp16.safetensors +3 -0
- text_encoder/model.safetensors +3 -0
- text_encoder/pytorch_model.bin +3 -0
- text_encoder/pytorch_model.fp16.bin +3 -0
- tokenizer/merges.txt +0 -0
- tokenizer/special_tokens_map.json +24 -0
- tokenizer/tokenizer_config.json +34 -0
- tokenizer/vocab.json +0 -0
- unet/config.json +55 -0
- unet/diffusion_pytorch_model.bin +3 -0
- unet/diffusion_pytorch_model.fp16.bin +3 -0
- unet/diffusion_pytorch_model.fp16.safetensors +3 -0
- unet/diffusion_pytorch_model.safetensors +3 -0
- vae/config.json +29 -0
- vae/diffusion_pytorch_model.bin +3 -0
- vae/diffusion_pytorch_model.fp16.bin +3 -0
- vae/diffusion_pytorch_model.fp16.safetensors +3 -0
- vae/diffusion_pytorch_model.safetensors +3 -0
README.md
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: creativeml-openrail-m
|
3 |
+
tags:
|
4 |
+
- stable-diffusion
|
5 |
+
- stable-diffusion-diffusers
|
6 |
+
- text-to-image
|
7 |
+
datasets:
|
8 |
+
- ChristophSchuhmann/improved_aesthetics_6.25plus
|
9 |
+
library_name: diffusers
|
10 |
+
pipeline_tag: text-to-image
|
11 |
+
extra_gated_prompt: >-
|
12 |
+
This model is open access and available to all, with a CreativeML OpenRAIL-M
|
13 |
+
license further specifying rights and usage.
|
14 |
+
|
15 |
+
The CreativeML OpenRAIL License specifies:
|
16 |
+
|
17 |
+
|
18 |
+
1. You can't use the model to deliberately produce nor share illegal or
|
19 |
+
harmful outputs or content
|
20 |
+
|
21 |
+
2. The authors claim no rights on the outputs you generate, you are free to
|
22 |
+
use them and are accountable for their use which must not go against the
|
23 |
+
provisions set in the license
|
24 |
+
|
25 |
+
3. You may re-distribute the weights and use the model commercially and/or as
|
26 |
+
a service. If you do, please be aware you have to include the same use
|
27 |
+
restrictions as the ones in the license and share a copy of the CreativeML
|
28 |
+
OpenRAIL-M to all your users (please read the license entirely and carefully)
|
29 |
+
|
30 |
+
Please read the full license carefully here:
|
31 |
+
https://huggingface.co/spaces/CompVis/stable-diffusion-license
|
32 |
+
|
33 |
+
extra_gated_heading: Please read the LICENSE to access this model
|
34 |
+
|
35 |
+
---
|
36 |
+
|
37 |
+
|
38 |
+
# BK-SDM-2M Model Card
|
39 |
+
|
40 |
+
BK-SDM-{[**Base-2M**](https://huggingface.co/nota-ai/bk-sdm-base-2m), [**Small-2M**](https://huggingface.co/nota-ai/bk-sdm-small-2m), [**Tiny-2M**](https://huggingface.co/nota-ai/bk-sdm-tiny-2m)} are pretrained with **10× more data** (2.3M LAION image-text pairs) compared to our previous release.
|
41 |
+
- Block-removed Knowledge-distilled Stable Diffusion Model (BK-SDM) is an architecturally compressed SDM for efficient text-to-image synthesis.
|
42 |
+
- The previous BK-SDM-{[Base](https://huggingface.co/nota-ai/bk-sdm-base), [Small](https://huggingface.co/nota-ai/bk-sdm-small), [Tiny](https://huggingface.co/nota-ai/bk-sdm-tiny)} were obtained via distillation pretraining on 0.22M LAION pairs.
|
43 |
+
- Resources for more information: [Paper](https://arxiv.org/abs/2305.15798), [GitHub](https://github.com/Nota-NetsPresso/BK-SDM), [Demo]( https://huggingface.co/spaces/nota-ai/compressed-stable-diffusion).
|
44 |
+
|
45 |
+
|
46 |
+
## Examples with 🤗[Diffusers library](https://github.com/huggingface/diffusers).
|
47 |
+
|
48 |
+
An inference code with the default PNDM scheduler and 50 denoising steps is as follows.
|
49 |
+
|
50 |
+
```python
|
51 |
+
import torch
|
52 |
+
from diffusers import StableDiffusionPipeline
|
53 |
+
|
54 |
+
pipe = StableDiffusionPipeline.from_pretrained("nota-ai/bk-sdm-tiny-2m", torch_dtype=torch.float16)
|
55 |
+
pipe = pipe.to("cuda")
|
56 |
+
|
57 |
+
prompt = "a black vase holding a bouquet of roses"
|
58 |
+
image = pipe(prompt).images[0]
|
59 |
+
|
60 |
+
image.save("example.png")
|
61 |
+
```
|
62 |
+
|
63 |
+
|
64 |
+
## Compression Method
|
65 |
+
|
66 |
+
Adhering to the [U-Net architecture](https://huggingface.co/nota-ai/bk-sdm-tiny#u-net-architecture) and [distillation pretraining](https://huggingface.co/nota-ai/bk-sdm-tiny#distillation-pretraining) of BK-SDM, the difference in BK-SDM-2M is a 10× increase in the number of training pairs.
|
67 |
+
|
68 |
+
- **Training Data**: 2,256,472 image-text pairs (i.e., 2.3M pairs) from [LAION-Aesthetics V2 6.25+](https://laion.ai/blog/laion-aesthetics/).
|
69 |
+
- **Hardware:** A single NVIDIA A100 80GB GPU
|
70 |
+
- **Gradient Accumulations**: 4
|
71 |
+
- **Batch:** 256 (=4×64)
|
72 |
+
- **Optimizer:** AdamW
|
73 |
+
- **Learning Rate:** a constant learning rate of 5e-5 for 50K-iteration pretraining
|
74 |
+
|
75 |
+
|
76 |
+
## Experimental Results
|
77 |
+
|
78 |
+
The following table shows the zero-shot results on 30K samples from the MS-COCO validation split. After generating 512×512 images with the PNDM scheduler and 25 denoising steps, we downsampled them to 256×256 for evaluating generation scores.
|
79 |
+
|
80 |
+
- Our models were drawn at the 50K-th training iteration.
|
81 |
+
|
82 |
+
| Model | FID↓ | IS↑ | CLIP Score↑<br>(ViT-g/14) | # Params,<br>U-Net | # Params,<br>Whole SDM |
|
83 |
+
|---|:---:|:---:|:---:|:---:|:---:|
|
84 |
+
| [Stable Diffusion v1.4](https://huggingface.co/CompVis/stable-diffusion-v1-4) | 13.05 | 36.76 | 0.2958 | 0.86B | 1.04B |
|
85 |
+
| [BK-SDM-Base](https://huggingface.co/nota-ai/bk-sdm-base) (Ours) | 15.76 | 33.79 | 0.2878 | 0.58B | 0.76B |
|
86 |
+
| [BK-SDM-Base-2M](https://huggingface.co/nota-ai/bk-sdm-base-2m) (Ours) | 14.81 | 34.17 | 0.2883 | 0.58B | 0.76B |
|
87 |
+
| [BK-SDM-Small](https://huggingface.co/nota-ai/bk-sdm-small) (Ours) | 16.98 | 31.68 | 0.2677 | 0.49B | 0.66B |
|
88 |
+
| [BK-SDM-Small-2M](https://huggingface.co/nota-ai/bk-sdm-small-2m) (Ours) | 17.05 | 33.10 | 0.2734 | 0.49B | 0.66B |
|
89 |
+
| [BK-SDM-Tiny](https://huggingface.co/nota-ai/bk-sdm-tiny) (Ours) | 17.12 | 30.09 | 0.2653 | 0.33B | 0.50B |
|
90 |
+
| [BK-SDM-Tiny-2M](https://huggingface.co/nota-ai/bk-sdm-tiny-2m) (Ours) | 17.53 | 31.32 | 0.2690 | 0.33B | 0.50B |
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
### Effect of Different Data Sizes for Training BK-SDM-Small
|
95 |
+
Increasing the number of training pairs improves the IS and CLIP scores over training progress. The MS-COCO 256×256 30K benchmark was used for evaluation.
|
96 |
+
|
97 |
+
<center>
|
98 |
+
<img alt="Training progress with different data sizes" img src="https://netspresso-research-code-release.s3.us-east-2.amazonaws.com/assets-bk-sdm/fig_iter_data_size.png" width="100%">
|
99 |
+
</center>
|
100 |
+
|
101 |
+
Furthermore, with the growth in data volume, visual results become more favorable (e.g., better image-text alignment and clear distinction among objects).
|
102 |
+
|
103 |
+
<center>
|
104 |
+
<img alt="Visual results with different data sizes" img src="https://netspresso-research-code-release.s3.us-east-2.amazonaws.com/assets-bk-sdm/fig_results_data_size.png" width="100%">
|
105 |
+
</center>
|
106 |
+
|
107 |
+
### Additional Visual Examples
|
108 |
+
|
109 |
+
<center>
|
110 |
+
<img alt="additional visual examples" img src="https://netspresso-research-code-release.s3.us-east-2.amazonaws.com/assets-bk-sdm/fig_results_models_2m.png" width="100%">
|
111 |
+
</center>
|
112 |
+
|
113 |
+
|
114 |
+
# Uses
|
115 |
+
Follow [the usage guidelines of Stable Diffusion v1](https://huggingface.co/CompVis/stable-diffusion-v1-4#uses).
|
116 |
+
|
117 |
+
|
118 |
+
# Acknowledgments
|
119 |
+
- We express our gratitude to [Microsoft for Startups Founders Hub](https://www.microsoft.com/en-us/startups) for generously providing the Azure credits used during pretraining.
|
120 |
+
- We deeply appreciate the pioneering research on Latent/Stable Diffusion conducted by [CompVis](https://github.com/CompVis/latent-diffusion), [Runway](https://runwayml.com/), and [Stability AI](https://stability.ai/).
|
121 |
+
- Special thanks to the contributors to [LAION](https://laion.ai/), [Diffusers](https://github.com/huggingface/diffusers), and [Gradio](https://www.gradio.app/) for their valuable support.
|
122 |
+
|
123 |
+
|
124 |
+
# Citation
|
125 |
+
```bibtex
|
126 |
+
@article{kim2023architectural,
|
127 |
+
title={On Architectural Compression of Text-to-Image Diffusion Models},
|
128 |
+
author={Kim, Bo-Kyeong and Song, Hyoung-Kyu and Castells, Thibault and Choi, Shinkook},
|
129 |
+
journal={arXiv preprint arXiv:2305.15798},
|
130 |
+
year={2023},
|
131 |
+
url={https://arxiv.org/abs/2305.15798}
|
132 |
+
}
|
133 |
+
```
|
134 |
+
```bibtex
|
135 |
+
@article{Kim_2023_ICMLW,
|
136 |
+
title={BK-SDM: Architecturally Compressed Stable Diffusion for Efficient Text-to-Image Generation},
|
137 |
+
author={Kim, Bo-Kyeong and Song, Hyoung-Kyu and Castells, Thibault and Choi, Shinkook},
|
138 |
+
journal={ICML Workshop on Efficient Systems for Foundation Models (ES-FoMo)},
|
139 |
+
year={2023},
|
140 |
+
url={https://openreview.net/forum?id=bOVydU0XKC}
|
141 |
+
}
|
142 |
+
```
|
143 |
+
|
144 |
+
*This model card was written by Bo-Kyeong Kim and is based on the [Stable Diffusion v1 model card]( https://huggingface.co/CompVis/stable-diffusion-v1-4).*
|
bk_sdm_tiny_2m.ckpt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:695ee51f65dba7da30574d7c9e0d87392eba4b1966a0cb05a4e96c11be7b3d28
|
3 |
+
size 1060307888
|
feature_extractor/preprocessor_config.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_size": 224,
|
3 |
+
"do_center_crop": true,
|
4 |
+
"do_convert_rgb": true,
|
5 |
+
"do_normalize": true,
|
6 |
+
"do_resize": true,
|
7 |
+
"feature_extractor_type": "CLIPFeatureExtractor",
|
8 |
+
"image_mean": [
|
9 |
+
0.48145466,
|
10 |
+
0.4578275,
|
11 |
+
0.40821073
|
12 |
+
],
|
13 |
+
"image_std": [
|
14 |
+
0.26862954,
|
15 |
+
0.26130258,
|
16 |
+
0.27577711
|
17 |
+
],
|
18 |
+
"resample": 3,
|
19 |
+
"size": 224
|
20 |
+
}
|
model_index.json
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "StableDiffusionPipeline",
|
3 |
+
"_diffusers_version": "0.2.2",
|
4 |
+
"feature_extractor": [
|
5 |
+
"transformers",
|
6 |
+
"CLIPImageProcessor"
|
7 |
+
],
|
8 |
+
"safety_checker": [
|
9 |
+
"stable_diffusion",
|
10 |
+
"StableDiffusionSafetyChecker"
|
11 |
+
],
|
12 |
+
"scheduler": [
|
13 |
+
"diffusers",
|
14 |
+
"PNDMScheduler"
|
15 |
+
],
|
16 |
+
"text_encoder": [
|
17 |
+
"transformers",
|
18 |
+
"CLIPTextModel"
|
19 |
+
],
|
20 |
+
"tokenizer": [
|
21 |
+
"transformers",
|
22 |
+
"CLIPTokenizer"
|
23 |
+
],
|
24 |
+
"unet": [
|
25 |
+
"diffusers",
|
26 |
+
"UNet2DConditionModel"
|
27 |
+
],
|
28 |
+
"vae": [
|
29 |
+
"diffusers",
|
30 |
+
"AutoencoderKL"
|
31 |
+
]
|
32 |
+
}
|
safety_checker/config.json
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "./safety_module",
|
3 |
+
"architectures": [
|
4 |
+
"StableDiffusionSafetyChecker"
|
5 |
+
],
|
6 |
+
"initializer_factor": 1.0,
|
7 |
+
"logit_scale_init_value": 2.6592,
|
8 |
+
"model_type": "clip",
|
9 |
+
"projection_dim": 768,
|
10 |
+
"text_config": {
|
11 |
+
"_name_or_path": "",
|
12 |
+
"add_cross_attention": false,
|
13 |
+
"architectures": null,
|
14 |
+
"attention_dropout": 0.0,
|
15 |
+
"bad_words_ids": null,
|
16 |
+
"bos_token_id": 0,
|
17 |
+
"chunk_size_feed_forward": 0,
|
18 |
+
"cross_attention_hidden_size": null,
|
19 |
+
"decoder_start_token_id": null,
|
20 |
+
"diversity_penalty": 0.0,
|
21 |
+
"do_sample": false,
|
22 |
+
"dropout": 0.0,
|
23 |
+
"early_stopping": false,
|
24 |
+
"encoder_no_repeat_ngram_size": 0,
|
25 |
+
"eos_token_id": 2,
|
26 |
+
"exponential_decay_length_penalty": null,
|
27 |
+
"finetuning_task": null,
|
28 |
+
"forced_bos_token_id": null,
|
29 |
+
"forced_eos_token_id": null,
|
30 |
+
"hidden_act": "quick_gelu",
|
31 |
+
"hidden_size": 768,
|
32 |
+
"id2label": {
|
33 |
+
"0": "LABEL_0",
|
34 |
+
"1": "LABEL_1"
|
35 |
+
},
|
36 |
+
"initializer_factor": 1.0,
|
37 |
+
"initializer_range": 0.02,
|
38 |
+
"intermediate_size": 3072,
|
39 |
+
"is_decoder": false,
|
40 |
+
"is_encoder_decoder": false,
|
41 |
+
"label2id": {
|
42 |
+
"LABEL_0": 0,
|
43 |
+
"LABEL_1": 1
|
44 |
+
},
|
45 |
+
"layer_norm_eps": 1e-05,
|
46 |
+
"length_penalty": 1.0,
|
47 |
+
"max_length": 20,
|
48 |
+
"max_position_embeddings": 77,
|
49 |
+
"min_length": 0,
|
50 |
+
"model_type": "clip_text_model",
|
51 |
+
"no_repeat_ngram_size": 0,
|
52 |
+
"num_attention_heads": 12,
|
53 |
+
"num_beam_groups": 1,
|
54 |
+
"num_beams": 1,
|
55 |
+
"num_hidden_layers": 12,
|
56 |
+
"num_return_sequences": 1,
|
57 |
+
"output_attentions": false,
|
58 |
+
"output_hidden_states": false,
|
59 |
+
"output_scores": false,
|
60 |
+
"pad_token_id": 1,
|
61 |
+
"prefix": null,
|
62 |
+
"problem_type": null,
|
63 |
+
"pruned_heads": {},
|
64 |
+
"remove_invalid_values": false,
|
65 |
+
"repetition_penalty": 1.0,
|
66 |
+
"return_dict": true,
|
67 |
+
"return_dict_in_generate": false,
|
68 |
+
"sep_token_id": null,
|
69 |
+
"task_specific_params": null,
|
70 |
+
"temperature": 1.0,
|
71 |
+
"tie_encoder_decoder": false,
|
72 |
+
"tie_word_embeddings": true,
|
73 |
+
"tokenizer_class": null,
|
74 |
+
"top_k": 50,
|
75 |
+
"top_p": 1.0,
|
76 |
+
"torch_dtype": null,
|
77 |
+
"torchscript": false,
|
78 |
+
"transformers_version": "4.21.0.dev0",
|
79 |
+
"typical_p": 1.0,
|
80 |
+
"use_bfloat16": false,
|
81 |
+
"vocab_size": 49408
|
82 |
+
},
|
83 |
+
"text_config_dict": {
|
84 |
+
"hidden_size": 768,
|
85 |
+
"intermediate_size": 3072,
|
86 |
+
"num_attention_heads": 12,
|
87 |
+
"num_hidden_layers": 12
|
88 |
+
},
|
89 |
+
"torch_dtype": "float32",
|
90 |
+
"transformers_version": null,
|
91 |
+
"vision_config": {
|
92 |
+
"_name_or_path": "",
|
93 |
+
"add_cross_attention": false,
|
94 |
+
"architectures": null,
|
95 |
+
"attention_dropout": 0.0,
|
96 |
+
"bad_words_ids": null,
|
97 |
+
"bos_token_id": null,
|
98 |
+
"chunk_size_feed_forward": 0,
|
99 |
+
"cross_attention_hidden_size": null,
|
100 |
+
"decoder_start_token_id": null,
|
101 |
+
"diversity_penalty": 0.0,
|
102 |
+
"do_sample": false,
|
103 |
+
"dropout": 0.0,
|
104 |
+
"early_stopping": false,
|
105 |
+
"encoder_no_repeat_ngram_size": 0,
|
106 |
+
"eos_token_id": null,
|
107 |
+
"exponential_decay_length_penalty": null,
|
108 |
+
"finetuning_task": null,
|
109 |
+
"forced_bos_token_id": null,
|
110 |
+
"forced_eos_token_id": null,
|
111 |
+
"hidden_act": "quick_gelu",
|
112 |
+
"hidden_size": 1024,
|
113 |
+
"id2label": {
|
114 |
+
"0": "LABEL_0",
|
115 |
+
"1": "LABEL_1"
|
116 |
+
},
|
117 |
+
"image_size": 224,
|
118 |
+
"initializer_factor": 1.0,
|
119 |
+
"initializer_range": 0.02,
|
120 |
+
"intermediate_size": 4096,
|
121 |
+
"is_decoder": false,
|
122 |
+
"is_encoder_decoder": false,
|
123 |
+
"label2id": {
|
124 |
+
"LABEL_0": 0,
|
125 |
+
"LABEL_1": 1
|
126 |
+
},
|
127 |
+
"layer_norm_eps": 1e-05,
|
128 |
+
"length_penalty": 1.0,
|
129 |
+
"max_length": 20,
|
130 |
+
"min_length": 0,
|
131 |
+
"model_type": "clip_vision_model",
|
132 |
+
"no_repeat_ngram_size": 0,
|
133 |
+
"num_attention_heads": 16,
|
134 |
+
"num_beam_groups": 1,
|
135 |
+
"num_beams": 1,
|
136 |
+
"num_hidden_layers": 24,
|
137 |
+
"num_return_sequences": 1,
|
138 |
+
"output_attentions": false,
|
139 |
+
"output_hidden_states": false,
|
140 |
+
"output_scores": false,
|
141 |
+
"pad_token_id": null,
|
142 |
+
"patch_size": 14,
|
143 |
+
"prefix": null,
|
144 |
+
"problem_type": null,
|
145 |
+
"pruned_heads": {},
|
146 |
+
"remove_invalid_values": false,
|
147 |
+
"repetition_penalty": 1.0,
|
148 |
+
"return_dict": true,
|
149 |
+
"return_dict_in_generate": false,
|
150 |
+
"sep_token_id": null,
|
151 |
+
"task_specific_params": null,
|
152 |
+
"temperature": 1.0,
|
153 |
+
"tie_encoder_decoder": false,
|
154 |
+
"tie_word_embeddings": true,
|
155 |
+
"tokenizer_class": null,
|
156 |
+
"top_k": 50,
|
157 |
+
"top_p": 1.0,
|
158 |
+
"torch_dtype": null,
|
159 |
+
"torchscript": false,
|
160 |
+
"transformers_version": "4.21.0.dev0",
|
161 |
+
"typical_p": 1.0,
|
162 |
+
"use_bfloat16": false
|
163 |
+
},
|
164 |
+
"vision_config_dict": {
|
165 |
+
"hidden_size": 1024,
|
166 |
+
"intermediate_size": 4096,
|
167 |
+
"num_attention_heads": 16,
|
168 |
+
"num_hidden_layers": 24,
|
169 |
+
"patch_size": 14
|
170 |
+
}
|
171 |
+
}
|
safety_checker/model.fp16.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:08902f19b1cfebd7c989f152fc0507bef6898c706a91d666509383122324b511
|
3 |
+
size 608018440
|
safety_checker/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9d6a233ff6fd5ccb9f76fd99618d73369c52dd3d8222376384d0e601911089e8
|
3 |
+
size 1215981830
|
safety_checker/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:193490b58ef62739077262e833bf091c66c29488058681ac25cf7df3d8190974
|
3 |
+
size 1216061799
|
safety_checker/pytorch_model.fp16.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:22ba87205445ad5def13e54919b038dcfb7321ec1c3f4b12487d4fba6036125f
|
3 |
+
size 608103564
|
scheduler/.ipynb_checkpoints/scheduler_config-checkpoint.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "PNDMScheduler",
|
3 |
+
"_diffusers_version": "0.2.2",
|
4 |
+
"beta_end": 0.012,
|
5 |
+
"beta_schedule": "scaled_linear",
|
6 |
+
"beta_start": 0.00085,
|
7 |
+
"num_train_timesteps": 1000,
|
8 |
+
"skip_prk_steps": true
|
9 |
+
}
|
scheduler/scheduler_config.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "PNDMScheduler",
|
3 |
+
"_diffusers_version": "0.7.0.dev0",
|
4 |
+
"beta_end": 0.012,
|
5 |
+
"beta_schedule": "scaled_linear",
|
6 |
+
"beta_start": 0.00085,
|
7 |
+
"num_train_timesteps": 1000,
|
8 |
+
"set_alpha_to_one": false,
|
9 |
+
"skip_prk_steps": true,
|
10 |
+
"steps_offset": 1,
|
11 |
+
"trained_betas": null,
|
12 |
+
"clip_sample": false
|
13 |
+
}
|
text_encoder/config.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "openai/clip-vit-large-patch14",
|
3 |
+
"architectures": [
|
4 |
+
"CLIPTextModel"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"dropout": 0.0,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"hidden_act": "quick_gelu",
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_factor": 1.0,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 77,
|
17 |
+
"model_type": "clip_text_model",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 12,
|
20 |
+
"pad_token_id": 1,
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.21.0.dev0",
|
23 |
+
"vocab_size": 49408
|
24 |
+
}
|
text_encoder/model.fp16.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:77795e2023adcf39bc29a884661950380bd093cf0750a966d473d1718dc9ef4e
|
3 |
+
size 246144864
|
text_encoder/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7b3a12df205cb3c74dd4eae4354d93f606ae6b3bc29d5d06fd97921cb9ad8a81
|
3 |
+
size 492265879
|
text_encoder/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:770a47a9ffdcfda0b05506a7888ed714d06131d60267e6cf52765d61cf59fd67
|
3 |
+
size 492305335
|
text_encoder/pytorch_model.fp16.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:05eee911f195625deeab86f0b22b115d7d8bc3adbfc1404f03557f7e4e6a8fd7
|
3 |
+
size 246187076
|
tokenizer/merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer/special_tokens_map.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<|startoftext|>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|endoftext|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": "<|endoftext|>",
|
17 |
+
"unk_token": {
|
18 |
+
"content": "<|endoftext|>",
|
19 |
+
"lstrip": false,
|
20 |
+
"normalized": true,
|
21 |
+
"rstrip": false,
|
22 |
+
"single_word": false
|
23 |
+
}
|
24 |
+
}
|
tokenizer/tokenizer_config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"bos_token": {
|
4 |
+
"__type": "AddedToken",
|
5 |
+
"content": "<|startoftext|>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false
|
10 |
+
},
|
11 |
+
"do_lower_case": true,
|
12 |
+
"eos_token": {
|
13 |
+
"__type": "AddedToken",
|
14 |
+
"content": "<|endoftext|>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": true,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
},
|
20 |
+
"errors": "replace",
|
21 |
+
"model_max_length": 77,
|
22 |
+
"name_or_path": "openai/clip-vit-large-patch14",
|
23 |
+
"pad_token": "<|endoftext|>",
|
24 |
+
"special_tokens_map_file": "./special_tokens_map.json",
|
25 |
+
"tokenizer_class": "CLIPTokenizer",
|
26 |
+
"unk_token": {
|
27 |
+
"__type": "AddedToken",
|
28 |
+
"content": "<|endoftext|>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": true,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false
|
33 |
+
}
|
34 |
+
}
|
tokenizer/vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
unet/config.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "UNet2DConditionModel",
|
3 |
+
"_diffusers_version": "0.15.0",
|
4 |
+
"_name_or_path": "/ssd2/bkkim/upload_BK-SDM_weights/bk-sdm-tiny-2m",
|
5 |
+
"act_fn": "silu",
|
6 |
+
"attention_head_dim": 8,
|
7 |
+
"block_out_channels": [
|
8 |
+
320,
|
9 |
+
640,
|
10 |
+
1280
|
11 |
+
],
|
12 |
+
"center_input_sample": false,
|
13 |
+
"class_embed_type": null,
|
14 |
+
"class_embeddings_concat": false,
|
15 |
+
"conv_in_kernel": 3,
|
16 |
+
"conv_out_kernel": 3,
|
17 |
+
"cross_attention_dim": 768,
|
18 |
+
"cross_attention_norm": null,
|
19 |
+
"down_block_types": [
|
20 |
+
"CrossAttnDownBlock2D",
|
21 |
+
"CrossAttnDownBlock2D",
|
22 |
+
"CrossAttnDownBlock2D"
|
23 |
+
],
|
24 |
+
"downsample_padding": 1,
|
25 |
+
"dual_cross_attention": false,
|
26 |
+
"encoder_hid_dim": null,
|
27 |
+
"flip_sin_to_cos": true,
|
28 |
+
"freq_shift": 0,
|
29 |
+
"in_channels": 4,
|
30 |
+
"layers_per_block": 1,
|
31 |
+
"mid_block_only_cross_attention": null,
|
32 |
+
"mid_block_scale_factor": 1,
|
33 |
+
"mid_block_type": null,
|
34 |
+
"norm_eps": 1e-05,
|
35 |
+
"norm_num_groups": 32,
|
36 |
+
"num_class_embeds": null,
|
37 |
+
"only_cross_attention": false,
|
38 |
+
"out_channels": 4,
|
39 |
+
"projection_class_embeddings_input_dim": null,
|
40 |
+
"resnet_out_scale_factor": 1.0,
|
41 |
+
"resnet_skip_time_act": false,
|
42 |
+
"resnet_time_scale_shift": "default",
|
43 |
+
"sample_size": 64,
|
44 |
+
"time_cond_proj_dim": null,
|
45 |
+
"time_embedding_act_fn": null,
|
46 |
+
"time_embedding_type": "positional",
|
47 |
+
"timestep_post_act": null,
|
48 |
+
"up_block_types": [
|
49 |
+
"CrossAttnUpBlock2D",
|
50 |
+
"CrossAttnUpBlock2D",
|
51 |
+
"CrossAttnUpBlock2D"
|
52 |
+
],
|
53 |
+
"upcast_attention": false,
|
54 |
+
"use_linear_projection": false
|
55 |
+
}
|
unet/diffusion_pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a484244e68bad42e249d6617df6e6ca7e2a6239c7d80bdb448cd5a02eac95f6c
|
3 |
+
size 1293688501
|
unet/diffusion_pytorch_model.fp16.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89375768e871ce3845196165b078a8a1859fa96970d6c185c3a933c1f5475c7a
|
3 |
+
size 646920381
|
unet/diffusion_pytorch_model.fp16.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0995cd3492f52c996a4e735b1e620945d2fa23c527dc2c0f3439f3f542dd98ba
|
3 |
+
size 646813304
|
unet/diffusion_pytorch_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2948b1dcf06e1a23e56ca4a8bfd3bf560d80b6c4ead9e560811e28aac946cb12
|
3 |
+
size 1293583616
|
vae/config.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "AutoencoderKL",
|
3 |
+
"_diffusers_version": "0.2.2",
|
4 |
+
"act_fn": "silu",
|
5 |
+
"block_out_channels": [
|
6 |
+
128,
|
7 |
+
256,
|
8 |
+
512,
|
9 |
+
512
|
10 |
+
],
|
11 |
+
"down_block_types": [
|
12 |
+
"DownEncoderBlock2D",
|
13 |
+
"DownEncoderBlock2D",
|
14 |
+
"DownEncoderBlock2D",
|
15 |
+
"DownEncoderBlock2D"
|
16 |
+
],
|
17 |
+
"in_channels": 3,
|
18 |
+
"latent_channels": 4,
|
19 |
+
"layers_per_block": 2,
|
20 |
+
"out_channels": 3,
|
21 |
+
"sample_size": 512,
|
22 |
+
"scaling_factor": 0.18215,
|
23 |
+
"up_block_types": [
|
24 |
+
"UpDecoderBlock2D",
|
25 |
+
"UpDecoderBlock2D",
|
26 |
+
"UpDecoderBlock2D",
|
27 |
+
"UpDecoderBlock2D"
|
28 |
+
]
|
29 |
+
}
|
vae/diffusion_pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1b134cded8eb78b184aefb8805b6b572f36fa77b255c483665dda931fa0130c5
|
3 |
+
size 334707217
|
vae/diffusion_pytorch_model.fp16.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b7643b3e40b9f128eda5fe174fea73c3ef3903562651fb344a79439709c2e503
|
3 |
+
size 167405651
|
vae/diffusion_pytorch_model.fp16.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4fbcf0ebe55a0984f5a5e00d8c4521d52359af7229bb4d81890039d2aa16dd7c
|
3 |
+
size 167335342
|
vae/diffusion_pytorch_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a2b5134f4dbc140d9c11f11cba3233099e00af40f262f136c691fb7d38d2194c
|
3 |
+
size 334643276
|