Instructions to use Efficient-Large-Model/Sana_1600M_1024px with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Sana
How to use Efficient-Large-Model/Sana_1600M_1024px 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_1024px") 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, ) - Inference
- Notebooks
- Google Colab
- Kaggle
how to run on ZeroGPU?
#1
by aifeifei798 - opened
how to run on ZeroGPU?
I guess use diffusers when it is ready?
import spaces
from diffusers import DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained(Efficient-Large-Model/Sana_1600M_1024px_diffusers)
pipe.to('cuda')
def generate(prompt):
return pipe(prompt).images
gr.Interface(
fn=generate,
inputs=gr.Text(),
outputs=gr.Gallery(),
).launch()
But AFAIK the diffusers pipeline stuff was still "processing"
https://github.com/huggingface/diffusers/pull/9982
hope it helps
It's merged. So should be available if you get the latest release.