Instructions to use Efficient-Large-Model/Sana_1600M_4Kpx_BF16_diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Sana
How to use Efficient-Large-Model/Sana_1600M_4Kpx_BF16_diffusers with Sana:
# Load the model and infer image from text import torch from app.sana_pipeline import SanaPipeline from torchvision.utils import save_image sana = SanaPipeline("configs/sana_config/1024ms/Sana_1600M_img1024.yaml") sana.from_pretrained("hf://Efficient-Large-Model/Sana_1600M_4Kpx_BF16_diffusers") image = sana( prompt='a cyberpunk cat with a neon sign that says "Sana"', height=1024, width=1024, guidance_scale=5.0, pag_guidance_scale=2.0, num_inference_steps=18, ) - Notebooks
- Google Colab
- Kaggle
Some weight files are duplicate
Those file are exactly the same. I don't get why.
MD5, file_path
597c24855313598cb26066d28006596d ./text_encoder/model-00001-of-00002.safetensors
597c24855313598cb26066d28006596d ./text_encoder/model.bf16-00001-of-00002.safetensors
b16329d04bd0ce6f2a524e5bf8ef5908 ./vae/diffusion_pytorch_model.bf16.safetensors
b16329d04bd0ce6f2a524e5bf8ef5908 ./vae/diffusion_pytorch_model.safetensors
bf07c46c7021d3def62bfad765af1222 ./text_encoder/model-00002-of-00002.safetensors
bf07c46c7021d3def62bfad765af1222 ./text_encoder/model.bf16-00002-of-00002.safetensors
It is because of something to do with how the pipeline.from_pretrained(variant = "bf16") works. When the variant is specified, all the safetensors files being loaded must have the variant string in the name. If you just run the provided code as is, only the files corresponding to the specified variant will be downloaded and used.