闲社服务运行正常AI智能体自动化平台

AltDiffusion

BAAI/AltDiffusion

发布机构BAAI

下载访问条件魔搭来源

名称 Name 任务 Task 语言 Language(s) 模型 Model Github AltDiffusion 多模态 Multimodal 中英文 Chinese&English Stable Diffusion FlagAI We support a Gradio Web UI to run AltDiffusion:

图文理解图片生成
模型详情

模型介绍

中文整理

AltDiffusion

名称 Name 任务 Task 语言 Language(s) 模型 Model Github

:----------: :----: :-------------------: :----: :------:

AltDiffusion 多模态 Multimodal 中英文 Chinese&English Stable Diffusion FlagAI

Gradio

We support a Gradio Web UI to run AltDiffusion:

[](https://huggingface.co/spaces/BAAI/bilingual stable diffusion)

模型信息 Model Information

我们使用 AltCLIP,基于 Stable Diffusion 训练了双语Diffusion模型,训练数据来自 WuDao数据集 和 LAION 。

我们的版本在中英文对齐方面表现非常出色,是目前市面上开源的最强版本,保留了原版stable diffusion的大部分能力,并且在某些例子上比有着比原版模型更出色的能力。

AltDiffusion 模型由名为 AltCLIP 的双语 CLIP 模型支持,该模型也可在本项目中访问。您可以阅读 此教程 了解更多信息。

AltDiffusion支持线上演示,点击 这里 在线试玩!

We used AltCLIP, and trained a bilingual Diffusion model based on Stable Diffusion, with training data from WuDao dataset and LAION.

Our model performs well in aligning Chinese and English, and is the strongest open source version on the market today, retaining most of the stable diffusion capabilities of the original, and in some cases even better than the original model.

AltDiffusion model is backed by a bilingual CLIP model named AltCLIP, which is also accessible in FlagAI. You can read this tutorial for more information.

AltDiffusion now supports online demo, try out it by clicking here!

引用

关于AltCLIP,我们已经推出了相关报告,有更多细节可以查阅,如对您的工作有帮助,欢迎引用。

If you find this work helpful, please consider to cite

模型权重 Model Weights

第一次运行AltDiffusion模型时会自动从 这里 下载如下权重,

The following weights are automatically downloaded from here when the AltDiffusion model is run for the first time:

模型名称 Model name 大小 Size 描述 Description

  • ----------------------------- --------- -------------------------------------------------------

StableDiffusionSafetyChecker 1.13G 图片的安全检查器;Safety checker for image

AltDiffusion 8.0G 我们的双语AltDiffusion模型; Our bilingual AltDiffusion model

AltCLIP 3.22G 我们的双语AltCLIP模型;Our bilingual AltCLIP model

示例 Example

🧨Diffusers Example

AltDiffusion** 已被添加到 🧨Diffusers!

我们的代码示例已放到colab上,欢迎使用。

您可以在 此处 查看文档页面。

以下示例将使用fast DPM 调度程序生成图像, 在V100 上耗时大约为 2 秒。

You can run our diffusers example through here in colab.

You can see the documentation page here.

The following example will use the fast DPM scheduler to generate an image in ca. 2 seconds on a V100.

First you should install diffusers main branch and some dependencies:

then you can run the following example:

Transformers Example

您可以在 predict generate images 函数里通过改变参数来调整设置,具体信息如下:

More parameters of predict generate images for you to adjust for predict generate images are listed below:

参数名 Parameter 类型 Type 描述 Description

  • ------------------------------- ------------ -------------------------------------------------------

prompt str 提示文本; The prompt text

out path str 输出路径; The output path to save images

n samples int 输出图片数量; Number of images to be generate

skip grid bool 如果为True, 会将所有图片拼接在一起,输出一张新的图片; If set to true, image gridding step will be skipped

ddim step int DDIM模型的步数; Number of steps in ddim model

plms bool 如果为True, 则会使用plms模型; If set to true, PLMS Sampler instead of DDIM Sampler will be applied

scale float 这个值决定了文本在多大程度上影响生成的图片,值越大影响力越强; This value determines how important the prompt incluences generate images

H int 图片的高度; Height of image

W int 图片的宽度; Width of image

C int 图片的channel数; Numeber of channels of generated images

seed int 随机种子; Random seed number

注意:模型推理要求一张至少10G以上的GPU。

Note that the model inference requires a GPU of at least 10G above.

更多生成结果 More Results

中英文对齐能力 Chinese and English alignment ability

prompt:dark elf princess, highly detailed, d & d, fantasy, highly detailed, digital painting, trending on artstation, concept art, sharp focus, illustration, art by artgerm and greg rutkowski and fuji choko and viktoria gavrilenko and hoang lap

英文生成结果/Generated results from English prompts

prompt:黑暗精灵公主,非常详细,幻想,非常详细,数字绘画,概念艺术,敏锐的焦点,插图

中文生成结果/Generated results from Chinese prompts

中文表现能力/The performance for Chinese prompts

prompt:带墨镜的男孩肖像,充满细节,8K高?

prompt:带墨镜的中国男孩肖像,充满细节,8K高?

长图生成能力/The ability to generate long images

prompt: 一只带着帽子的小狗

原版 stable diffusion:

Ours:

注: 此处长图生成技术由右脑科技(RightBrain AI)提供。

Note: The long image generation technology here is provided by Right Brain Technology.

模型参数量/Number of Model Parameters

模块名称 Module Name 参数量 Number of Parameters

  • ----------------------------- ------------------

AutoEncoder 83.7M

Unet 865M

AltCLIP TextEncoder 859M

引用/Citation

Please cite our paper if you find it helpful :)

许可/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 .

优先采用原作者提供的中文模型卡片;仅有英文说明时由闲社AI翻译整理。重要参数、许可证和商用范围请以原文为准。

你将获得什么

完整仓库方式包含该固定版本中的权重、配置、分词器及说明文件;指定版本方式只下载所选文件或整组分片。多模态模型的投影文件、配置等依赖,请按作者说明配齐。

完整仓库可能包含多个权重格式,因此需要的磁盘空间可能大于单一格式的模型大小。下载文件不等于完成模型部署。

使用前须知

运行环境

运行模型需要的设备、工具与依赖,以原作者说明为准。

授权范围

是否允许商用、修改和分发,请查看模型许可证。

闲社提供资料与镜像下载方法,不代表已运行模型或完成安全审计。下载的代码应先检查,再执行。

返回顶部