ComfyUI > Nodes > ComfyUI-Sapiens2 > Sapiens2 Body-Part Segmentation

ComfyUI Node: Sapiens2 Body-Part Segmentation

Class Name

Sapiens2Seg

Category
Sapiens2
Author
kijai (Account age: 2864days)
Extension
ComfyUI-Sapiens2
Latest Updated
2026-05-06
Github Stars
0.05K

How to Install ComfyUI-Sapiens2

Install this extension via the ComfyUI Manager by searching for ComfyUI-Sapiens2
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Sapiens2 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 Online for ready-to-use ComfyUI environment

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

Run ComfyUI Online

Sapiens2 Body-Part Segmentation Description

Perform body-part segmentation on images using Sapiens2 model for AI artists to analyze and manipulate images by identifying and segmenting different body parts.

Sapiens2 Body-Part Segmentation:

The Sapiens2Seg node is designed to perform body-part segmentation on images using the Sapiens2 model. This node is particularly useful for AI artists who want to analyze and manipulate images by identifying and segmenting different body parts. The segmentation process involves dividing an image into distinct regions, each corresponding to a specific body part, which can then be used for further processing or artistic effects. The node leverages advanced machine learning techniques to accurately identify and color-code these regions, providing a visual representation of the segmentation. This capability is essential for tasks that require detailed understanding and manipulation of human figures in images, such as animation, virtual reality, and digital art creation.

Sapiens2 Body-Part Segmentation Input Parameters:

image

The image parameter is the input image that you want to process for body-part segmentation. This image serves as the source material from which the node will identify and segment various body parts. The quality and resolution of the input image can impact the accuracy and detail of the segmentation results.

sapiens2_model

The sapiens2_model parameter is a custom input that specifies the pre-trained Sapiens2 model to be used for segmentation. This model contains the necessary data and algorithms to perform the segmentation task. It is crucial to ensure that the correct model is loaded to achieve accurate segmentation results.

frames_per_batch

The frames_per_batch parameter determines the number of frames processed in each forward pass of the model. This setting can affect the performance and memory usage of the node. The default value is 1, with a minimum of 1 and a maximum of 256. Adjusting this parameter can help manage memory usage, especially when working with high-resolution images or limited hardware resources.

Sapiens2 Body-Part Segmentation Output Parameters:

class_id_mask

The class_id_mask output is a mask that represents the segmented body parts in the input image. Each pixel in this mask corresponds to a specific body part, identified by a class ID. This output is essential for further processing or analysis, as it provides a clear delineation of different regions within the image.

colored

The colored output is an image where each segmented body part is color-coded according to its class ID. This visual representation makes it easier to interpret the segmentation results and can be used directly in artistic projects or as a reference for further modifications.

Sapiens2 Body-Part Segmentation Usage Tips:

  • Ensure that the input image is of high quality and appropriate resolution to achieve the best segmentation results.
  • Adjust the frames_per_batch parameter based on your hardware capabilities to optimize performance and prevent memory overflow issues.
  • Use the colored output for a quick visual assessment of the segmentation results, which can help in identifying any areas that may need further refinement.

Sapiens2 Body-Part Segmentation Common Errors and Solutions:

ValueError: loaded checkpoint is task='x', expected 'seg'

  • Explanation: This error occurs when the loaded model checkpoint is not configured for segmentation tasks.
  • Solution: Ensure that the correct Sapiens2 model checkpoint, specifically trained for segmentation, is loaded into the sapiens2_model parameter.

MemoryError: Out of Memory

  • Explanation: This error indicates that the node has run out of memory during processing, likely due to high-resolution images or large batch sizes.
  • Solution: Reduce the frames_per_batch parameter to decrease memory usage, or consider using a machine with more memory resources.

Sapiens2 Body-Part Segmentation Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Sapiens2
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Sapiens2 Body-Part Segmentation