readme: ---
  language: zh
  license: other
  tags:
  - MT5
  - mt5
  - text-to-text
  - zh
  - Chinese
  inference: false
  extra_gated_prompt: |-
    The 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
    
    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 Prompt Extend Model Card
  
  <!--
  ![rinna](https://github.com/rinnakk/japanese-clip/blob/master/data/rinna.png?raw=true)
  -->
  
  svjack/prompt-extend-chinese is a Chinese-specific latent text-to-text generator generating style cues given a short Chinese prompt input. This generator may make the Stable Diffusion model perform well with the help of some meaningful style cues.<br/>
  
  
  The above idea is sourced from a project named [prompt-extend](https://github.com/daspartho/prompt-extend), it extending stable diffusion English prompts with suitable style cues using text generation.
  And people can try it on [HuggingFace Space](https://huggingface.co/spaces/daspartho/prompt-extend).
  
  
  ```python
  from transformers import T5Tokenizer, MT5ForConditionalGeneration
  model = "svjack/prompt-extend-chinese"
  device = "cpu"
  tokenizer = T5Tokenizer.from_pretrained(model)
  model = MT5ForConditionalGeneration.from_pretrained(model).to(device).eval()
  prompt = "护国公克伦威尔"
  encode = tokenizer(prompt, return_tensors='pt').to(device)
  answer = model.generate(encode.input_ids)[0]
  decoded = tokenizer.decode(answer, skip_special_tokens=True)
  decoded
  '''
  的肖像,由,和,制作,在艺术站上趋势
  '''
  ```
  
  With the help of this generator, people can give some enhance to the stable diffusion model. Take [svjack/Stable-Diffusion-FineTuned-zh-v1](https://huggingface.co/svjack/Stable-Diffusion-FineTuned-zh-v1) for example. below image is the enhanced version of above.
  
  第一次世界大战
  ![第一次世界大战](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/imgs/war_v1.jpg?raw=true)
  第一次世界大战,在艺术站的潮流,8,高度详细,高质量,高分辨率,获
  ![第一次世界大战,在艺术站的潮流,8,高度详细,高质量,高分辨率,获](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/imgs/war_style_v1.jpg?raw=true)
  
  And below example is pivotal.
  
  护国公克伦威尔
  ![护国公克伦威尔](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/Protector_Cromwell.png?raw=true)
  护国公克伦威尔,的肖像,由,和,制作,在艺术站上趋势
  ![护国公克伦威尔,的肖像,由,和,制作,在艺术站上趋势](https://github.com/svjack/Stable-Diffusion-Chinese-Extend/blob/main/Protector_Cromwell_style.png?raw=true)