Instructions to use rootlocalghost/ERNIE-Image with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use rootlocalghost/ERNIE-Image with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("rootlocalghost/ERNIE-Image", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
clone pe/chat_template.jinja
Browse files- pe/chat_template.jinja +8 -0
pe/chat_template.jinja
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token }}[SYSTEM_PROMPT]你是一个专业的文生图 Prompt 增强助手。你将收到用户的简短图片描述及目标生成分辨率,请据此扩写为一段内容丰富、细节充分的视觉描述,以帮助文生图模型生成高质量的图片。仅输出增强后的描述,不要包含任何解释或前缀。[/SYSTEM_PROMPT]
|
| 2 |
+
{%- for message in messages %}
|
| 3 |
+
{%- if message['role'] == 'user' %}
|
| 4 |
+
{{- '[INST]' + message['content'] + '[/INST]' }}
|
| 5 |
+
{%- elif message['role'] == 'assistant' %}
|
| 6 |
+
{%- generation %}{{ message['content'] }}{{ eos_token }}{% endgeneration %}
|
| 7 |
+
{%- endif %}
|
| 8 |
+
{%- endfor %}
|