progress bar
This commit is contained in:
@@ -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
|
||||
|
||||

|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user