From 2d04f5fcd6efe13efa0f0d094afd404b84032b77 Mon Sep 17 00:00:00 2001 From: spacepxl Date: Sat, 5 Oct 2024 01:08:28 -0400 Subject: [PATCH] progress bar --- README.md | 2 ++ nodes.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e74e0e0..00f676e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ In order to convert metric depth to relative depth, like what's needed for contr If you get errors about "vit_large_patch14_dinov2" make sure timm is up to date (tested with 0.9.16 and 1.0.9) +The "(Down)Load Depth Pro model" node will auto-download the model from huggingface, but if you want to manually download it, you can download it [from here](https://huggingface.co/spacepxl/ml-depth-pro/blob/main/depth_pro.fp16.safetensors) and place it in `ComfyUI/models/depth/ml-depth-pro/` + ## Example ![img](https://github.com/spacepxl/ComfyUI-Depth-Pro/blob/main/example/workflow.png) diff --git a/nodes.py b/nodes.py index bef7697..2d47dcf 100644 --- a/nodes.py +++ b/nodes.py @@ -79,7 +79,7 @@ class DepthPro: depth = [] focal_px = [] - # add comfyui progress bar + pbar = comfy.utils.ProgressBar(rgb.size(0)) if comfy.utils.PROGRESS_BAR_ENABLED else None for i in trange(rgb.size(0)): rgb_image = rgb[i, :3].unsqueeze(0).to(device, dtype=dtype) rgb_image = transform(rgb_image) @@ -87,6 +87,7 @@ class DepthPro: prediction = model.infer(rgb_image) depth.append(prediction["depth"].unsqueeze(-1)) focal_px.append(prediction["focallength_px"].item()) + if pbar is not None: pbar.update(1) depth = torch.stack(depth, dim=0).repeat(1,1,1,3) focal_list = focal_px