From 959a182d354d67108ae6674165d06d0e78e447ea Mon Sep 17 00:00:00 2001 From: Zhaoxi Chen <35674081+FrozenBurning@users.noreply.github.com> Date: Thu, 19 Sep 2024 20:52:48 +0800 Subject: [PATCH] add 3DTopia-XL as library (#910) Library name `3dtopia-xl` has been added in the repo 3DTopia-XL for 3D generation https://huggingface.co/FrozenBurning/3DTopia-XL This PR will allow automatic download stats on `*.pt` files in the repo together with code snippets on how to use them. --------- Co-authored-by: vb Co-authored-by: Lucain Co-authored-by: Lucain --- packages/tasks/src/model-libraries-snippets.ts | 7 +++++++ packages/tasks/src/model-libraries.ts | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index 876cc2a93..0852e21a6 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -1007,4 +1007,11 @@ whisperkit-cli transcribe --audio-path /path/to/audio.mp3 # Or use your preferred model variant whisperkit-cli transcribe --model "large-v3" --model-prefix "distil" --audio-path /path/to/audio.mp3 --verbose`, ]; + +export const threedtopia_xl = (model: ModelData): string[] => [ + `from threedtopia_xl.models import threedtopia_xl + +model = threedtopia_xl.from_pretrained("${model.id}") +model.generate(cond="path/to/image.png")`, +]; //#endregion diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index 2af801ace..c5d558a2a 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -700,6 +700,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { snippets: snippets.whisperkit, countDownloads: `path_filename:"model" AND path_extension:"mil" AND _exists_:"path_prefix"`, }, + "3dtopia-xl": { + prettyLabel: "3DTopia-XL", + repoName: "3DTopia-XL", + repoUrl: "https://github.com/3DTopia/3DTopia-XL", + filter: false, + countDownloads: `path:"model_vae_fp16.pt"`, + snippets: snippets.threedtopia_xl, + }, } satisfies Record; export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;