ComfyUI  >  Nodes  >  ComfyUI-depth-fm >  Depth-FM

ComfyUI Node: Depth-FM

Class Name

Depth_fm

Category
depth_fm
Author
kijai (Account age: 2181 days)
Extension
ComfyUI-depth-fm
Latest Updated
5/22/2024
Github Stars
0.1K

How to Install ComfyUI-depth-fm

Install this extension via the ComfyUI Manager by searching for  ComfyUI-depth-fm
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-depth-fm in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Cloud for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Depth-FM Description

Generates depth maps from images using DepthFM neural network model for AI art applications, transforming 2D images into normalized depth maps.

Depth-FM:

The Depth_fm node is designed to generate depth maps from input images using a sophisticated neural network model. This node leverages the DepthFM model to predict depth information, which can be crucial for various AI art applications, such as creating 3D effects, enhancing image realism, or providing additional layers of detail. The primary goal of this node is to transform 2D images into depth maps that represent the distance of objects from the camera, normalized to a range of [0, 1]. This process involves encoding the input images, generating depth information through a series of steps, and decoding the results to produce the final depth map. The node is optimized to handle different configurations, including ensemble predictions and various processing steps, ensuring flexibility and high-quality outputs.

Depth-FM Input Parameters:

depthfm_model

This parameter specifies the DepthFM model to be used for generating depth maps. It is essential for the node's operation as it defines the architecture and weights of the neural network responsible for depth prediction. The model should be pre-trained and compatible with the DepthFM framework.

vae

The VAE (Variational Autoencoder) parameter is used to encode and decode images during the depth prediction process. It plays a crucial role in transforming the input images into a latent space representation and then decoding the generated depth information back into image space. The VAE should be pre-trained and aligned with the DepthFM model.

images

This parameter represents the input images for which depth maps need to be generated. The images should be provided as tensors with a shape of (b, 3, h, w) and values in the range [-1, 1]. The quality and resolution of the input images directly impact the accuracy and detail of the resulting depth maps.

ensemble_size

The ensemble_size parameter determines the number of models to be used in ensemble mode for generating depth maps. A higher ensemble size can improve the robustness and accuracy of the predictions by averaging the results from multiple models. However, it is only supported with a batch size of 1. The default value is 1.

steps

This parameter specifies the number of steps to be used in the depth prediction process. It controls the granularity and precision of the depth map generation, with more steps potentially leading to more accurate results. The default value is 4.

dtype

The dtype parameter defines the data type to be used for the computations. It ensures compatibility with the hardware and can impact the performance and memory usage of the node. Common options include float32 and float16.

invert

The invert parameter is a boolean flag that indicates whether the depth map should be inverted. When set to true, the depth values are flipped, which can be useful for specific artistic effects or applications. The default value is false.

per_batch

The per_batch parameter determines whether the depth prediction should be performed on a per-batch basis. This can optimize the processing time and resource usage, especially when dealing with large batches of images. The default value is false.

Depth-FM Output Parameters:

depth

The depth parameter is the output tensor representing the generated depth map. It has a shape of (b, 1, h, w) and values in the range [0, 1]. This depth map provides a normalized representation of the distance of objects from the camera, which can be used for various AI art applications, such as creating 3D effects or enhancing image realism.

Depth-FM Usage Tips:

  • Ensure that the input images are pre-processed correctly, with values in the range [-1, 1], to achieve accurate depth predictions.
  • Experiment with different ensemble sizes to find the optimal balance between prediction accuracy and computational efficiency.
  • Use the invert parameter to create unique artistic effects by flipping the depth values in the generated depth map.
  • Adjust the number of steps to control the precision of the depth map generation, with more steps potentially leading to more detailed results.

Depth-FM Common Errors and Solutions:

"Ensemble mode only supported with batch size 1"

  • Explanation: This error occurs when the ensemble_size parameter is set to a value greater than 1, but the batch size of the input images is not 1. - Solution: Ensure that the batch size of the input images is set to 1 when using ensemble mode with an ensemble_size greater than 1.

"Invalid input image range"

  • Explanation: This error occurs when the input images are not in the expected range of [-1, 1].
  • Solution: Pre-process the input images to ensure their values are within the range [-1, 1] before passing them to the node.

"Model or VAE not compatible"

  • Explanation: This error occurs when the provided DepthFM model or VAE is not compatible with the node's requirements.
  • Solution: Verify that the DepthFM model and VAE are pre-trained and compatible with the DepthFM framework used by the node.

Depth-FM Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-depth-fm
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.