--- language: zh license: other tags: - stable-diffusion - stable-diffusion-diffusers - text-to-image - zh - Chinese inference: false extra_gated_prompt: |- One more step before getting this model. This model is open access and available to all, with a CreativeML OpenRAIL-M license further specifying rights and usage. The CreativeML OpenRAIL License specifies: 1. You can't use the model to deliberately produce nor share illegal or harmful outputs or content 2. rinna Co., Ltd. claims 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 the license 3. You may re-distribute the weights and use the model commercially and/or as a service. If you do, please be aware you have to include the same use restrictions as the ones in the license and share a copy of the CreativeML OpenRAIL-M to all your users (please read the license entirely and carefully) Please read the full license here: https://huggingface.co/spaces/CompVis/stable-diffusion-license By clicking on "Access repository" below, you accept that your *contact information* (email address and username) can be shared with the model authors as well. extra_gated_fields: I have read the License and agree with its terms: checkbox --- # Chinese Stable Diffusion Model Card svjack/Stable-Diffusion-FineTuned-zh-v0 is a Chinese-specific latent text-to-image diffusion model capable of generating images given any Chinese text input. This model was trained by using a powerful text-to-image model, [diffusers](https://github.com/huggingface/diffusers) For more information about our training method, see [train_zh_model.py](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/train_zh_model.py). With the help of a good baseline model [Taiyi-Stable-Diffusion-1B-Chinese-v0.1](IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1) from [IDEA-CCNL](https://github.com/IDEA-CCNL/Fengshenbang-LM) ## Model Details - **Developed by:** Zhipeng Yang - **Model type:** Diffusion-based text-to-image generation model - **Language(s):** Chinese - **License:** [The CreativeML OpenRAIL M license](https://huggingface.co/spaces/CompVis/stable-diffusion-license) is an [Open RAIL M license](https://www.licenses.ai/blog/2022/8/18/naming-convention-of-responsible-ai-licenses), adapted from the work that [BigScience](https://bigscience.huggingface.co/) and [the RAIL Initiative](https://www.licenses.ai/) are jointly carrying in the area of responsible AI licensing. See also [the article about the BLOOM Open RAIL license](https://bigscience.huggingface.co/blog/the-bigscience-rail-license) on which our license is based. - **Model Description:** This is a model that can be used to generate and modify images based on text prompts. It is a [Latent Diffusion Model (LDM)](https://arxiv.org/abs/2112.10752) that used [Stable Diffusion](https://github.com/CompVis/stable-diffusion) as a pre-trained model. - **Resources for more information:** [https://github.com/svjack/Stable-Diffusion-Chinese-Extend](https://github.com/svjack/Stable-Diffusion-Chinese-Extend) ## Examples Firstly, install our package as follows. This package is modified [🤗's Diffusers library](https://github.com/huggingface/diffusers) to run Chinese Stable Diffusion. ```bash diffusers==0.6.0 transformers torch datasets accelerate sentencepiece ``` Run this command to log in with your HF Hub token if you haven't before: ```bash huggingface-cli login ``` Running the pipeline with the LMSDiscreteScheduler scheduler: ```python from diffusers import StableDiffusionPipeline pipeline = StableDiffusionPipeline.from_pretrained("svjack/Stable-Diffusion-FineTuned-zh-v0") pipeline.safety_checker = lambda images, clip_input: (images, False) pipeline = pipeline.to("cuda") prompt = '女孩们打开了另一世界的大门' image = pipeline(prompt, guidance_scale=7.5).images[0] ``` ### Generator Results comparison [https://github.com/svjack/Stable-Diffusion-Chinese-Extend](https://github.com/svjack/Stable-Diffusion-Chinese-Extend) ![0](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/imgs/dragon_v0.jpg?raw=true) ![1](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/imgs/dragon_style_v0.jpg?raw=true) ![2](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/imgs/girl_v0.jpg?raw=true) ![3](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/imgs/girl_style_v0.jpg?raw=true)