### Setup Environment and Install Packages Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Sonic_Image_Audio_to_Video.ipynb This snippet sets up the environment by cloning necessary repositories and installing required Python and apt packages. It includes functions to install pip packages and apt packages, clearing output after each installation step. ```python # @markdown # 💥1. Setup Environment %cd /content/ from IPython.display import clear_output !git clone https://github.com/Isi-dev/ComfyUI %cd /content/ComfyUI/custom_nodes !git clone https://github.com/Isi-dev/ComfyUI_Sonic %cd /content/ComfyUI clear_output() # !pip install torchsde av diffusers torch torchaudio torchvision transformers imageio imageio-ffmpeg omegaconf tqdm librosa einops # !apt -y install -qq aria2 ffmpeg import subprocess import sys def install_pip_packages(): packages = [ 'torchsde', 'av', 'diffusers', 'torch', 'torchaudio', 'torchvision', 'transformers', 'imageio', 'imageio-ffmpeg', 'omegaconf', 'tqdm', 'librosa', 'einops' ] for package in packages: try: # Run pip install silently (using -q) subprocess.run( [sys.executable, '-m', 'pip', 'install', '-q', package], check=True, capture_output=True ) print(f"✓ {package} installed") except subprocess.CalledProcessError as e: print(f"✗ Error installing {package}: {e.stderr.decode().strip() or 'Unknown error'}") def install_apt_packages(): packages = ['aria2', 'ffmpeg'] try: # Run apt install silently (using -qq) subprocess.run( ['apt-get', '-y', 'install', '-qq'] + packages, check=True, capture_output=True ) print("✓ apt packages installed") except subprocess.CalledProcessError as e: print(f"✗ Error installing apt packages: {e.stderr.decode().strip() or 'Unknown error'}") # Run installations print("Installing pip packages...") install_pip_packages() clear_output() # Clear the pip installation output print("Installing apt packages...") install_apt_packages() clear_output() # Clear the apt installation output print("Installation completed with status:") print("- All pip packages installed successfully" if '✗' not in install_pip_packages.__code__.co_consts else "- Some pip packages had issues") print("- apt packages installed successfully" if '✗' not in install_apt_packages.__code__.co_consts else "- apt packages had issues") import os os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True' import torch import numpy as np from PIL import Image import gc import sys from google.colab import files from IPython.display import display, HTML, Image as IPImage sys.path.insert(0, '/content/ComfyUI') from nodes import LoadImage from comfy_extras.nodes_audio import LoadAudio from comfy_extras.nodes_video_model import ImageOnlyCheckpointLoader from custom_nodes.ComfyUI_Sonic.sonic_node import ( SONICLoader, SONIC_PreData, SONICSampler ) load_image = LoadImage() load_audio = LoadAudio() svd_loader = ImageOnlyCheckpointLoader() sonic_loader = SONICLoader() sonic_predata = SONIC_PreData() sonic_sampler = SONICSampler() # !mkdir -p /content/ComfyUI/models/sonic ``` -------------------------------- ### Install Apt Packages and Finalize Setup Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/LTX/LTX2_TI2V_Distilled.ipynb Installs essential system packages 'aria2' and 'ffmpeg' using apt-get. Includes error handling for the installation process and then changes the directory back to the ComfyUI root. ```python def install_apt_packages(): packages = ['aria2', 'ffmpeg'] try: # Run apt install silently (using -qq) subprocess.run( ['apt-get', '-y', 'install', '-qq'] + packages, check=True, capture_output=True ) print("✓ apt packages installed") except subprocess.CalledProcessError as e: print(f"✗ Error installing apt packages: {e.stderr.decode().strip() or 'Unknown error'}") print("Installing apt packages...") install_apt_packages() clear_output() %cd /content/ComfyUI ``` -------------------------------- ### Environment Setup Confirmation Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Basic_Wan2_1_VACE_&_CausVid_LoRA_4_Image_to_Video.ipynb Confirms that the environment setup, including pip and apt package installations, and model downloads, is complete. ```text Installation completed with status: - All pip packages installed successfully - apt packages installed successfully Downloading Wan2.1-VACE-14B-Q8_0.gguf... Done! Downloading Wan21_CausVid_14B_T2V_lora_rank32.safetensors... Done! Downloading umt5_xxl_fp8_e4m3fn_scaled.safetensors... Done! Downloading wan_2.1_vae.safetensors... Done! ✅ Environment Setup Complete! ``` -------------------------------- ### Setup Environment and Install Dependencies Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/FramePack.ipynb Installs core PyTorch libraries and clones necessary GitHub repositories for ComfyUI and its custom nodes. Clears output after each major step for a cleaner display. ```python # @title Setup Environment !pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 from IPython.display import clear_output %cd /content !git clone https://github.com/Isi-dev/ComfyUI clear_output() %cd /content/ComfyUI/custom_nodes !git clone https://github.com/Isi-dev/ComfyUI_FramePackWrapper !git clone https://github.com/Isi-dev/ComfyUI_KJNodes clear_output() %cd /content/ComfyUI/custom_nodes/ComfyUI_FramePackWrapper !pip install -r requirements.txt clear_output() %cd /content/ComfyUI/custom_nodes/ComfyUI_KJNodes !pip install -r requirements.txt clear_output() %cd /content/ComfyUI ``` -------------------------------- ### Setup Practical RIFE Environment Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/FrameInterpolationRIFE.ipynb Clones the Practical-RIFE repository, installs necessary packages, and downloads pre-trained models and configuration files. Ensure you have an active internet connection for downloads. ```python # @title !git clone https://github.com/Isi-dev/Practical-RIFE %cd /content/Practical-RIFE !pip install git+https://github.com/rk-exxec/scikit-video.git@numpy_deprecation !mkdir -p /content/Practical-RIFE/train_log !wget -q https://huggingface.co/Isi99999/Frame_Interpolation_Models/resolve/main/4.25/train_log/IFNet_HDv3.py -O /content/Practical-RIFE/train_log/IFNet_HDv3.py !wget -q https://huggingface.co/Isi99999/Frame_Interpolation_Models/resolve/main/4.25/train_log/RIFE_HDv3.py -O /content/Practical-RIFE/train_log/RIFE_HDv3.py !wget -q https://huggingface.co/Isi99999/Frame_Interpolation_Models/resolve/main/4.25/train_log/refine.py -O /content/Practical-RIFE/train_log/refine.py !wget -q https://huggingface.co/Isi99999/Frame_Interpolation_Models/resolve/main/4.25/train_log/flownet.pkl -O /content/Practical-RIFE/train_log/flownet.pkl !echo "✅ All setup steps completed successfully!" ``` -------------------------------- ### Setup Environment and Install Dependencies Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/flux/Flux1_Kontext_Dev_with_Mask_Editor_for_Inpainting.ipynb Installs PyTorch, clones the ComfyUI repository and custom nodes, and installs requirements. Ensure you have the correct PyTorch version for your CUDA setup. ```python # @markdown # 💥1. Setup Environment # !pip install --quiet torch torchvision --index-url https://download.pytorch.org/whl/cu124 # !pip install --upgrade --quiet torch torchvision --index-url https://download.pytorch.org/whl/cu118 !pip install torch==2.8.0 torchvision==0.23.0 %cd /content from IPython.display import clear_output !git clone --branch ComfyUI_v0.3.43 https://github.com/Isi-dev/ComfyUI clear_output() %cd /content/ComfyUI/custom_nodes !git clone https://github.com/Isi-dev/ComfyUI_Img2PaintingAssistant !git clone https://github.com/Isi-dev/ComfyUI_GGUF.git clear_output() # !git clone https://github.com/Isi-dev/ComfyUI_KJNodes.git # clear_output() %cd /content/ComfyUI/custom_nodes/ComfyUI_GGUF !pip install -r requirements.txt clear_output() # %cd /content/ComfyUI/custom_nodes/ComfyUI_KJNodes # !pip install -r requirements.txt ``` -------------------------------- ### Setup DiffSynth Studio and Download Models Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Wan2_1_I2V_14B.ipynb This script clones the DiffSynth Studio repository, installs necessary packages, and downloads model weights using aria2c. Ensure you have sufficient disk space and a stable internet connection. ```python # @title !git clone https://github.com/Isi-dev/DiffSynth-Studio.git %cd DiffSynth-Studio !pip install -e . !pip install "huggingface_hub[cli]" !apt-get install -y aria2 import os from huggingface_hub import list_repo_files repo_id = "Isi99999/Wan2.1-I2V-14B-480P" all_files = list_repo_files(repo_id) base_url = f"https://huggingface.co/{repo_id}/resolve/main/" with open("file_list.txt", "w") as f: for file_path in all_files: full_url = f"{base_url}{file_path}" save_path = f"models/Wan-AI/Wan2.1-I2V-14B-480P/{file_path}" os.makedirs(os.path.dirname(save_path), exist_ok=True) f.write(f"{full_url}\n out={save_path}\n") !aria2c -x 16 -s 16 -i file_list.txt --continue=true --auto-file-renaming=false print("✅ All models downloaded successfully!") import torch from diffsynth import ModelManager, WanVideoPipeline, VideoData, save_video model_manager = ModelManager(device="cpu") model_manager.load_models( ["models/Wan-AI/Wan2.1-I2V-14B-480P/models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth"], torch_dtype=torch.float16, # Image Encoder is loaded with float16 ) model_manager.load_models( [ "models/Wan-AI/Wan2.1-I2V-14B-480P/diffusion_pytorch_model.safetensors", "models/Wan-AI/Wan2.1-I2V-14B-480P/models_t5_umt5-xxl-enc-bf16.safetensors", "models/Wan-AI/Wan2.1-I2V-14B-480P/Wan2.1_VAE.safetensors", ], torch_dtype=torch.torch.bfloat16, # You can set `torch_dtype=torch.float8_e4m3fn` or `torch_dtype=torch.bfloat16` to disable FP8 quantization. ) pipe = WanVideoPipeline.from_model_manager(model_manager, torch_dtype=torch.bfloat16, device="cuda") parameters_in_vram = 14 # @param {"type":"number"} pipe.enable_vram_management(num_persistent_param_in_dit=parameters_in_vram*10**9) # You can set `num_persistent_param_in_dit` to a small number to reduce VRAM required. print("✅ All models loaded successfully!") ``` -------------------------------- ### Setup Environment for ComfyUI and Hidream Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Hidream_T2V_GGUF_Q5.ipynb Installs PyTorch, clones ComfyUI and the Hidream custom node, and installs its requirements. Ensure you select one of the three HiDream model versions before proceeding. ```python # @title Setup Environment %cd /content !pip install torch==2.6.0 torchvision==0.21.0 from IPython.display import clear_output # !pip install -q torchsde einops diffusers accelerate xformers # !git clone https://github.com/comfyanonymous/ComfyUI !git clone https://github.com/Isi-dev/ComfyUI clear_output() %cd /content/ComfyUI/custom_nodes !git clone --branch forHidream https://github.com/Isi-dev/ComfyUI_GGUF.git clear_output() %cd /content/ComfyUI/custom_nodes/ComfyUI_GGUF !pip install -r requirements.txt clear_output() %cd /content/ComfyUI # !apt -y install -qq aria2 import subprocess import sys def install_pip_packages(): packages = [ 'torchsde', # 'av', 'diffusers', # 'transformers', 'xformers==0.0.29.post2', 'accelerate', # 'omegaconf', # 'tqdm', # 'librosa', 'einops' ] for package in packages: try: # Run pip install silently (using -q) subprocess.run( [sys.executable, '-m', 'pip', 'install', '-q', package], check=True, capture_output=True ) print(f"✓ {package} installed") except subprocess.CalledProcessError as e: print(f"✗ Error installing {package}: {e.stderr.decode().strip() or 'Unknown error'}") def install_apt_packages(): packages = ['aria2'] try: # Run apt install silently (using -qq) subprocess.run( ['apt-get', '-y', 'install', '-qq'] + packages, check=True, capture_output=True ) print("✓ apt packages installed") except subprocess.CalledProcessError as e: print(f"✗ Error installing apt packages: {e.stderr.decode().strip() or 'Unknown error'}") ``` -------------------------------- ### Setup and Model Download for DiffSynth Studio Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Wan2_1_T2V_1_3B_DiffSynth.ipynb This snippet clones the DiffSynth Studio repository, installs necessary packages, and downloads pre-trained models using huggingface_hub and aria2c. Ensure you have sufficient RAM (above 50GB) for loading the text encoder checkpoint. ```python # @title !git clone https://github.com/Isi-dev/DiffSynth-Studio.git %cd DiffSynth-Studio !pip install -e . !pip install "huggingface_hub[cli]" !apt-get install -y aria2 import os from huggingface_hub import list_repo_files repo_id = "Wan-AI/Wan2.1-T2V-1.3B" all_files = list_repo_files(repo_id) base_url = f"https://huggingface.co/{repo_id}/resolve/main/" with open("file_list.txt", "w") as f: for file_path in all_files: full_url = f"{base_url}{file_path}" save_path = f"models/Wan-AI/Wan2.1-T2V-1.3B/{file_path}" os.makedirs(os.path.dirname(save_path), exist_ok=True) f.write(f"{full_url}\n out={save_path}\n") !aria2c -x 16 -s 16 -i file_list.txt --continue=true --auto-file-renaming=false print("✅ All models downloaded successfully!") ``` -------------------------------- ### Install Pip and Apt Packages Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Basic_Wan2_1_VACE_&_CausVid_LoRA_4_Text_to_Video(WIP).ipynb Installs necessary pip and apt packages for the environment. Clears output after each installation step. ```python print("Installing pip packages...") install_pip_packages() clear_output() # Clear the pip installation output print("Installing apt packages...") install_apt_packages() clear_output() # Clear the apt installation output print("Installation completed with status:") print("- All pip packages installed successfully" if '✗' not in install_pip_packages.__code__.co_consts else "- Some pip packages had issues") print("- apt packages installed successfully" if '✗' not in install_apt_packages.__code__.co_consts else "- apt packages had issues") ``` -------------------------------- ### Prepare Environment for LongCat-Video Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/ComfyUI/LongCat_Video/ComfyUI_LongCat_Video.ipynb Installs core dependencies like PyTorch and torchvision, then installs various ComfyUI custom nodes and their requirements. Includes options for including a manager and uses %cd to change directories for sequential installations. ```python # @markdown # 💥Prepare Environment !pip install torch==2.8.0 torchvision==0.23.0 # using_T4_GPU = True # @param {type:"boolean"} using_T4_GPU = False # @param {type:"boolean"} include_manager = False # @param {type:"boolean"} %cd /content from IPython.display import clear_output clear_output() # !pip install -q torchsde einops diffusers accelerate xformers==0.0.32.post1 triton==3.4 sageattention==1.0.6 !pip install -q torchsde einops diffusers accelerate xformers==0.0.32.post1 # !pip install ninja==1.13.0 # !pip install psutil # !pip install packaging # !pip install flash_attn==2.7.4.post1 !pip install av spandrel albumentations onnx opencv-python onnxruntime !pip install color-matcher !pip install onnxruntime-gpu -y !git clone --branch ComfyUI_v0.3.65 https://github.com/Isi-dev/ComfyUI !pip install -r /content/ComfyUI/requirements.txt clear_output() %cd /content/ComfyUI/custom_nodes # !git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git if include_manager: !git clone --branch com_man_3.37 https://github.com/Isi-dev/ComfyUI-Manager # !git clone --branch forQwen https://github.com/Isi-dev/ComfyUI_GGUF.git # !git clone https://github.com/Isi-dev/ComfyUI_DeleteModelPassthrough.git # !git clone https://github.com/Isi-dev/comfyui_controlnet_aux !git clone --branch wan_1.3.8 https://github.com/Isi-dev/ComfyUI_WanVideoWrapper !git clone https://github.com/Isi-dev/ComfyUI_VideoHelperSuite # !git clone --branch kj_1.1.7 https://github.com/Isi-dev/ComfyUI_KJNodes !git clone https://github.com/kijai/ComfyUI-KJNodes # !git clone https://github.com/kijai/ComfyUI-segment-anything-2 # !git clone https://github.com/kijai/ComfyUI-Florence2 # !git clone https://github.com/john-mnz/ComfyUI-Inspyrenet-Rembg.git !git clone https://github.com/Isi-dev/ComfyUI_Animation_Nodes_and_Workflows # %cd /content/ComfyUI/custom_nodes/ComfyUI_GGUF # !pip install -r requirements.txt # %cd /content/ComfyUI/custom_nodes/ComfyUI_DeleteModelPassthrough # !pip install -r requirements.txt # %cd /content/ComfyUI/custom_nodes/comfyui_controlnet_aux # !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI_WanVideoWrapper !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI_VideoHelperSuite !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI-KJNodes !pip install -r requirements.txt # %cd /content/ComfyUI/custom_nodes/ComfyUI-Florence2 # !pip install -r requirements.txt # %cd /content/ComfyUI/custom_nodes/ComfyUI-Inspyrenet-Rembg # !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI_Animation_Nodes_and_Workflows !pip install -r requirements.txt if include_manager: %cd /content/ComfyUI/custom_nodes/ComfyUI-Manager !pip install -r requirements.txt clear_output() %cd /content/ComfyUI import os os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True' import subprocess import sys from pathlib import Path ``` -------------------------------- ### Prepare Environment and Install Dependencies Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Wan2_1_14B_I2V_GGUF_Free.ipynb Installs PyTorch, ComfyUI, custom nodes, and other necessary libraries. It also clones the ComfyUI repository and custom nodes, and installs requirements. Finally, it downloads pre-trained models using aria2c. ```python # @title Prepare Environment !pip install torch==2.6.0 torchvision==0.21.0 %cd /content !pip install -q torchsde einops diffusers accelerate xformers==0.0.29.post2 !pip install av !git clone https://github.com/Isi-dev/ComfyUI %cd /content/ComfyUI/custom_nodes !git clone https://github.com/Isi-dev/ComfyUI_GGUF.git %cd /content/ComfyUI/custom_nodes/ComfyUI_GGUF !pip install -r requirements.txt %cd /content/ComfyUI !apt -y install -qq aria2 ffmpeg ``` ```python useQ6 = False # @param {"type":"boolean"} if useQ6: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/city96/Wan2.1-I2V-14B-480P-gguf/resolve/main/wan2.1-i2v-14b-480p-Q6_K.gguf -d /content/ComfyUI/models/unet -o wan2.1-i2v-14b-480p-Q6_K.gguf else: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/city96/Wan2.1-I2V-14B-480P-gguf/resolve/main/wan2.1-i2v-14b-480p-Q4_0.gguf -d /content/ComfyUI/models/unet -o wan2.1-i2v-14b-480p-Q4_0.gguf ``` ```python !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors -d /content/ComfyUI/models/text_encoders -o umt5_xxl_fp8_e4m3fn_scaled.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors -d /content/ComfyUI/models/vae -o wan_2.1_vae.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/clip_vision/clip_vision_h.safetensors -d /content/ComfyUI/models/clip_vision -o clip_vision_h.safetensors ``` -------------------------------- ### Install PyTorch and Core Libraries Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/LTX/LTX2_TI2V_Distilled.ipynb Installs PyTorch, torchvision, and torchaudio. Clears output and then installs additional libraries required for diffusion models and image processing. ```python # @title {"single-column":true} # @markdown # 💥Prepare Environment !pip install torch torchvision torchaudio %cd /content from IPython.display import clear_output clear_output() !pip install -q torchsde einops diffusers accelerate !pip install av spandrel albumentations onnx opencv-python onnxruntime ``` -------------------------------- ### Environment Setup Confirmation Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Fast_Wan2_1_14B_I2V_480p_GGUF_&_LoRA.ipynb Prints a confirmation message indicating that the environment setup is complete. ```python print("✅ Environment Setup Complete!") ``` -------------------------------- ### Install Dependencies and Load Zonos Model Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/ZonosTTS.ipynb Installs necessary libraries, clones the Zonos repository, and loads the pre-trained Zonos model. Ensure you have PyTorch and torchaudio installed. ```python # @title !pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 !apt update && apt install -y espeak-ng !git clone https://github.com/Isi-dev/Zonos.git %cd Zonos !pip install -e . # !pip install --no-build-isolation -e .[compile] # optional but needed to run the hybrid import torch import torchaudio from zonos.model import Zonos from zonos.conditioning import make_cond_dict # Check device device = "cuda" if torch.cuda.is_available() else "cpu" print(f"Using device: {device}") # Load model print("Loading model...") model = Zonos.from_pretrained("Isi99999/Zonos-v0.1-transformer", device=device) print("Model loaded!") ``` -------------------------------- ### Prepare Environment and Install Dependencies Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Contributions/Experiment LTX23_TI2V_Distilled.ipynb Installs PyTorch, essential libraries like torchsde, einops, diffusers, and accelerate, along with AV, Spandrel, Albumentations, ONNX, and OpenCV. It also clones the ComfyUI repository and installs its requirements. ```python # @title {"single-column":true} # @markdown # 💥Prepare Environment !pip install torch torchvision torchaudio %cd /content from IPython.display import clear_output clear_output() !pip install -q torchsde einops diffusers accelerate !pip install av spandrel albumentations onnx opencv-python onnxruntime !git clone https://github.com/comfyanonymous/ComfyUI !pip install -r /content/ComfyUI/requirements.txt clear_output() %cd /content/ComfyUI/custom_nodes import subprocess import os # LTX2.3 needs current ComfyUI plus the LTXVideo nodes. KJNodes and GGUF are still used # for video/audio helpers and GGUF model loading. !git clone https://github.com/kijai/ComfyUI-KJNodes !git clone https://github.com/city96/ComfyUI-GGUF !git clone https://github.com/Lightricks/ComfyUI-LTXVideo/ %cd /content/ComfyUI/custom_nodes/ComfyUI-KJNodes !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI-GGUF !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI-LTXVideo if os.path.exists("requirements.txt"): !pip install -r requirements.txt def install_apt_packages(): packages = ['aria2', 'ffmpeg'] try: # Run apt install silently (using -qq) subprocess.run( ['apt-get', '-y', 'install', '-qq'] + packages, check=True, capture_output=True ) print("✓ apt packages installed") except subprocess.CalledProcessError as e: print(f"✗ Error installing apt packages: {e.stderr.decode().strip() or 'Unknown error'}") print("Installing apt packages...") install_apt_packages() clear_output() %cd /content/ComfyUI # !apt -y install -qq aria2 ffmpeg import os os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True' import sys from pathlib import Path import random from typing import Sequence, Mapping, Any, Union import torch import numpy as np import cv2 from PIL import Image import gc import imageio from google.colab import files from IPython.display import display, HTML, Image as IPImage sys.path.insert(0, '/content/ComfyUI') from nodes import NODE_CLASS_MAPPINGS from nodes import LoraLoaderModelOnly ``` -------------------------------- ### Install Dependencies and Clone Repository Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/LatentSync.ipynb Installs necessary Python libraries and clones the LatentSync GitHub repository. It also downloads pre-trained model weights required for the lip-sync pipeline. Restart the session if prompted after installation. ```python # @title !pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 !pip install diffusers mediapipe transformers huggingface-hub omegaconf einops opencv-python face-alignment decord ffmpeg-python safetensors soundfile import os import subprocess if not os.path.exists("LatentSync"): !git clone https://github.com/Isi-dev/LatentSync %cd LatentSync from google.colab import files import torch from omegaconf import OmegaConf from diffusers import AutoencoderKL, DDIMScheduler from latentsync.models.unet import UNet3DConditionModel from latentsync.pipelines.lipsync_pipeline import LipsyncPipeline from latentsync.whisper.audio2feature import Audio2Feature from diffusers.utils.import_utils import is_xformers_available from accelerate.utils import set_seed import ipywidgets as widgets os.makedirs("/root/.cache/torch/hub/checkpoints", exist_ok=True) os.makedirs("checkpoints", exist_ok=True) model_urls = { "/root/.cache/torch/hub/checkpoints/s3fd-619a316812.pth": "https://huggingface.co/Isi99999/LatentSync/resolve/main/auxiliary/s3fd-619a316812.pth", "/root/.cache/torch/hub/checkpoints/2DFAN4-cd938726ad.zip": "https://huggingface.co/Isi99999/LatentSync/resolve/main/auxiliary/2DFAN4-cd938726ad.zip", "checkpoints/latentsync_unet.pt": "https://huggingface.co/Isi99999/LatentSync/resolve/main/latentsync_unet.pt", "checkpoints/tiny.pt": "https://huggingface.co/Isi99999/LatentSync/resolve/main/whisper/tiny.pt", "checkpoints/diffusion_pytorch_model.safetensors": "https://huggingface.co/stabilityai/sd-vae-ft-mse/resolve/main/diffusion_pytorch_model.safetensors", "checkpoints/config.json": "https://huggingface.co/stabilityai/sd-vae-ft-mse/raw/main/config.json", } for file_path, url in model_urls.items(): if not os.path.exists(file_path): print(f"Downloading {file_path} ...") subprocess.run(["wget", url, "-O", file_path], check=True) else: print(f"File {file_path} already exists. Skipping download.") print("Setup complete.") ``` -------------------------------- ### Prepare Environment and Install Dependencies Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/ComfyUI/ComfyUI_LTX2_3/ComfyUI_LTX2_3_TI2V.ipynb Installs PyTorch, torchvision, and other required Python packages. It also clones the ComfyUI repository and installs its dependencies, along with several custom nodes. ```python # @title {"single-column":true} # @markdown # 💥Prepare Environment !pip install torch torchvision offload_models_for_low_VRAM = True # @param {type:"boolean"} include_manager = False # @param {type:"boolean"} include_ltxNodes = True # @param {type:"boolean"} include_rgthree = True # @param {type:"boolean"} include_Easy_Use = True # @param {type:"boolean"} include_VideoHelperSuite = True # @param {type:"boolean"} include_MelBandRoFormer = True # @param {type:"boolean"} %cd /content from IPython.display import clear_output clear_output() !pip install -q torchsde einops diffusers accelerate !pip install av spandrel albumentations onnx opencv-python onnxruntime # !git clone https://github.com/comfyanonymous/ComfyUI !git clone --branch ComfyUI_ltx_2_3_compliant_19_03_2026 https://github.com/Isi-dev/ComfyUI !pip install -r /content/ComfyUI/requirements.txt clear_output() %cd /content/ComfyUI/custom_nodes if include_manager: !git clone https://github.com/Comfy-Org/ComfyUI-Manager # !git clone --branch com_man_3.37 https://github.com/Isi-dev/ComfyUI-Manager !git clone --branch kj_ltx_2_3_compliant_19_03_2026 https://github.com/Isi-dev/ComfyUI_KJNodes !git clone https://github.com/city96/ComfyUI-GGUF if include_ltxNodes: !git clone https://github.com/Lightricks/ComfyUI-LTXVideo/ if include_rgthree: !git clone https://github.com/rgthree/rgthree-comfy.git if include_Easy_Use: !git clone https://github.com/yolain/ComfyUI-Easy-Use if include_VideoHelperSuite: !git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite if include_MelBandRoFormer: !git clone https://github.com/kijai/ComfyUI-MelBandRoFormer %cd /content/ComfyUI/custom_nodes/ComfyUI_KJNodes !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI-GGUF !pip install -r requirements.txt if include_Easy_Use: %cd /content/ComfyUI/custom_nodes/ComfyUI-Easy-Use !pip install -r requirements.txt if include_VideoHelperSuite: %cd /content/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite !pip install -r requirements.txt if include_MelBandRoFormer: %cd /content/ComfyUI/custom_nodes/ComfyUI-MelBandRoFormer !pip install -r requirements.txt if include_manager: %cd /content/ComfyUI/custom_nodes/ComfyUI-Manager !pip install -r requirements.txt clear_output() %cd /content/ComfyUI ``` -------------------------------- ### Prepare Environment and Install Core Packages Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/ComfyUI/Ditto/ComfyUI_Ditto_Video_Editing.ipynb Installs essential Python packages for PyTorch, diffusers, and related libraries. It also clones the ComfyUI repository and installs its requirements. Use this to set up the base ComfyUI environment. ```python # @markdown # 💥Prepare Environment # https://huggingface.co/city96/Wan2.1-I2V-14B-480P-gguf/resolve/main/wan2.1-i2v-14b-480p-Q4_K_M.gguf !pip install torch==2.8.0 torchvision==0.23.0 # using_T4_GPU = True # @param {type:"boolean"} low_GPU = False # @param {type:"boolean"} include_manager = True # @param {type:"boolean"} %cd /content from IPython.display import clear_output clear_output() !pip install -q torchsde einops diffusers accelerate xformers==0.0.32.post1 triton==3.4 sageattention==1.0.6 !pip install av spandrel albumentations onnx opencv-python onnxruntime !pip install color-matcher !pip install onnxruntime-gpu -y !git clone --branch ComfyUI_v0.3.65 https://github.com/Isi-dev/ComfyUI !pip install -r /content/ComfyUI/requirements.txt clear_output() %cd /content/ComfyUI/custom_nodes # !git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git if include_manager: !git clone --branch com_man_3.37 https://github.com/Isi-dev/ComfyUI-Manager # !git clone --branch forQwen https://github.com/Isi-dev/ComfyUI_GGUF.git # !git clone https://github.com/Isi-dev/ComfyUI_DeleteModelPassthrough.git # !git clone https://github.com/Isi-dev/comfyui_controlnet_aux !git clone --branch wan_1.3.7 https://github.com/Isi-dev/ComfyUI_WanVideoWrapper !git clone https://github.com/Isi-dev/ComfyUI_VideoHelperSuite !git clone --branch kj_1.1.7 https://github.com/Isi-dev/ComfyUI_KJNodes # !git clone https://github.com/kijai/ComfyUI-segment-anything-2 # !git clone https://github.com/kijai/ComfyUI-Florence2 # !git clone https://github.com/john-mnz/ComfyUI-Inspyrenet-Rembg.git !git clone https://github.com/Isi-dev/ComfyUI_Animation_Nodes_and_Workflows # %cd /content/ComfyUI/custom_nodes/ComfyUI_GGUF # !pip install -r requirements.txt # %cd /content/ComfyUI/custom_nodes/ComfyUI_DeleteModelPassthrough # !pip install -r requirements.txt # %cd /content/ComfyUI/custom_nodes/comfyui_controlnet_aux # !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI_WanVideoWrapper !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI_VideoHelperSuite !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI_KJNodes !pip install -r requirements.txt # %cd /content/ComfyUI/custom_nodes/ComfyUI-Florence2 # !pip install -r requirements.txt # %cd /content/ComfyUI/custom_nodes/ComfyUI-Inspyrenet-Rembg # !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI_Animation_Nodes_and_Workflows !pip install -r requirements.txt if include_manager: %cd /content/ComfyUI/custom_nodes/ComfyUI-Manager !pip install -r requirements.txt clear_output() %cd /content/ComfyUI import os os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True' import subprocess import sys from pathlib import Path ``` -------------------------------- ### Install AV Package Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/LTX_Video_with_Start_&_End_frames.ipynb Installs the AV package, likely for handling audio and video streams. ```bash !pip install av ``` -------------------------------- ### Environment Setup Confirmation Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/LTXV_0_9_7_13B_Distilled_Image_to_Video.ipynb Confirms that the environment setup for the Google Colab notebook is complete. ```python print("✅ Environment Setup Complete!") ``` ``` -------------------------------- ### Install APT Packages Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/ComfyUI/Qwen_Image_Edit_Plus/ComfyUI_Qwen_Image_Edit_2509.ipynb Installs specified packages using apt-get. Use this for system-level dependencies. ```python import subprocess def install_apt_packages(): packages = ['aria2'] try: # Run apt install silently (using -qq) subprocess.run( ['apt-get', '-y', 'install', '-qq'] + packages, check=True, capture_output=True ) print("✓ apt packages installed") except subprocess.CalledProcessError as e: print(f"✗ Error installing apt packages: {e.stderr.decode().strip() or 'Unknown error'}") print("Installing apt packages...") install_apt_packages() ``` -------------------------------- ### Clone and Install ComfyUI and Custom Nodes Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/LTX/LTX2_TI2V_Distilled.ipynb Clones the ComfyUI repository and specific custom nodes (KJNodes and ComfyUI_GGUF). Installs requirements for each custom node and then proceeds to install apt packages. ```python !git clone --branch ComfyUI_22_01_2026_v0.10.0 https://github.com/Isi-dev/ComfyUI.git !pip install -r /content/ComfyUI/requirements.txt clear_output() %cd /content/ComfyUI/custom_nodes import subprocess !git clone --branch kj_1.2.6 https://github.com/Isi-dev/ComfyUI_KJNodes !git clone --branch ComfyUI_GGUF_22_01_2026 https://github.com/Isi-dev/ComfyUI_GGUF.git %cd /content/ComfyUI/custom_nodes/ComfyUI_KJNodes !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI_GGUF !pip install -r requirements.txt ``` -------------------------------- ### Prepare Environment and Install Core Libraries Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/ComfyUI/Wan22_OVI/ComfyUI_Wan22_OVI.ipynb Installs PyTorch, torchvision, and other essential Python packages like torchsde, diffusers, accelerate, xformers, and triton. It also installs libraries for video processing and ONNX runtime. ```python # @markdown # 💥Prepare Environment !pip install torch==2.8.0 torchvision==0.23.0 # using_T4_GPU = True # @param {type:"boolean"} using_T4_GPU = False include_manager = False # @param {type:"boolean"} %cd /content from IPython.display import clear_output clear_output() !pip install -q torchsde einops diffusers accelerate xformers==0.0.32.post1 triton==3.4 sageattention==1.0.6 !pip install av spandrel albumentations onnx opencv-python onnxruntime !pip install color-matcher !pip install onnxruntime-gpu -y !git clone https://github.com/comfyanonymous/ComfyUI !pip install -r /content/ComfyUI/requirements.txt clear_output() ``` -------------------------------- ### Environment Setup Confirmation Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/Wan2_1_1_3B_T2V_Free.ipynb A simple print statement to confirm that the environment setup has been completed successfully. ```python print("✅ Environment Setup Complete!") ``` -------------------------------- ### Install Core Libraries and Clone Repositories Source: https://github.com/isi-dev/google-colab_notebooks/blob/main/LTX/Experiment LTX23_TI2V_Distilled.ipynb Installs essential Python packages and clones custom nodes for ComfyUI, including LTXVideo, KJNodes, and GGUF. It also installs requirements for each custom node. ```python # @title {"single-column":true} # @markdown # 💥Prepare Environment !pip install torch torchvision torchaudio %cd /content from IPython.display import clear_output clear_output() !pip install -q torchsde einops diffusers accelerate !pip install av spandrel albumentations onnx opencv-python onnxruntime !git clone https://github.com/comfyanonymous/ComfyUI !pip install -r /content/ComfyUI/requirements.txt clear_output() %cd /content/ComfyUI/custom_nodes import subprocess import os # LTX2.3 needs current ComfyUI plus the LTXVideo nodes. KJNodes and GGUF are still used # for video/audio helpers and GGUF model loading. !git clone https://github.com/kijai/ComfyUI-KJNodes !git clone https://github.com/city96/ComfyUI-GGUF !git clone https://github.com/Lightricks/ComfyUI-LTXVideo/ %cd /content/ComfyUI/custom_nodes/ComfyUI-KJNodes !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI-GGUF !pip install -r requirements.txt %cd /content/ComfyUI/custom_nodes/ComfyUI-LTXVideo if os.path.exists("requirements.txt"): !pip install -r requirements.txt def install_apt_packages(): packages = ['aria2', 'ffmpeg'] try: # Run apt install silently (using -qq) subprocess.run( ['apt-get', '-y', 'install', '-qq'] + packages, check=True, capture_output=True ) print("✓ apt packages installed") except subprocess.CalledProcessError as e: print(f"✗ Error installing apt packages: {e.stderr.decode().strip() or 'Unknown error'}") print("Installing apt packages...") install_apt_packages() clear_output() %cd /content/ComfyUI # !apt -y install -qq aria2 ffmpeg import os os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True' import sys from pathlib import Path import random from typing import Sequence, Mapping, Any, Union import torch import numpy as np import cv2 from PIL import Image import gc import imageio import shutil from google.colab import files from IPython.display import display, HTML, Image as IPImage sys.path.insert(0, '/content/ComfyUI') from nodes import NODE_CLASS_MAPPINGS from nodes import LoraLoaderModelOnly ```