Giter Site home page Giter Site logo

yuvraj108c / comfyui-depth-anything-tensorrt Goto Github PK

View Code? Open in Web Editor NEW
71.0 2.0 6.0 3.26 MB

ComfyUI Depth Anything (v1/v2) Tensorrt Custom Node (up to 14x faster), licensed under CC BY-NC-SA 4.0

License: Other

Python 100.00%
comfyui comfyui-nodes depth-anything depth-map stable-diffusion onnx tensorrt tensorrt-inference

comfyui-depth-anything-tensorrt's Introduction

ComfyUI Depth Anything TensorRT

python cuda trt mit

This repo provides a ComfyUI Custom Node implementation of the Depth-Anything-Tensorrt in Python for ultra fast depth map generation (up to 14x faster than comfyui_controlnet_aux)

⏱️ Performance (Depth Anything V1)

Note: The following results were benchmarked on FP16 engines inside ComfyUI

Device Model Model Input (WxH) Image Resolution (WxH) FPS
RTX4090 Depth-Anything-S 518x518 1280x720 35
RTX4090 Depth-Anything-B 518x518 1280x720 33
RTX4090 Depth-Anything-L 518x518 1280x720 24
H100 Depth-Anything-L 518x518 1280x720 125+

⏱️ Performance (Depth Anything V2)

Note: The following results were benchmarked on FP16 engines inside ComfyUI

Device Model Model Input (WxH) Image Resolution (WxH) FPS
H100 Depth-Anything-S 518x518 1280x720 213
H100 Depth-Anything-B 518x518 1280x720 180
H100 Depth-Anything-L 518x518 1280x720 109

🚀 Installation

Navigate to the ComfyUI /custom_nodes directory

git clone https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt.git
cd ./ComfyUI-Depth-Anything-Tensorrt
pip install -r requirements.txt

🛠️ Building Tensorrt Engine

  1. Download one of the available onnx models:
  2. Edit model paths inside export_trt.py accordingly and run python export_trt.py
  3. Place the exported engine inside ComfyUI /models/tensorrt/depth-anything directory

☀️ Usage

  • Insert node by Right Click -> tensorrt -> Depth Anything Tensorrt
  • Choose the appropriate engine from the dropdown

🤖 Environment tested

  • Ubuntu 22.04 LTS, Cuda 12.3, Tensorrt 10.0.1, Python 3.10, RTX 4090 GPU
  • Windows (Not tested)

📝 Changelog

  • 02/07/2024

    • Add Depth Anything V2 onnx models + benchmarks
    • Merge PR for engine caching in memory
  • 26/04/2024

    • Update to tensorrt 10.0.1
    • Massive code refactor, remove trtexec, remove pycuda, show engine building progress
    • Update and standardise engine directory and node category for upcoming tensorrt custom nodes suite
  • 7/04/2024

    • Fix image resize bug during depth map post processing
  • 30/03/2024

    • Fix CUDNN_STATUS_MAPPING_ERROR
  • 27/03/2024

    • Major refactor and optimisation (remove subprocess)

👏 Credits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.