BAAI / AltDiffusion-m18

huggingface.co
Total runs: 54
24-hour runs: -1
7-day runs: 20
30-day runs: 35
Model's Last Updated: October 02 2023

Introduction of AltDiffusion-m18

Model Details of AltDiffusion-m18

AltDiffusion

名称 Name 任务 Task 语言 Language(s) 模型 Model Github
AltDiffusion-m18 多模态 Multimodal Multilingual Stable Diffusion FlagAI
模型信息

AltDiffusion-m18 是一种基于@StableDiffusion 的多语言文本图像生成模型。该模型由 Stability AI 和@BAAI FlagAI 团队合作完成(FlagAI 是 LF AI & Data Foundation 的沙盒阶段项目)。AltDiffusion-m18目前支持 18 种语言,包含:英语、中文、日语、泰语、韩语、印地语、乌克兰语、阿拉伯语、土耳其语、越南语、波兰语、荷兰语、葡萄牙语、意大利语、西班牙语、德语、法语和俄语。

AltDiffusion-m18 is a multilingual text-image generation model built on @StableDiffusion. This model is a collaboration between Stability AI & @BAAI FlagAI team (FlagAI is a sandbox-stage project of LF AI & Data Foundation). AltDiffusion-m18 currently supports 18 languages, including English, Chinese, Japanese, Thai, Korean, Hindi, Ukrainian, Arabic, Turkish, Vietnamese, Polish, Dutch, Portuguese, Italian, Spanish, German, French, and Russian.

训练方法

如图1,所示训练分为两个阶段:概念对齐阶段和效果提升阶段。我们首先替换使用多语言CLIP AltCLIP-m18替换掉原始SD的OpenCLIP, 之后冻住AltCLIP的参数。在第一阶段中,使用256*256的图片分辨率,训练Unet中CrossAttention层的k,v矩阵进行文图的概念对齐。在第二阶段中,使用512*512的图片分辨率,训练Unet的所有参数进行生成效果的提升。

As shown in Figure 1, the training process consists of two stages: concept alignment and quality improvement. We first replaced the original OpenCLIP in SD with the multilingual CLIP AltCLIP-m18 and froze its parameters. In the first stage, we trained the k,v matrices in the CrossAttention layer of the Unet model to align the concepts between text and image using 256*256 image resolution. In the second stage, we trained all the parameters in the Unet model to improve the generation performance using 512*512 image resolution.

illustrate for AltDiffusion

图1: AltDiffusion示意图 (Fig.1: illustrate for AltDiffusion)
数据使用

在第一阶段中,我们使用 LAION 5B 中的LAION 5B-en(2.32B) 和 过滤的18语言 LAION 5B-multi(1.8B)数据进行训练。在第二阶段中,我们使用 LAION Aesthetics V1 中的LAION Aesthetics V1-en(52M) 和 过滤的18语言 LAION Aesthetics V1-multi(46M)数据进行训练。

In the first stage, we trained the model using LAION 5B-en(2.32B) from LAION 5B and filtered LAION 5B-multi(1.8B) data for the 18 languages. In the second stage, we trained the model using LAION Aesthetics V1-en(52M) from LAION Aesthetics V1 and filtered LAION Aesthetics V1-multi(46M) data for the 18 languages.

训练细节

优化器:AdamW

学习率:1e-4 并带有10k步的warmup

显卡:64 张 NVIDIA A100-SXM4-40GB 第一阶段,从SD v2.1 512-base-ema开始,以batch size 3072在256*256的分辨率上使用64张A100训练330k步,耗时8天;第二阶段,从第一阶段330k的checkpoint开始,以batch size 3840在512*512的分辨率上使用64张A100训练270k步,耗时7天。然后,基于270k的checkpoint随机丢掉10%的文本进行150k步的classifier-free guidance训练,耗时4天。

The first stage involved using the SD v2.1 512-base-ema checkpoint to initialize all parameters except for the language model, with a batch size of 3072 and a resolution of 256x256 for training on LAION2B en and LAION2Bmulti for 330k steps over approximately 8 days. In the second stage, training began from the 330k step checkpoint, with a batch size of 3840 on LAION Aesthetics V1-en and V1-multi, and training for 270k steps with a resolution of 512x512, taking around 7 days. Training then continued from the 270k step checkpoint for another 150k steps, with 10% of the text randomly discarded for classifierfree guidance learning, taking approximately 4 days. The teacher model of AltCLIP is OpenCLIP ViT-H-14(version is ”laion2b s32b b79k”). The pretrained Stable Diffusion checkpoint we used is SD v2.1 512-base-ema. We also use Xformer and Efficient Attention to save memory use and speed up training. The decay of EMA is 0.9999.

效果展示
18语言效果

boy

corgi_dog

中文效果

chinese_samples

长图效果

long1

long2

参考

--Stability AI: https://stability.ai/

--FlagAI: https://github.com/FlagAI-Open/FlagAI

--Stable Diffusion: https://huggingface.co/spaces/stabilityai/stable-diffusion

模型参数量/Number of Model Parameters

模块名称 Module Name 参数量 Number of Parameters
AutoEncoder 83.7M
Unet 866M
AltCLIP-m18 TextEncoder 1.19B

引用/Citation

Please cite our paper if you find it helpful :)

@misc{ye2023altdiffusion,
      title={AltDiffusion: A Multilingual Text-to-Image Diffusion Model}, 
      author={Fulong Ye and Guang Liu and Xinya Wu and Ledell Wu},
      year={2023},
      eprint={2308.09991},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

许可/License

该模型通过 CreativeML Open RAIL-M license 获得许可。作者对您生成的输出不主张任何权利,您可以自由使用它们并对它们的使用负责,不得违反本许可中的规定。该许可证禁止您分享任何违反任何法律、对他人造成伤害、传播任何可能造成伤害的个人信息、传播错误信息和针对弱势群体的任何内容。您可以出于商业目的修改和使用模型,但必须包含相同使用限制的副本。有关限制的完整列表,请 阅读许可证

The model is licensed with a CreativeML Open RAIL-M license . The authors claim no rights on the outputs you generate, you are free to use them and are accountable for their use which must not go against the provisions set in this license. The license forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation and target vulnerable groups. You can modify and use the model for commercial purposes, but a copy of the same use restrictions must be included. For the full list of restrictions please read the license .

Runs of BAAI AltDiffusion-m18 on huggingface.co

54
Total runs
-1
24-hour runs
19
3-day runs
20
7-day runs
35
30-day runs

More Information About AltDiffusion-m18 huggingface.co Model

AltDiffusion-m18 huggingface.co

AltDiffusion-m18 huggingface.co is an AI model on huggingface.co that provides AltDiffusion-m18's model effect (), which can be used instantly with this BAAI AltDiffusion-m18 model. huggingface.co supports a free trial of the AltDiffusion-m18 model, and also provides paid use of the AltDiffusion-m18. Support call AltDiffusion-m18 model through api, including Node.js, Python, http.

AltDiffusion-m18 huggingface.co Url

https://huggingface.co/BAAI/AltDiffusion-m18

BAAI AltDiffusion-m18 online free

AltDiffusion-m18 huggingface.co is an online trial and call api platform, which integrates AltDiffusion-m18's modeling effects, including api services, and provides a free online trial of AltDiffusion-m18, you can try AltDiffusion-m18 online for free by clicking the link below.

BAAI AltDiffusion-m18 online free url in huggingface.co:

https://huggingface.co/BAAI/AltDiffusion-m18

AltDiffusion-m18 install

AltDiffusion-m18 is an open source model from GitHub that offers a free installation service, and any user can find AltDiffusion-m18 on GitHub to install. At the same time, huggingface.co provides the effect of AltDiffusion-m18 install, users can directly use AltDiffusion-m18 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

AltDiffusion-m18 install url in huggingface.co:

https://huggingface.co/BAAI/AltDiffusion-m18

Url of AltDiffusion-m18

AltDiffusion-m18 huggingface.co Url

Provider of AltDiffusion-m18 huggingface.co

BAAI
ORGANIZATIONS

Other API from BAAI

huggingface.co

Total runs: 2.2M
Run Growth: -2.1M
Growth Rate: -95.77%
Updated: February 21 2024
huggingface.co

Total runs: 2.1M
Run Growth: 28.0K
Growth Rate: 1.36%
Updated: July 03 2024
huggingface.co

Total runs: 1.6M
Run Growth: -57.4K
Growth Rate: -3.60%
Updated: February 21 2024
huggingface.co

Total runs: 954.2K
Run Growth: 637.5K
Growth Rate: 66.81%
Updated: April 02 2024
huggingface.co

Total runs: 759.4K
Run Growth: 141.1K
Growth Rate: 18.58%
Updated: December 13 2023
huggingface.co

Total runs: 463.7K
Run Growth: 72.5K
Growth Rate: 15.64%
Updated: October 12 2023
huggingface.co

Total runs: 152.3K
Run Growth: -20.2K
Growth Rate: -13.28%
Updated: November 14 2023
huggingface.co

Total runs: 139.5K
Run Growth: 44.8K
Growth Rate: 32.14%
Updated: October 12 2023
huggingface.co

Total runs: 67.5K
Run Growth: 6.3K
Growth Rate: 9.29%
Updated: April 17 2024
huggingface.co

Total runs: 32.6K
Run Growth: 30.8K
Growth Rate: 94.65%
Updated: October 12 2023
huggingface.co

Total runs: 27.2K
Run Growth: 11.9K
Growth Rate: 43.86%
Updated: October 12 2023
huggingface.co

Total runs: 20.8K
Run Growth: 4.1K
Growth Rate: 19.85%
Updated: January 15 2025
huggingface.co

Total runs: 5.5K
Run Growth: -421
Growth Rate: -7.64%
Updated: February 22 2024
huggingface.co

Total runs: 5.2K
Run Growth: 1.6K
Growth Rate: 31.29%
Updated: September 21 2023
huggingface.co

Total runs: 5.1K
Run Growth: 1.4K
Growth Rate: 26.53%
Updated: August 15 2024
huggingface.co

Total runs: 3.4K
Run Growth: -3.0K
Growth Rate: -89.70%
Updated: December 26 2022
huggingface.co

Total runs: 3.2K
Run Growth: 450
Growth Rate: 14.23%
Updated: October 12 2023
huggingface.co

Total runs: 2.9K
Run Growth: 1.4K
Growth Rate: 47.13%
Updated: August 15 2024
huggingface.co

Total runs: 2.3K
Run Growth: 966
Growth Rate: 41.48%
Updated: February 07 2024
huggingface.co

Total runs: 2.2K
Run Growth: -11.8K
Growth Rate: -272.27%
Updated: October 23 2024
huggingface.co

Total runs: 1.8K
Run Growth: 451
Growth Rate: 24.73%
Updated: September 18 2023
huggingface.co

Total runs: 1.6K
Run Growth: -3.5K
Growth Rate: -136.57%
Updated: October 23 2024
huggingface.co

Total runs: 1.5K
Run Growth: -366
Growth Rate: -24.93%
Updated: November 28 2024
huggingface.co

Total runs: 1.4K
Run Growth: -3.0K
Growth Rate: -174.67%
Updated: October 24 2024
huggingface.co

Total runs: 1.0K
Run Growth: 884
Growth Rate: 87.87%
Updated: April 02 2024
huggingface.co

Total runs: 734
Run Growth: 374
Growth Rate: 50.95%
Updated: October 27 2023
huggingface.co

Total runs: 715
Run Growth: 0
Growth Rate: 0.00%
Updated: January 15 2025
huggingface.co

Total runs: 708
Run Growth: -313
Growth Rate: -44.21%
Updated: March 07 2024
huggingface.co

Total runs: 571
Run Growth: -90
Growth Rate: -15.76%
Updated: June 07 2024
huggingface.co

Total runs: 455
Run Growth: 0
Growth Rate: 0.00%
Updated: January 14 2025
huggingface.co

Total runs: 324
Run Growth: 322
Growth Rate: 99.38%
Updated: April 18 2023
huggingface.co

Total runs: 153
Run Growth: -99
Growth Rate: -64.71%
Updated: August 15 2024
huggingface.co

Total runs: 145
Run Growth: 25
Growth Rate: 17.24%
Updated: June 24 2024
huggingface.co

Total runs: 129
Run Growth: -65
Growth Rate: -62.50%
Updated: April 19 2024
huggingface.co

Total runs: 118
Run Growth: 81
Growth Rate: 68.64%
Updated: August 23 2023
huggingface.co

Total runs: 114
Run Growth: 0
Growth Rate: 0.00%
Updated: January 20 2025
huggingface.co

Total runs: 96
Run Growth: 9
Growth Rate: 9.38%
Updated: December 21 2023
huggingface.co

Total runs: 87
Run Growth: 56
Growth Rate: 64.37%
Updated: August 23 2023
huggingface.co

Total runs: 58
Run Growth: -162
Growth Rate: -279.31%
Updated: June 21 2024
huggingface.co

Total runs: 44
Run Growth: -41
Growth Rate: -93.18%
Updated: December 21 2023
huggingface.co

Total runs: 34
Run Growth: -25
Growth Rate: -73.53%
Updated: August 15 2024
huggingface.co

Total runs: 34
Run Growth: -225
Growth Rate: -661.76%
Updated: June 24 2024
huggingface.co

Total runs: 33
Run Growth: -59
Growth Rate: -178.79%
Updated: August 15 2024
huggingface.co

Total runs: 33
Run Growth: 0
Growth Rate: 0.00%
Updated: January 01 2025
huggingface.co

Total runs: 30
Run Growth: 20
Growth Rate: 66.67%
Updated: July 24 2023
huggingface.co

Total runs: 29
Run Growth: -11
Growth Rate: -37.93%
Updated: December 31 2022
huggingface.co

Total runs: 27
Run Growth: -955
Growth Rate: -3537.04%
Updated: February 07 2024
huggingface.co

Total runs: 26
Run Growth: -18
Growth Rate: -69.23%
Updated: August 28 2024
huggingface.co

Total runs: 19
Run Growth: -103
Growth Rate: -542.11%
Updated: May 13 2024
huggingface.co

Total runs: 17
Run Growth: -19
Growth Rate: -111.76%
Updated: July 02 2024
huggingface.co

Total runs: 16
Run Growth: -40
Growth Rate: -250.00%
Updated: May 31 2024