Chinese Stable Diffusion Prompt Extend Model Card
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.
The above idea is sourced from a project named prompt-extend, it extending stable diffusion English prompts with suitable style cues using text generation. And people can try it on HuggingFace Space.
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 for example. below image is the enhanced version of above.
第一次世界大战 第一次世界大战,在艺术站的潮流,8,高度详细,高质量,高分辨率,获
And below example is pivotal.
- Downloads last month
- 11
Inference API (serverless) has been turned off for this model.