Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sana .pth files into download counting in huggingface repo #1061

Merged
merged 12 commits into from
Dec 5, 2024
20 changes: 20 additions & 0 deletions packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,26 @@ IWorker engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model);
`,
];

export const sana = (model: ModelData): string[] => [
lawrence-cj marked this conversation as resolved.
Show resolved Hide resolved
Wauplin marked this conversation as resolved.
Show resolved Hide resolved
`
Wauplin marked this conversation as resolved.
Show resolved Hide resolved
# 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://${model.id}")

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,
) `,
];

export const vfimamba = (model: ModelData): string[] => [
`from Trainer_finetune import Model

Expand Down
7 changes: 7 additions & 0 deletions packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
filter: true,
countDownloads: `path_extension:"sentis"`,
},
sana: {
prettyLabel: "Sana",
repoName: "Sana",
repoUrl: "https://github.com/NVlabs/Sana",
countDownloads: `path_extension:"pth"`,
snippets: snippets.sana,
},
"vfi-mamba": {
prettyLabel: "VFIMamba",
repoName: "VFIMamba",
Expand Down
Loading