cl-tohoku commited on
Commit
d0c4bcd
1 Parent(s): 854d619

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ images/sample_images.png filter=lfs diff=lfs merge=lfs -text
LICENSE.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2023 Keito Kudo
2
+ CreativeML Open RAIL++-M License dated November 6, 2023
3
+
4
+ Section I: PREAMBLE
5
+ Multimodal generative models are being widely adopted and used, and have the potential to transform the way artists, among other individuals, conceive and benefit from AI or ML technologies as a tool for content creation.
6
+ Notwithstanding the current and potential benefits that these artifacts can bring to society at large, there are also concerns about potential misuses of them, either due to their technical limitations or ethical considerations.
7
+ In short, this license strives for both the open and responsible downstream use of the accompanying model. When it comes to the open character, we took inspiration from open source permissive licenses regarding the grant of IP rights. Referring to the downstream responsible use, we added use-based restrictions not permitting the use of the model in very specific scenarios, in order for the licensor to be able to enforce the license in case potential misuses of the Model may occur. At the same time, we strive to promote open and responsible research on generative models for art and content generation.
8
+ Even though downstream derivative versions of the model could be released under different licensing terms, the latter will always have to include - at minimum - the same use-based restrictions as the ones in the original license (this license). We believe in the intersection between open and responsible AI development; thus, this agreement aims to strike a balance between both in order to enable responsible open-science in the field of AI.
9
+ This CreativeML Open RAIL++-M License governs the use of the model (and its derivatives) and is informed by the model card associated with the model.
10
+ NOW THEREFORE, You and Licensor agree as follows:
11
+ Definitions
12
+ "License" means the terms and conditions for use, reproduction, and Distribution as defined in this document.
13
+ "Data" means a collection of information and/or content extracted from the dataset used with the Model, including to train, pretrain, or otherwise evaluate the Model. The Data is not licensed under this License.
14
+ "Output" means the results of operating a Model as embodied in informational content resulting therefrom.
15
+ "Model" means any accompanying machine-learning based assemblies (including checkpoints), consisting of learnt weights, parameters (including optimizer states), corresponding to the model architecture as embodied in the Complementary Material, that have been trained or tuned, in whole or in part on the Data, using the Complementary Material.
16
+ "Derivatives of the Model" means all modifications to the Model, works based on the Model, or any other model which is created or initialized by transfer of patterns of the weights, parameters, activations or output of the Model, to the other model, in order to cause the other model to perform similarly to the Model, including - but not limited to - distillation methods entailing the use of intermediate data representations or methods based on the generation of synthetic data by the Model for training the other model.
17
+ "Complementary Material" means the accompanying source code and scripts used to define, run, load, benchmark or evaluate the Model, and used to prepare data for training or evaluation, if any. This includes any accompanying documentation, tutorials, examples, etc, if any.
18
+ "Distribution" means any transmission, reproduction, publication or other sharing of the Model or Derivatives of the Model to a third party, including providing the Model as a hosted service made available by electronic or other remote means - e.g. API-based or web access.
19
+ "Licensor" means the copyright owner or entity authorized by the copyright owner that is granting the License, including the persons or entities that may have rights in the Model and/or distributing the Model.
20
+ "You" (or "Your") means an individual or Legal Entity exercising permissions granted by this License and/or making use of the Model for whichever purpose and in any field of use, including usage of the Model in an end-use application - e.g. chatbot, translator, image generator.
21
+ "Third Parties" means individuals or legal entities that are not under common control with Licensor or You.
22
+ "Contribution" means any work of authorship, including the original version of the Model and any modifications or additions to that Model or Derivatives of the Model thereof, that is intentionally submitted to Licensor for inclusion in the Model by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Model, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
23
+ "Contributor" means Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Model.
24
+
25
+ Section II: INTELLECTUAL PROPERTY RIGHTS
26
+ Both copyright and patent grants apply to the Model, Derivatives of the Model and Complementary Material. The Model and Derivatives of the Model are subject to additional terms as described in
27
+
28
+ Section III.
29
+ Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare, publicly display, publicly perform, sublicense, and distribute the Complementary Material, the Model, and Derivatives of the Model.
30
+ Grant of Patent License. Subject to the terms and conditions of this License and where and as applicable, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this paragraph) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model and the Complementary Material, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Model to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model and/or Complementary Material or a Contribution incorporated within the Model and/or Complementary Material constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for the Model and/or Work shall terminate as of the date such litigation is asserted or filed.
31
+ Section III: CONDITIONS OF USAGE, DISTRIBUTION AND REDISTRIBUTION
32
+ Distribution and Redistribution. You may host for Third Party remote access purposes (e.g. software-as-a-service), reproduce and distribute copies of the Model or Derivatives of the Model thereof in any medium, with or without modifications, provided that You meet the following conditions: Use-based restrictions as referenced in paragraph 5 MUST be included as an enforceable provision by You in any type of legal agreement (e.g. a license) governing the use and/or distribution of the Model or Derivatives of the Model, and You shall give notice to subsequent users You Distribute to, that the Model or Derivatives of the Model are subject to paragraph 5. This provision does not apply to the use of Complementary Material. You must give any Third Party recipients of the Model or Derivatives of the Model a copy of this License; You must cause any modified files to carry prominent notices stating that You changed the files; You must retain all copyright, patent, trademark, and attribution notices excluding those notices that do not pertain to any part of the Model, Derivatives of the Model. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions - respecting paragraph 4.a. - for use, reproduction, or Distribution of Your modifications, or for any such Derivatives of the Model as a whole, provided Your use, reproduction, and Distribution of the Model otherwise complies with the conditions stated in this License.
33
+ Use-based restrictions. The restrictions set forth in Attachment A are considered Use-based restrictions. Therefore You cannot use the Model and the Derivatives of the Model for the specified restricted uses. You may use the Model subject to this License, including only for lawful purposes and in accordance with the License. Use may include creating any content with, finetuning, updating, running, training, evaluating and/or reparametrizing the Model. You shall require all of Your users who use the Model or a Derivative of the Model to comply with the terms of this paragraph (paragraph 5).
34
+ The Output You Generate. Except as set forth herein, Licensor claims no rights in the Output You generate using the Model. You are accountable for the Output you generate and its subsequent uses. No use of the output can contravene any provision as stated in the License.
35
+
36
+ Section IV: OTHER PROVISIONS
37
+ Updates and Runtime Restrictions. To the maximum extent permitted by law, Licensor reserves the right to restrict (remotely or otherwise) usage of the Model in violation of this License.
38
+ Trademarks and related. Nothing in this License permits You to make use of Licensors’ trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between the parties; and any rights not expressly granted herein are reserved by the Licensors.
39
+ Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Model and the Complementary Material (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Model, Derivatives of the Model, and the Complementary Material and assume any risks associated with Your exercise of permissions under this License.
40
+ Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Model and the Complementary Material (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
41
+ Accepting Warranty or Additional Liability. While redistributing the Model, Derivatives of the Model and the Complementary Material thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
42
+ If any provision of this License is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.
43
+
44
+ END OF TERMS AND CONDITIONS
45
+
46
+ Attachment A
47
+ Use Restrictions
48
+ You agree not to use the Model or Derivatives of the Model:
49
+ In any way that violates any applicable national, federal, state, local or international law or regulation;
50
+ For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;
51
+ To generate or disseminate verifiably false information and/or content with the purpose of harming others;
52
+ To generate or disseminate personal identifiable information that can be used to harm an individual;
53
+ To defame, disparage or otherwise harass others;
54
+ For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;
55
+ For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;
56
+ To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;
57
+ For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories;
58
+ To provide medical advice and medical results interpretation;
59
+ To generate or disseminate information for the purpose to be used for administration of justice, law enforcement, immigration or asylum processes, such as predicting an individual will commit fraud/crime commitment (e.g. by text profiling, drawing causal relationships between assertions made in documents, indiscriminate and arbitrarily-targeted use).
60
+
README.md CHANGED
@@ -1,3 +1,163 @@
1
  ---
2
  license: openrail++
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: openrail++
3
+ language:
4
+ - ja
5
  ---
6
+
7
+ ![sample_image](images/sample_images.png)
8
+
9
+
10
+ (English part follows Japanese one.)
11
+ # SD-XL 1.0-jp-refiner Model Card
12
+ 総計5.8Bのパラメータを持つ画像生成モデル,[SDXL](https://arxiv.org/abs/2307.01952)を日本語入力に対応させたモデルです.ここではrefiner([stable-diffusion-xl-refiner-1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0))の日本語対応版を公開しています.
13
+
14
+
15
+ ## 学習戦略
16
+ ### ファインチューニング
17
+ stable-diffusion-xl-base-1.0に使われているテキストエンコーダである,[OpenCLIP-ViT/G](https://github.com/mlfoundations/open_clip), [CLIP-ViT/L](https://github.com/openai/CLIP/tree/main)のみをファインチューニングすることにより,日本語入力に対応したテキストエンコーダを学習した.具体的には,英語のデータセットで学習されたオリジナルのテキストエンコーダに対して,英文を入力した際の出力(hidden states)と,新たに学習する日本語テキストエンコーダに同じ意味の日本語を入力した際の出力が一致するように学習行った.学習データとして日英対訳データを利用し,日本語のtokenizerとしては[line-corporation/japanese-large-lm-3.6b](https://huggingface.co/line-corporation/japanese-large-lm-3.6b)を利用した.
18
+
19
+ ### 語彙の類似度をベースとした単語埋め込みの初期化
20
+ 日本語テキストエンコーダの効率的な学習と,対訳データに含まれない単語へのある程度の適応を期待して,オリジナルの英語のテキストエンコーダの単語埋め込みを利用した日本語の単語埋め込みの初期化を行なった.具体的には,日本語トークナイザーの語彙と,オリジナルの英語のトークナイザーの語彙全ての単語ベクトルを[multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large)を用いて計算し,全ての日本語・英語の語彙の組み合わせについて類似度を求めた.その後,日本語の各語彙に対応する単語(サブワード)ベクトルと最も類似する英語の単語を求め,その類似する英単語に対応するベクトルを日本語単語の単語埋め込みの初期値とした.
21
+
22
+ ## 学習データ
23
+ ### WMT
24
+ [WMT2023 Shared Task: General Machine Translation](https://aclanthology.org/2022.wmt-1.25/)で利用される日英対訳コーパスである.本モデルの学習には[SKIM at WMT 2023 General Translation Task]()でのモデルの学習のために利用されたフィルタリング済みのデータセットを利用した.対訳ペアの総数は28155494件である.
25
+
26
+ ### laion2B-multi
27
+ [Christoph et al. (2022)](https://openreview.net/pdf?id=M3Y74vmsMcY)によって公開された大規模な画像とそのキャプションのペアで構成されたデータセットである.本モデルの学習にはキャプションのみを用いた. 前処理として[fasttext](https://fasttext.cc/)を用いて日本語キャプションのフィルタリングを行なった後,画像とキャプションの類似度が高い上位13221368件のキャプションを利用した.画像とキャプションの類似度の計算には[rinna/japanese-cloob-vit-b-16](https://huggingface.co/rinna/japanese-cloob-vit-b-16)を用いた.日本語のキャプションを日英翻訳モデルを用いて翻訳を行い英語のキャプションを生成した.翻訳モデルは[WMT22 Genral Machine TranslationタスクのチームNT5の提出システム](https://aclanthology.org/2022.wmt-1.25/)の中で用いられている日英翻訳モデル,ABCI-baeeを利用した.
28
+
29
+
30
+
31
+ ## 使用例
32
+ 本モデルは[cl-tohoku/stable-diffusion-xl-jp-base-1.0](https://huggingface.co/cl-tohoku/stable-diffusion-xl-jp-base-1.0)と共に利用することを想定しています.
33
+
34
+ ```python
35
+ import torch
36
+ from diffusers import StableDiffusionXLPipeline, StableDiffusionXLImg2ImgPipeline
37
+
38
+ base_model_name_or_path = "cl-tohoku/stable-diffusion-xl-jp-base-1.0"
39
+ refiner_model_name_or_path = "cl-tohoku/stable-diffusion-xl-jp-refiner-1.0"
40
+
41
+ pipeline_base = StableDiffusionXLPipeline.from_pretrained(
42
+ base_model_name_or_path,
43
+ torch_dtype=torch.float16,
44
+ )
45
+
46
+ pipeline_refiner = StableDiffusionXLImg2ImgPipeline.from_pretrained(
47
+ refiner_model_name_or_path,
48
+ torch_dtype=torch.bfloat16,
49
+ )
50
+ pipeline_base = pipeline_base.to("cuda")
51
+ pipeline_refiner = pipeline_refiner.to("cuda")
52
+
53
+ n_steps = 100
54
+ high_noise_frac = 0.8
55
+ guidance_scale = 7.5
56
+ text = "かわいすぎる子猫"
57
+
58
+ with torch.autocast(
59
+ device_type="cuda",
60
+ dtype=torch.bfloat16
61
+ ):
62
+ image = pipeline_base(
63
+ prompt=text,
64
+ num_inference_steps=n_steps,
65
+ denoising_end=high_noise_frac,
66
+ guidance_scale=guidance_scale,
67
+ output_type="latent",
68
+ ).images[0]
69
+
70
+ image = pipeline_refiner(
71
+ prompt=text,
72
+ num_inference_steps=n_steps,
73
+ denoising_start=high_noise_frac,
74
+ guidance_scale=guidance_scale,
75
+ image=image,
76
+ ).images[0]
77
+
78
+ image.save("image.png")
79
+ ```
80
+
81
+ ## ライセンス
82
+ モデルはOpen RAIL++-Mライセンスの下で配布されています.
83
+
84
+ ## 謝辞
85
+ このモデルの学習にあたり様々な面でご協力いただきました[Tohoku NLPグループ](https://www.nlp.ecei.tohoku.ac.jp/)の皆様に感謝いたします.
86
+
87
+ ---
88
+
89
+ # SD-XL 1.0-jp-refiner Model Card
90
+ This is a Japanese input support version of the image generation model [SDXL](https://arxiv.org/abs/2307.01952) with a total of 5.8B parameters. Here, we release the Japanese input support version of the refiner ([stable-diffusion-xl-refiner-1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0)).
91
+
92
+ ## Training Strategy
93
+ ### Fine-tuning
94
+ We fine-tuned only the text encoders used in stable-diffusion-xl-base-1.0, [OpenCLIP-ViT/G](https://github.com/mlfoundations/open_clip), [CLIP-ViT/L](https://github.com/openai/CLIP/tree/main) to support Japanese input. We used Japanese-English parallel corpus as training dataset. We trained the Japanese text encoder so that the output (hidden states) when English sentences were input to the original English text encoder and the output when the same meaning Japanese sentences were input to the newly trained Japanese text encoder were the same. We used [line-corporation/japanese-large-lm-3.6b](https://huggingface.co/line-corporation/japanese-large-lm-3.6b) as Japanese tokenizer.
95
+
96
+
97
+ We trained a text encoder that supports Japanese input by fine-tuning only the text encoders used in stable-diffusion-xl-base-1.0, [OpenCLIP-ViT/G](https://github.com/mlfoundations/open_clip) and [CLIP-ViT/L](https://github.com/openai/CLIP/tree/main). Specifically, we trained the new Japanese text encoder to produce output that matches the output (hidden states) of the original text encoder when the same meaning Japanese sentences and English sentences are input. We used Japanese-English parallel data as the training data and employed the [line-corporation/japanese-large-lm-3.6b](https://huggingface.co/line-corporation/japanese-large-lm-3.6b) as the Japanese tokenizer.
98
+
99
+ ## Training Data
100
+ ### WMT
101
+ A Japanese-English parallel corpus used in [WMT2023 Shared Task: General Machine Translation](https://aclanthology.org/2022.wmt-1.25/). We used the filtered dataset used for training the model in [SKIM at WMT 2023 General Translation Task](). The size of this parallel corpus is 28155494.
102
+
103
+ ### laion2B-multi
104
+ A large-scale dataset consisting of image-caption pairs released by [Christoph et al. (2022)](https://openreview.net/pdf?id=M3Y74vmsMcY). We used only the captions for training this model. As a preprocessing step, we filtered the Japanese captions using [fasttext](https://fasttext.cc/), and then used the top 13221368 captions with high similarity to the images. We used [rinna/japanese-cloob-vit-b-16](https://huggingface.co/rinna/japanese-cloob-vit-b-16) to calculate the similarity between images and captions. We translated the Japanese captions into English captions using a Japanese-English translation model, ABCI-baee, used in [NT5 at WMT 2022 General Translation Task](https://aclanthology.org/2022.wmt-1.25/).
105
+
106
+ ## Example
107
+ This model is intended to be used with [cl-tohoku/stable-diffusion-xl-jp-base-1.0](https://huggingface.co/cl-tohoku/stable-diffusion-xl-jp-base-1.0).
108
+
109
+ ```python
110
+ import torch
111
+ from diffusers import StableDiffusionXLPipeline, StableDiffusionXLImg2ImgPipeline
112
+
113
+ base_model_name_or_path = "cl-tohoku/stable-diffusion-xl-jp-base-1.0"
114
+ refiner_model_name_or_path = "cl-tohoku/stable-diffusion-xl-jp-refiner-1.0"
115
+
116
+ pipeline_base = StableDiffusionXLPipeline.from_pretrained(
117
+ base_model_name_or_path,
118
+ torch_dtype=torch.float16,
119
+ )
120
+
121
+ pipeline_refiner = StableDiffusionXLImg2ImgPipeline.from_pretrained(
122
+ refiner_model_name_or_path,
123
+ torch_dtype=torch.bfloat16,
124
+ )
125
+ pipeline_base = pipeline_base.to("cuda")
126
+ pipeline_refiner = pipeline_refiner.to("cuda")
127
+
128
+ n_steps = 100
129
+ high_noise_frac = 0.8
130
+ guidance_scale = 7.5
131
+ text = "かわいすぎる子猫"
132
+
133
+ with torch.autocast(
134
+ device_type="cuda",
135
+ dtype=torch.bfloat16
136
+ ):
137
+ image = pipeline_base(
138
+ prompt=text,
139
+ num_inference_steps=n_steps,
140
+ denoising_end=high_noise_frac,
141
+ guidance_scale=guidance_scale,
142
+ output_type="latent",
143
+ ).images[0]
144
+
145
+ image = pipeline_refiner(
146
+ prompt=text,
147
+ num_inference_steps=n_steps,
148
+ denoising_start=high_noise_frac,
149
+ guidance_scale=guidance_scale,
150
+ image=image,
151
+ ).images[0]
152
+
153
+ image.save("image.png")
154
+ ```
155
+
156
+
157
+
158
+ ## Licenses
159
+ The models are distributed under the Open RAIL++-M.
160
+
161
+
162
+ ## Acknowledgments
163
+ We would like to appreciate the member of [Tohoku NLP Group](https://www.nlp.ecei.tohoku.ac.jp/) for their cooperation to train this model.
images/sample_images.png ADDED

Git LFS Details

  • SHA256: 7f3ceaa547ec193b2ebb22a0994bbbafedb5f281ba96fbdf7179963ac1d937ba
  • Pointer size: 132 Bytes
  • Size of remote file: 6.23 MB
model_index.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "StableDiffusionXLImg2ImgPipeline",
3
+ "_diffusers_version": "0.21.1",
4
+ "_name_or_path": "/work/base_models/original/stabilityai/stable-diffusion-xl-refiner-1.0",
5
+ "force_zeros_for_empty_prompt": false,
6
+ "requires_aesthetics_score": true,
7
+ "scheduler": [
8
+ "diffusers",
9
+ "EulerDiscreteScheduler"
10
+ ],
11
+ "text_encoder": [
12
+ null,
13
+ null
14
+ ],
15
+ "text_encoder_2": [
16
+ "transformers",
17
+ "CLIPTextModelWithProjection"
18
+ ],
19
+ "tokenizer": [
20
+ null,
21
+ null
22
+ ],
23
+ "tokenizer_2": [
24
+ "transformers",
25
+ "T5Tokenizer"
26
+ ],
27
+ "unet": [
28
+ "diffusers",
29
+ "UNet2DConditionModel"
30
+ ],
31
+ "vae": [
32
+ "diffusers",
33
+ "AutoencoderKL"
34
+ ]
35
+ }
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "EulerDiscreteScheduler",
3
+ "_diffusers_version": "0.21.1",
4
+ "beta_end": 0.012,
5
+ "beta_schedule": "scaled_linear",
6
+ "beta_start": 0.00085,
7
+ "clip_sample": false,
8
+ "interpolation_type": "linear",
9
+ "num_train_timesteps": 1000,
10
+ "prediction_type": "epsilon",
11
+ "sample_max_value": 1.0,
12
+ "set_alpha_to_one": false,
13
+ "skip_prk_steps": true,
14
+ "steps_offset": 1,
15
+ "timestep_spacing": "leading",
16
+ "trained_betas": null,
17
+ "use_karras_sigmas": false
18
+ }
text_encoder_2/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/work/experiment_results/laion_wmt_42_text_encoder_2_embed_sim_initialization/weights/ClipKDPL",
3
+ "architectures": [
4
+ "CLIPTextModelWithProjection"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 0,
8
+ "dropout": 0.0,
9
+ "eos_token_id": 2,
10
+ "hidden_act": "gelu",
11
+ "hidden_size": 1280,
12
+ "initializer_factor": 1.0,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 5120,
15
+ "layer_norm_eps": 1e-05,
16
+ "max_position_embeddings": 77,
17
+ "model_type": "clip_text_model",
18
+ "num_attention_heads": 20,
19
+ "num_hidden_layers": 32,
20
+ "pad_token_id": 1,
21
+ "projection_dim": 1280,
22
+ "torch_dtype": "float32",
23
+ "transformers_version": "4.31.0",
24
+ "vocab_size": 51200
25
+ }
text_encoder_2/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b932029c879caa373983b95ccd96a705a23c97652f9901f5ebaeeb85830a5103
3
+ size 2787877304
tokenizer_2/special_tokens_map.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<cls>",
4
+ "eos_token": "</s>",
5
+ "mask_token": "<mask>",
6
+ "pad_token": "<pad>",
7
+ "sep_token": "<sep>",
8
+ "unk_token": "<unk>"
9
+ }
tokenizer_2/spiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c5c56a739832923347681ed8a03a9cbf5afb6d1fe60089a5b01dd2dd063ab71
3
+ size 1208648
tokenizer_2/tokenizer_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": null,
3
+ "bos_token": "<s>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "cls_token": "<cls>",
6
+ "do_lower_case": false,
7
+ "eos_token": "</s>",
8
+ "extra_ids": 0,
9
+ "keep_accents": true,
10
+ "legacy": true,
11
+ "mask_token": "<mask>",
12
+ "model_max_length": 77,
13
+ "pad_token": "<pad>",
14
+ "sep_token": "<sep>",
15
+ "sp_model_kwargs": {},
16
+ "tokenizer_class": "T5Tokenizer",
17
+ "unk_token": "<unk>"
18
+ }
unet/config.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "UNet2DConditionModel",
3
+ "_diffusers_version": "0.21.1",
4
+ "_name_or_path": "/work/base_models/original/stabilityai/stable-diffusion-xl-refiner-1.0/unet",
5
+ "act_fn": "silu",
6
+ "addition_embed_type": "text_time",
7
+ "addition_embed_type_num_heads": 64,
8
+ "addition_time_embed_dim": 256,
9
+ "attention_head_dim": [
10
+ 6,
11
+ 12,
12
+ 24,
13
+ 24
14
+ ],
15
+ "attention_type": "default",
16
+ "block_out_channels": [
17
+ 384,
18
+ 768,
19
+ 1536,
20
+ 1536
21
+ ],
22
+ "center_input_sample": false,
23
+ "class_embed_type": null,
24
+ "class_embeddings_concat": false,
25
+ "conv_in_kernel": 3,
26
+ "conv_out_kernel": 3,
27
+ "cross_attention_dim": 1280,
28
+ "cross_attention_norm": null,
29
+ "down_block_types": [
30
+ "DownBlock2D",
31
+ "CrossAttnDownBlock2D",
32
+ "CrossAttnDownBlock2D",
33
+ "DownBlock2D"
34
+ ],
35
+ "downsample_padding": 1,
36
+ "dropout": 0.0,
37
+ "dual_cross_attention": false,
38
+ "encoder_hid_dim": null,
39
+ "encoder_hid_dim_type": null,
40
+ "flip_sin_to_cos": true,
41
+ "freq_shift": 0,
42
+ "in_channels": 4,
43
+ "layers_per_block": 2,
44
+ "mid_block_only_cross_attention": null,
45
+ "mid_block_scale_factor": 1,
46
+ "mid_block_type": "UNetMidBlock2DCrossAttn",
47
+ "norm_eps": 1e-05,
48
+ "norm_num_groups": 32,
49
+ "num_attention_heads": null,
50
+ "num_class_embeds": null,
51
+ "only_cross_attention": false,
52
+ "out_channels": 4,
53
+ "projection_class_embeddings_input_dim": 2560,
54
+ "resnet_out_scale_factor": 1.0,
55
+ "resnet_skip_time_act": false,
56
+ "resnet_time_scale_shift": "default",
57
+ "sample_size": 128,
58
+ "time_cond_proj_dim": null,
59
+ "time_embedding_act_fn": null,
60
+ "time_embedding_dim": null,
61
+ "time_embedding_type": "positional",
62
+ "timestep_post_act": null,
63
+ "transformer_layers_per_block": 4,
64
+ "up_block_types": [
65
+ "UpBlock2D",
66
+ "CrossAttnUpBlock2D",
67
+ "CrossAttnUpBlock2D",
68
+ "UpBlock2D"
69
+ ],
70
+ "upcast_attention": null,
71
+ "use_linear_projection": true
72
+ }
unet/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:183dee14b4011e017a2b51496c19944ed52e82682bed16ed968afa66a2011766
3
+ size 4519211976
vae/config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKL",
3
+ "_diffusers_version": "0.21.1",
4
+ "_name_or_path": "/work/base_models/original/stabilityai/stable-diffusion-xl-base-1.0/vae",
5
+ "act_fn": "silu",
6
+ "block_out_channels": [
7
+ 128,
8
+ 256,
9
+ 512,
10
+ 512
11
+ ],
12
+ "down_block_types": [
13
+ "DownEncoderBlock2D",
14
+ "DownEncoderBlock2D",
15
+ "DownEncoderBlock2D",
16
+ "DownEncoderBlock2D"
17
+ ],
18
+ "force_upcast": true,
19
+ "in_channels": 3,
20
+ "latent_channels": 4,
21
+ "layers_per_block": 2,
22
+ "norm_num_groups": 32,
23
+ "out_channels": 3,
24
+ "sample_size": 1024,
25
+ "scaling_factor": 0.13025,
26
+ "up_block_types": [
27
+ "UpDecoderBlock2D",
28
+ "UpDecoderBlock2D",
29
+ "UpDecoderBlock2D",
30
+ "UpDecoderBlock2D"
31
+ ]
32
+ }
vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2741af7e84fe3b0a7aee02f89fa34c0858ed55f5782aab5931b94938983652da
3
+ size 167335590