Buckets:
| # Ernie-Image | |
| [ERNIE-Image], 8B parametreli güçlü ve son derece verimli bir görüntü oluşturma modelidir. Şu anda yalnızca iki modelin yayınlanması planlanmaktadır: | |
| |Model|Hugging Face| | |
| |---|---| | |
| |ERNIE-Image|https://huggingface.co/baidu/ERNIE-Image| | |
| |ERNIE-Image-Turbo|https://huggingface.co/baidu/ERNIE-Image-Turbo| | |
| ## ERNIE-Image | |
| ERNIE-Image, nispeten kompakt bir mimariye ve sağlam talimat izleme yeteneğine sahip olacak şekilde tasarlanmıştır ve parametre verimliliğine vurgu yapar. 8B DiT omurgasına dayanan model, makul bir parametre verimliliğini korurken, bazı senaryolarda daha büyük (20B+) modellerle karşılaştırılabilir performans sunar. Talimat anlama ve yürütme, metin üretimi (ör. İngilizce / Çince / Japonca) ve genel istikrar konularında nispeten kararlı bir performans düzeyi sağlar. | |
| ## ERNIE-Image-Turbo | |
| ERNIE-Image-Turbo, ERNIE-Image'ın damıtılmış bir varyantıdır; yalnızca 8 NFE (Number of Function Evaluations) gerektirir ve belirli durumlarda tam modele göre nispeten karşılaştırılabilir performans sunarak daha verimli bir alternatif sağlar. | |
| ## ErnieImagePipeline | |
| Metin istemlerinden görsel üretmek için [ErnieImagePipeline] kullanın. Pipeline varsayılan olarak Prompt Enhancer (PE) destekler; bu özellik, çıktı kalitesini artırmak için kullanıcının ham istemini iyileştirir ancak talimat takibi doğruluğunu azaltabilir. | |
| 3B parametreli önceden eğitilmiş bir PE modeli sunuyoruz; ancak prompt iyileştirme için daha büyük dil modellerinin (ör. Gemini veya ChatGPT) kullanılması daha iyi sonuçlar verebilir. Sistem prompt şablonu şu adreste mevcuttur: https://huggingface.co/baidu/ERNIE-Image/blob/main/pe/chat_template.jinja. | |
| PE kullanmak istemiyorsanız, use_pe=False olarak ayarlayın. | |
| ```python | |
| import torch | |
| from diffusers import ErnieImagePipeline | |
| from diffusers.utils import load_image | |
| pipe = ErnieImagePipeline.from_pretrained("baidu/ERNIE-Image", dtype=torch.bfloat16) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| # If you are running low on GPU VRAM, you can enable offloading | |
| pipe.enable_model_cpu_offload() | |
| prompt = "一只黑白相间的中华田园犬" | |
| images = pipe( | |
| prompt=prompt, | |
| height=1024, | |
| width=1024, | |
| num_inference_steps=50, | |
| guidance_scale=4.0, | |
| generator=torch.Generator("cuda").manual_seed(42), | |
| use_pe=True, | |
| ).images | |
| images[0].save("ernie-image-output.png") | |
| ``` | |
| ```python | |
| import torch | |
| from diffusers import ErnieImagePipeline | |
| from diffusers.utils import load_image | |
| pipe = ErnieImagePipeline.from_pretrained("baidu/ERNIE-Image-Turbo", dtype=torch.bfloat16) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| # If you are running low on GPU VRAM, you can enable offloading | |
| pipe.enable_model_cpu_offload() | |
| prompt = "一只黑白相间的中华田园犬" | |
| images = pipe( | |
| prompt=prompt, | |
| height=1024, | |
| width=1024, | |
| num_inference_steps=8, | |
| guidance_scale=1.0, | |
| generator=torch.Generator("cuda").manual_seed(42), | |
| use_pe=True, | |
| ).images | |
| images[0].save("ernie-image-turbo-output.png") | |
| ``` | |
Xet Storage Details
- Size:
- 3.06 kB
- Xet hash:
- 183be0ada23d5572e43adc5f6db98d824ed0d00f2bedb5cb9847ef2d351f8fd2
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.