diff --git a/.gitignore b/.gitignore index 66318e2..ea1ab45 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,19 @@ videos *.egg-info .gradio weights/* -__pycache__ \ No newline at end of file +__pycache__ + +# Pinokio launcher dynamic files +app/ +env/ +workflows/ +node_modules/ +.DS_Store +cache/ + +# Model files (downloaded separately) +*.safetensors +*.ckpt +*.pt +*.pth +*.bin \ No newline at end of file diff --git a/README.md b/README.md index a3507fc..f20d962 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ conda install -c conda-forge libiconv ### Download Wan 2.1 I2V 14B ```bash -huggingface-cli download Wan-AI/Wan2.1-I2V-14B-480P --local-dir ./weights/Wan2.1-I2V-14B-480P +hf download Wan-AI/Wan2.1-I2V-14B-480P --local-dir ./weights/Wan2.1-I2V-14B-480P ``` ### Download SVI Family @@ -359,7 +359,7 @@ For this model, you can try the sample in [100-prompt-sample](data/toy_test/svi_ ```bash # This uses the SVI-Shot inference script and workflow, supporting both 5 and 1 motion frames -huggingface-cli download vita-video-gen/svi-model version-2.0/SVI_Wan2.1-I2V-14B_lora_v2.0.safetensors --local-dir ./weights/Stable-Video-Infinity +hf download vita-video-gen/svi-model version-2.0/SVI_Wan2.1-I2V-14B_lora_v2.0.safetensors --local-dir ./weights/Stable-Video-Infinity ``` @@ -367,30 +367,30 @@ huggingface-cli download vita-video-gen/svi-model version-2.0/SVI_Wan2.1-I2V-14B ### SVI-1.0 ```bash # login with your fine-grained token -huggingface-cli login +hf login # Option 1: Download SVI Family bucket! -huggingface-cli download vita-video-gen/svi-model --local-dir ./weights/Stable-Video-Infinity --include "version-1.0/*" +hf download vita-video-gen/svi-model --local-dir ./weights/Stable-Video-Infinity --include "version-1.0/*" # Option 2: Download individual models -# huggingface-cli download vita-video-gen/svi-model version-1.0/svi-shot.safetensors --local-dir ./weights/Stable-Video-Infinity -# huggingface-cli download vita-video-gen/svi-model version-1.0/svi-film-opt-10212025.safetensors --local-dir ./weights/Stable-Video-Infinity -# huggingface-cli download vita-video-gen/svi-model version-1.0/svi-film.safetensors --local-dir ./weights/Stable-Video-Infinity -# huggingface-cli download vita-video-gen/svi-model version-1.0/svi-film-transitions.safetensors --local-dir ./weights/Stable-Video-Infinity -# huggingface-cli download vita-video-gen/svi-model version-1.0/svi-tom.safetensors --local-dir ./weights/Stable-Video-Infinity -# huggingface-cli download vita-video-gen/svi-model version-1.0/svi-talk.safetensors --local-dir ./weights/Stable-Video-Infinity -# huggingface-cli download vita-video-gen/svi-model version-1.0/svi-dance.safetensors --local-dir ./weights/Stable-Video-Infinity +# hf download vita-video-gen/svi-model version-1.0/svi-shot.safetensors --local-dir ./weights/Stable-Video-Infinity +# hf download vita-video-gen/svi-model version-1.0/svi-film-opt-10212025.safetensors --local-dir ./weights/Stable-Video-Infinity +# hf download vita-video-gen/svi-model version-1.0/svi-film.safetensors --local-dir ./weights/Stable-Video-Infinity +# hf download vita-video-gen/svi-model version-1.0/svi-film-transitions.safetensors --local-dir ./weights/Stable-Video-Infinity +# hf download vita-video-gen/svi-model version-1.0/svi-tom.safetensors --local-dir ./weights/Stable-Video-Infinity +# hf download vita-video-gen/svi-model version-1.0/svi-talk.safetensors --local-dir ./weights/Stable-Video-Infinity +# hf download vita-video-gen/svi-model version-1.0/svi-dance.safetensors --local-dir ./weights/Stable-Video-Infinity ``` ### Download Multitalk Cross-Attention for SVI-Talk Training/Test ```bash # Download audio encoder -huggingface-cli download TencentGameMate/chinese-wav2vec2-base --local-dir ./weights/chinese-wav2vec2-base -huggingface-cli download TencentGameMate/chinese-wav2vec2-base model.safetensors --revision refs/pr/1 --local-dir ./weights/chinese-wav2vec2-base +hf download TencentGameMate/chinese-wav2vec2-base --local-dir ./weights/chinese-wav2vec2-base +hf download TencentGameMate/chinese-wav2vec2-base model.safetensors --revision refs/pr/1 --local-dir ./weights/chinese-wav2vec2-base # Download multitalk weight -huggingface-cli download MeiGen-AI/MeiGen-MultiTalk --local-dir ./weights/MeiGen-MultiTalk +hf download MeiGen-AI/MeiGen-MultiTalk --local-dir ./weights/MeiGen-MultiTalk # Link Multitalk ln -s $PWD/weights/MeiGen-MultiTalk/multitalk.safetensors weights/Wan2.1-I2V-14B-480P/ @@ -399,7 +399,7 @@ ln -s $PWD/weights/MeiGen-MultiTalk/multitalk.safetensors weights/Wan2.1-I2V-14B ### Download UniAnimate-DiT LoRA for SVI-Dance Training ```bash -huggingface-cli download ZheWang123/UniAnimate-DiT --local-dir ./weights/UniAnimate-DiT +hf download ZheWang123/UniAnimate-DiT --local-dir ./weights/UniAnimate-DiT ``` ### Check Model @@ -561,7 +561,7 @@ The following is the training data we used for SVI family. | **Human Dancing** | Train | [🤗 Dataset](https://www.kaggle.com/datasets/yasaminjafarian/tiktokdataset) | TikTok | ```bash -huggingface-cli download --repo-type dataset vita-video-gen/svi-benchmark --local-dir ./data/svi-benchmark +hf download --repo-type dataset vita-video-gen/svi-benchmark --local-dir ./data/svi-benchmark ``` ## 📋 TODO List diff --git a/download-svi-lora.js b/download-svi-lora.js new file mode 100644 index 0000000..1c0467f --- /dev/null +++ b/download-svi-lora.js @@ -0,0 +1,12 @@ +module.exports = { + run: [{ + method: "shell.run", + params: { + venv: "env", + message: [ + "hf download vita-video-gen/svi-model --include \"version-2.0/*\" --local-dir models/loras/SVI-LoRA" + ], + path: "app" + } + }] +} diff --git a/download-wan21-i2v-14b.js b/download-wan21-i2v-14b.js new file mode 100644 index 0000000..cdf684a --- /dev/null +++ b/download-wan21-i2v-14b.js @@ -0,0 +1,12 @@ +module.exports = { + run: [{ + method: "shell.run", + params: { + venv: "env", + message: [ + "hf download Wan-AI/Wan2.1-I2V-14B-480P --local-dir models/diffusers/Wan2.1-I2V-14B-480P" + ], + path: "app" + } + }] +} diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..1b74e8b Binary files /dev/null and b/icon.png differ diff --git a/install.js b/install.js new file mode 100644 index 0000000..a8a969d --- /dev/null +++ b/install.js @@ -0,0 +1,130 @@ +module.exports = { + run: [ + // Clone ComfyUI + { + method: "shell.run", + params: { + message: [ + "git clone https://github.com/comfyanonymous/ComfyUI app", + ] + } + }, + // Clone ComfyUI-Manager + { + method: "shell.run", + params: { + message: [ + "git clone https://github.com/ltdrdata/ComfyUI-Manager", + ], + path: "app/custom_nodes" + } + }, + // Clone ComfyUI-WanVideoWrapper (required for SVI) + { + method: "shell.run", + params: { + message: [ + "git clone https://github.com/kijai/ComfyUI-WanVideoWrapper", + ], + path: "app/custom_nodes" + } + }, + // Clone ComfyUI-KJNodes (required for SVI) + { + method: "shell.run", + params: { + message: [ + "git clone https://github.com/kijai/ComfyUI-KJNodes", + ], + path: "app/custom_nodes" + } + }, + // Clone ComfyUI-VideoHelperSuite (useful for video workflows) + { + method: "shell.run", + params: { + message: [ + "git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite", + ], + path: "app/custom_nodes" + } + }, + // Clone Stable-Video-Infinity for workflows + { + method: "shell.run", + params: { + message: [ + "git clone https://github.com/vita-epfl/Stable-Video-Infinity svi", + ], + path: "workflows" + } + }, + // Install all dependencies into the main app/env venv + { + method: "shell.run", + params: { + venv: "env", + path: "app", + message: [ + "uv pip install -r requirements.txt", + "uv pip install -r custom_nodes/ComfyUI-WanVideoWrapper/requirements.txt", + "uv pip install -r custom_nodes/ComfyUI-KJNodes/requirements.txt", + "uv pip install -r custom_nodes/ComfyUI-VideoHelperSuite/requirements.txt", + ] + } + }, + // Install PyTorch with correct version for platform + { + method: "script.start", + params: { + uri: "torch.js", + params: { + venv: "env", + path: "app", + } + } + }, + // Link model directories for sharing with other Pinokio apps + { + method: "fs.link", + params: { + drive: { + checkpoints: "app/models/checkpoints", + clip: "app/models/clip", + clip_vision: "app/models/clip_vision", + controlnet: "app/models/controlnet", + embeddings: "app/models/embeddings", + loras: "app/models/loras", + upscale_models: "app/models/upscale_models", + vae: "app/models/vae", + diffusers: "app/models/diffusers", + unet: "app/models/unet", + }, + peers: [ + "https://github.com/cocktailpeanut/fluxgym.git", + "https://github.com/cocktailpeanutlabs/automatic1111.git", + "https://github.com/cocktailpeanutlabs/fooocus.git", + "https://github.com/cocktailpeanutlabs/comfyui.git", + "https://github.com/pinokiofactory/stable-diffusion-webui-forge.git" + ] + } + }, + // Link output directory + { + method: "fs.link", + params: { + drive: { + output: "app/output" + } + } + }, + // Copy SVI workflows to ComfyUI workflows folder + { + method: "fs.copy", + params: { + src: "workflows/svi/comfyui_workflow_svi_1.0", + dest: "app/user/default/workflows/svi" + } + }, + ] +} diff --git a/pinokio.js b/pinokio.js new file mode 100644 index 0000000..1de2cd3 --- /dev/null +++ b/pinokio.js @@ -0,0 +1,116 @@ +module.exports = { + version: "5.0", + title: "Stable Video Infinity", + description: "Infinite-length video generation with ComfyUI. Generate ANY-length videos with high temporal consistency using Wan 2.1 and SVI LoRA.", + icon: "icon.png", + menu: async (kernel, info) => { + let installed = info.exists("app/env") + let running = { + install: info.running("install.js"), + start: info.running("start.js"), + update: info.running("update.js"), + reset: info.running("reset.js") + } + let downloading = [ + "download-wan21-i2v-14b.js", + "download-svi-lora.js" + ] + let is_downloading = null + for (let item of downloading) { + let d = info.running(item) + if (d === true) { + is_downloading = item + break + } + } + + if (running.install) { + return [{ + default: true, + icon: "fa-solid fa-plug", + text: "Installing", + href: "install.js", + }] + } else if (installed) { + if (running.start) { + let local = info.local("start.js") + if (local && local.url) { + return [{ + default: true, + icon: "fa-solid fa-rocket", + text: "Open Web UI", + popout: true, + href: local.url, + }, { + icon: "fa-solid fa-terminal", + text: "Terminal", + href: "start.js", + }] + } else { + return [{ + default: true, + icon: "fa-solid fa-terminal", + text: "Terminal", + href: "start.js", + }] + } + } else if (is_downloading) { + return [{ + default: true, + icon: "fa-solid fa-terminal", + text: "Downloading", + href: is_downloading, + }] + } else if (running.update) { + return [{ + default: true, + icon: "fa-solid fa-terminal", + text: "Updating", + href: "update.js", + }] + } else if (running.reset) { + return [{ + default: true, + icon: "fa-solid fa-terminal", + text: "Resetting", + href: "reset.js", + }] + } else { + return [{ + default: true, + icon: "fa-solid fa-power-off", + text: "Start", + href: "start.js", + }, { + icon: "fa-solid fa-download", + text: "Download Models", + menu: [{ + icon: "fa-solid fa-download", + text: "Wan 2.1 I2V 14B (Required)", + href: "download-wan21-i2v-14b.js", + }, { + icon: "fa-solid fa-download", + text: "SVI LoRA Weights", + href: "download-svi-lora.js", + }] + }, { + icon: "fa-solid fa-plug", + text: "Update", + href: "update.js", + }, { + icon: "fa-regular fa-circle-xmark", + text: "Reset", + href: "reset.js", + confirm: "Are you sure you wish to reset? This will delete the app and all installed dependencies." + }] + } + } else { + return [{ + default: true, + icon: "fa-solid fa-plug", + text: "Install", + href: "install.js", + }] + } + } +} diff --git a/pinokio.json b/pinokio.json new file mode 100644 index 0000000..0a312de --- /dev/null +++ b/pinokio.json @@ -0,0 +1,5 @@ +{ + "title": "Stable Video Infinity", + "description": "Generate infinite-length videos with high temporal consistency using ComfyUI, Wan 2.1, and SVI LoRA. Features include multi-scene short films, single-scene animations, and controllable streaming storylines.", + "icon": "icon.png" +} diff --git a/reset.js b/reset.js new file mode 100644 index 0000000..a749855 --- /dev/null +++ b/reset.js @@ -0,0 +1,13 @@ +module.exports = { + run: [{ + method: "fs.rm", + params: { + path: "app" + } + }, { + method: "fs.rm", + params: { + path: "workflows" + } + }] +} diff --git a/start.js b/start.js new file mode 100644 index 0000000..a26777f --- /dev/null +++ b/start.js @@ -0,0 +1,31 @@ +module.exports = { + daemon: true, + run: [ + { + method: "shell.run", + params: { + venv: "env", + env: { + PYTORCH_ENABLE_MPS_FALLBACK: "1", + TOKENIZERS_PARALLELISM: "false" + }, + path: "app", + message: [ + "{{platform === 'win32' && gpu === 'amd' ? 'python main.py --directml --port ' + port : 'python main.py --port ' + port}}" + ], + on: [{ + // Capture the URL when server starts + event: "/(http:\\/\\/[0-9.:]+)/", + done: true + }] + } + }, + { + // Set the local variable 'url' for the UI + method: "local.set", + params: { + url: "{{input.event[1]}}" + } + } + ] +} diff --git a/torch.js b/torch.js new file mode 100644 index 0000000..5dcafa2 --- /dev/null +++ b/torch.js @@ -0,0 +1,88 @@ +module.exports = { + run: [ + // nvidia windows + { + "when": "{{gpu === 'nvidia' && platform === 'win32'}}", + "method": "shell.run", + "params": { + "venv": "{{args && args.venv ? args.venv : null}}", + "path": "{{args && args.path ? args.path : '.'}}", + "message": [ + "uv pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 {{args && args.xformers ? 'xformers==0.0.30' : ''}} --index-url https://download.pytorch.org/whl/cu128 --force-reinstall --no-deps", + "{{args && args.triton ? 'uv pip install triton-windows==3.3.1.post19' : ''}}", + "{{args && args.sageattention ? 'uv pip install https://huggingface.co/cocktailpeanut/wheels/resolve/main/sageattention-2.1.1%2Bcu128torch2.7.1-cp310-cp310-win_amd64.whl' : ''}}", + "{{args && args.flashattention ? 'uv pip install https://huggingface.co/cocktailpeanut/wheels/resolve/main/flash_attn-2.8.2%2Bcu128torch2.7-cp310-cp310-win_amd64.whl' : ''}}" + ] + }, + "next": null + }, + // nvidia linux + { + "when": "{{gpu === 'nvidia' && platform === 'linux'}}", + "method": "shell.run", + "params": { + "venv": "{{args && args.venv ? args.venv : null}}", + "path": "{{args && args.path ? args.path : '.'}}", + "message": [ + "uv pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 {{args && args.xformers ? 'xformers==0.0.30' : ''}} --index-url https://download.pytorch.org/whl/cu128 --force-reinstall", + "{{args && args.triton ? 'uv pip install triton' : ''}}", + "{{args && args.sageattention ? 'uv pip install https://huggingface.co/cocktailpeanut/wheels/resolve/main/sageattention-2.1.1%2Bcu128torch2.7.1-cp310-cp310-linux_x86_64.whl' : ''}}", + "{{args && args.flashattention ? 'uv pip install https://huggingface.co/cocktailpeanut/wheels/resolve/main/flash_attn-2.8.3%2Bcu128torch2.7-cp310-cp310-linux_x86_64.whl' : ''}}" + ] + }, + "next": null + }, + // amd windows + { + "when": "{{gpu === 'amd' && platform === 'win32'}}", + "method": "shell.run", + "params": { + "venv": "{{args && args.venv ? args.venv : null}}", + "path": "{{args && args.path ? args.path : '.'}}", + "message": "uv pip install torch torch-directml torchaudio torchvision numpy==1.26.4 --force-reinstall" + }, + "next": null + }, + // amd linux (rocm) + { + "when": "{{gpu === 'amd' && platform === 'linux'}}", + "method": "shell.run", + "params": { + "venv": "{{args && args.venv ? args.venv : null}}", + "path": "{{args && args.path ? args.path : '.'}}", + "message": "uv pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/rocm6.3 --force-reinstall --no-deps" + }, + "next": null + }, + // apple silicon mac + { + "when": "{{platform === 'darwin' && arch === 'arm64'}}", + "method": "shell.run", + "params": { + "venv": "{{args && args.venv ? args.venv : null}}", + "path": "{{args && args.path ? args.path : '.'}}", + "message": "uv pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cpu --force-reinstall --no-deps" + }, + "next": null + }, + // intel mac + { + "when": "{{platform === 'darwin' && arch !== 'arm64'}}", + "method": "shell.run", + "params": { + "venv": "{{args && args.venv ? args.venv : null}}", + "path": "{{args && args.path ? args.path : '.'}}", + "message": "uv pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cpu --force-reinstall --no-deps" + } + }, + // cpu fallback + { + "method": "shell.run", + "params": { + "venv": "{{args && args.venv ? args.venv : null}}", + "path": "{{args && args.path ? args.path : '.'}}", + "message": "uv pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cpu --force-reinstall --no-deps" + } + } + ] +} diff --git a/update.js b/update.js new file mode 100644 index 0000000..890bfa9 --- /dev/null +++ b/update.js @@ -0,0 +1,101 @@ +module.exports = { + run: [ + // Update launcher scripts + { + method: "shell.run", + params: { + message: "git pull" + } + }, + // Update ComfyUI + { + method: "shell.run", + params: { + path: "app", + message: "git pull" + } + }, + // Update ComfyUI-Manager + { + method: "shell.run", + params: { + path: "app/custom_nodes/ComfyUI-Manager", + message: "git pull" + } + }, + // Update ComfyUI-WanVideoWrapper + { + method: "shell.run", + params: { + path: "app/custom_nodes/ComfyUI-WanVideoWrapper", + message: "git pull" + } + }, + // Update ComfyUI-KJNodes + { + method: "shell.run", + params: { + path: "app/custom_nodes/ComfyUI-KJNodes", + message: "git pull" + } + }, + // Update ComfyUI-VideoHelperSuite + { + method: "shell.run", + params: { + path: "app/custom_nodes/ComfyUI-VideoHelperSuite", + message: "git pull" + } + }, + // Update Stable-Video-Infinity workflows + { + method: "shell.run", + params: { + path: "workflows/svi", + message: "git pull" + } + }, + // Reinstall dependencies + { + method: "shell.run", + params: { + path: "app", + venv: "env", + message: [ + "uv pip install -r requirements.txt" + ] + } + }, + // Reinstall custom node dependencies + { + method: "shell.run", + params: { + venv: "env", + path: "app/custom_nodes/ComfyUI-WanVideoWrapper", + message: [ + "uv pip install -r requirements.txt" + ] + } + }, + { + method: "shell.run", + params: { + venv: "env", + path: "app/custom_nodes/ComfyUI-KJNodes", + message: [ + "uv pip install -r requirements.txt" + ] + } + }, + { + method: "shell.run", + params: { + venv: "env", + path: "app/custom_nodes/ComfyUI-VideoHelperSuite", + message: [ + "uv pip install -r requirements.txt" + ] + } + } + ] +}