(04/16/2025): Disabled forced xFormers in model loading stage to prevent issues with higher dimension inputs (e.g. 960x960) from hitting batch size cap.
(04/04/2025): Replaced max_size with force_rate parameter to automatically attempt re-sizing input resolution to match closest multiple of 64.
Updated requirements.txt with accelerate
Added warning message in node description about 64 pixel resolution multiple constraint.
(11/27/2024): Updated to support DepthCrafter v1.0.1 inference configuration.
(10/25/2024): Added enable_model_cpu_offload and enable_sequential_cpu_offload options to model loader. Only enable one at a time!
enable_model_cpu_offload: Can save +25% of VRAM with little impact to speed by offloading models to cpu when no longer needed for inference.
enable_sequential_cpu_offload: Can save +37% of VRAM at the expense of slower inference speed by moving all models to CPU.
🖥️ Custom Environment
I created a custom ComfyUI environment for testing out DepthCrafter nodes:
Make sure to select the Basic environment type to access the included workflow!
⭐ Example Workflow:
depthcrafter
📦 Included Nodes:
DownloadAndLoadDepthCrafterModel: Will fetch the model files need to run DepthCrafter and save them under models/depthcrafter.
DepthCrafter: Renders out depthmap videos given the following inputs:
depthcrafter_model: (input from the first node)
images: (single or batch),
max_res: the maximum resolution of the input images, supports increments of 64 pixels. (Larger resolutions require more VRAM)
max_inference_steps: more steps may result in less artifacts in the output, but will take longer to render.
guidance_scale: (1 - 1.2 recommended)
window_size: the length of the context window for DepthCrafter. You can lower this to save on VRAM at the expense of taking longer to render (75-110 recommended)
overlap: how much to overlap each context window to render longer videos > 110 frames. (25 recommended)
🔧 Installation and Usage
ComfyUI Manager:
This node pack is available to install via the ComfyUI Manager. You can find it in the Custom Nodes section by searching for "DepthCrafter" and clicking on the entry called "DepthCrafter Nodes".
Clone the repository:
Navigate to ComfyUI/custom_nodes folder in terminal or command prompt.
If you have trouble using the automatic download feature of the "DownloadAndLoadDepthCrafterModel" node, you can manually download the necessary files like so:
Create the model directories for Depthcrafter:
In your models/ folder you should create a new directory called depthcrafter/
Inside of models/depthcrafter/ you should create 2 additional directories called tencent_DepthCrafter/ and stabilityai_stable-video-diffusion-img2vid-xt/