language: zh
license: creativeml-openrail-m
tags:
- stable-diffusion
- stable-diffusion-diffusers
- text-to-image
- zh
- Chinese
inference: true
widget:
- text: "孤帆远影碧空尽,惟见长江天际流,油画"
example_title: 孤帆远影碧空尽,惟见长江天际流,油画
- text: "日出在印象的港口来回, 唯美, 插画"
example_title: 日出在印象的港口来回, 唯美, 插画
- text: "科幻, 外星文明, 建筑, 机械感, 4k壁纸"
example_title: 科幻, 外星文明, 建筑, 机械感, 4k壁纸
- text: "东临碣石, 以观沧海, 波涛汹涌, 插画"
example_title: 东临碣石, 以观沧海, 波涛汹涌, 插画
- text: "飞流直下三千尺, 疑是银河落九天, 瀑布, 插画"
example_title: 飞流直下三千尺, 疑是银河落九天, 瀑布, 插画
- text: "女孩背影, 日落, 唯美插画"
example_title: 女孩背影, 日落, 唯美插画
extra_gated_prompt: |-
获取该模型前还需完成一步。
本模型采用CreativeML OpenRAIL-M许可证,面向所有人开放访问,进一步明确了权利与使用条款。
CreativeML OpenRAIL许可证规定:
- 禁止利用模型故意生成或传播非法及有害内容
- IDEA-CCNL对用户生成内容不主张任何权利,使用者可自由运用但须确保不违反许可证条款
- 允许商用及服务化再分发权重,但必须包含相同使用限制并向所有用户提供CreativeML OpenRAIL-M副本
完整许可证请参阅:https://huggingface.co/spaces/CompVis/stable-diffusion-license
点击下方"访问仓库"即表示同意与模型作者共享联系信息(电子邮箱和用户名)。
extra_gated_fields:
我已阅读并同意许可条款: checkbox
太乙-Stable-Diffusion-1B-中文-v0.1
简介
首个开源的中文Stable Diffusion模型,基于0.2亿筛选过的中文图文对训练。
在线体验
可通过太乙-Stable-Diffusion-中文体验模型。
模型分类
需求 |
任务 |
系列 |
模型 |
参数量 |
特性 |
特殊领域 |
多模态 |
太乙 |
Stable Diffusion |
10亿 |
中文 |
模型信息
我们采用哪吒-悟空数据集(1亿条)和零数据集(2300万条)作为预训练数据,使用IDEA-CCNL/Taiyi-CLIP-RoBERTa-102M-ViT-L-Chinese对图文相似度进行筛选(CLIP分数>0.2)。初始化文本编码器采用相同模型,冻结stable-diffusion-v1-4其他组件以保持原始生成能力,仅训练文本编码器实现中文概念对齐。模型在32张A100上训练约100小时,当前为初期版本将持续优化。
生成示例
基础提示词
铁马冰河入梦来,3D绘画 |
飞流直下三千尺,油画 |
女孩背影,日落,唯美插画 |
 |
 |
 |
进阶提示词
铁马冰河入梦来,概念画/科幻/玄幻/3D |
中国海滨城市,科幻未来感插画 |
灯火阑珊处,古风壁纸级插画 |
 |
 |
 |
使用指南
全精度模式
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1").to("cuda")
prompt = '飞流直下三千尺,油画'
image = pipe(prompt, guidance_scale=7.5).images[0]
image.save("飞流.png")
半精度FP16加速(CUDA)
添加torch_dtype=torch.float16
与device_map="auto"
启用FP16加速推理,详见优化文档。
import torch
from diffusers import StableDiffusionPipeline
torch.backends.cudnn.benchmark = True
pipe = StableDiffusionPipeline.from_pretrained("IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1", torch_dtype=torch.float16)
pipe.to('cuda')
prompt = '飞流直下三千尺,油画'
image = pipe(prompt, guidance_scale=7.5).images[0]
image.save("飞流.png")
太乙使用手册
https://github.com/IDEA-CCNL/Fengshenbang-LM/blob/main/fengshen/examples/stable_diffusion_chinese/taiyi_handbook.md
微调教程
https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/main/fengshen/examples/finetune_taiyi_stable_diffusion
WebUI配置
https://github.com/IDEA-CCNL/stable-diffusion-webui/blob/master/README.md
DreamBooth微调
https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/main/fengshen/examples/stable_diffusion_dreambooth
引用文献
若使用本模型,请引用我们的总论文:
@article{fengshenbang,
author = {张嘉旭等},
title = {封神榜1.0:中文认知智能基础体系},
journal = {CoRR},
volume = {abs/2209.02970},
year = {2022}
}
或引用项目主页:
@misc{封神榜-LM,
title={封神榜大语言模型},
author={IDEA-CCNL},
year={2021},
howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
}