Strips UI code, adds tiling/memory optimizations, and restructures for headless use in pipelines like SDXlHunyuan pipeline , 3D reconstruction workflows.*
π With utmost respect and gratitude to the original FramePack by @lllyasviel and FramePack Studio contributors. This is a stripped-down derivative focused on low-VRAM headless inference.
Why This Repo Exists This fork exists to solve real-world deployment constraints:
Aggressive VAE tiling for 8GB VRAM (RTX 3050 8GB) to eliminate OOM errors
Removed 90% of Gradio UI - no previews, job streams, or web interfaces
Restructured worker code for maintainability and module reusability in other projects
Pure headless operation - runs standalone or as pipeline backend
Quick Start
git clone https://github.com/pahnin/framepack_core_low_vram
cd framepack_core_low_vram
# PyTorch CUDA 12.1+ (Sage attention)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
# Run sample - downloads ~13GB HunyuanVideo to ./hf_download
python -m src.framepack_core.sample_usageOutput: 4s video (8 frames) in outputs/hunyuan_only/. Auto-detects VRAM mode. Usage
pythonfrom src.framepack_core.generator import HunyuanVideoGenerator
from src.framepack_core.settings import Settings
settings = Settings()
settings.set("model_path", "hunyuanvideo-community/HunyuanVideo")
settings.set("low_vram_mode", True) # 8GB mode
settings.set("gpu_memory_preservation", 4) # Reserve 4GB
settings.set("width", 320)
settings.set("num_frames", 8)
generator = HunyuanVideoGenerator(settings=settings, high_vram=False)
generator.load_models("hunyuanvideo-community/HunyuanVideo")
video = generator.generate_video(prompt="futuristic drone city flythrough", seed=42)
Full example: src/framepack_core/sample_usage.py
Architecture
src/framepack_core/
βββ generator.py # π― Main HunyuanVideoGenerator
βββ diffusers_helper/ # Model wrappers + optimizations
β βββ models/ # Packed HunyuanVideoTransformer3D
β βββ hunyuan.py # VAE tiling + CLIP vision
β βββ k_diffusion/ # UniPC sampler
βββ pipelines/ # Queue runner + prompt blender
βββ settings.py # Centralized config
βββ sample_usage.py # Standalone demo
VRAM Tested: RTX 3050 8GB, RTX 4060 with 4GB reservation. Requirements texttorch>=2.4 (CUDA 12.1+) diffusers transformers accelerate xformers sageattention psutil einops opencv-python
No Gradio/ComfyUI. Offline: HF_HOME=./hf_download License Apache-2.0 (inherits from FramePack/FramePack Studio)