ComfyUI > Nodes > ComfyUI-Segmentation-Agent > SAM3 Character Agent (OpenRouter)

ComfyUI Node: SAM3 Character Agent (OpenRouter)

Class Name

SAM3AgentOpenRouter

Category
SAM3-Agent
Author
adambarbato (Account age: 4567days)
Extension
ComfyUI-Segmentation-Agent
Latest Updated
2026-02-05
Github Stars
0.03K

How to Install ComfyUI-Segmentation-Agent

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

SAM3 Character Agent (OpenRouter) Description

Facilitates precise character segmentation in images using cloud-based LLM via OpenRouter API.

SAM3 Character Agent (OpenRouter):

The SAM3AgentOpenRouter node is designed to facilitate character segmentation using the OpenRouter API, which leverages cloud-based large language model (LLM) inference for efficient processing. This node is particularly beneficial for AI artists who require precise segmentation of characters within images, as it combines the power of advanced machine learning models with the convenience of cloud computing. By utilizing the OpenRouter API, the node ensures fast and reliable segmentation results, making it an essential tool for projects that demand high accuracy and efficiency. The primary goal of this node is to streamline the character segmentation process, allowing users to focus on creative aspects while the technical complexities are handled seamlessly in the background.

SAM3 Character Agent (OpenRouter) Input Parameters:

image

This parameter expects an image input, which serves as the basis for character segmentation. The image is processed to identify and segment characters based on the provided description. The quality and resolution of the image can impact the accuracy of the segmentation results.

character_description

This is a string parameter where you describe the character you want to segment from the image. It supports multiline input and defaults to "A person with brown hair." The description guides the segmentation process by providing context about the character's appearance, which helps in accurately identifying and segmenting the character from the image.

openrouter_api_key

This string parameter is crucial for authenticating requests to the OpenRouter API. It must be a valid API key, as the default placeholder "sk-or-v1-..." will not work. Providing a valid key ensures that the node can communicate with the OpenRouter service to perform the segmentation task.

model_name

This parameter specifies the name of the model to be used for segmentation. It defaults to "google/gemini-2.0-flash-exp:free," which is a pre-configured model optimized for character segmentation tasks. The choice of model can affect the segmentation quality and performance.

max_iterations

An integer parameter that determines the maximum number of iterations the node will perform to refine the segmentation results. It defaults to 5, with a minimum of 1 and a maximum of 20. Increasing the number of iterations can improve segmentation accuracy but may also increase processing time.

confidence_threshold

This float parameter sets the confidence level required for a segmentation result to be considered valid. It defaults to 0.5, with a range from 0.1 to 1.0. A higher threshold means that only highly confident segmentation results will be accepted, which can reduce false positives but may also exclude some valid results.

SAM3 Character Agent (OpenRouter) Output Parameters:

mask

The mask output is a tensor representing the segmented areas of the image where the character is identified. This mask can be used to isolate the character from the background, allowing for further processing or analysis. It is crucial for tasks that require precise character extraction.

debug_images

This output provides a collection of debug images that illustrate the segmentation process. These images can be useful for understanding how the node arrived at the final segmentation result and for troubleshooting any issues that may arise during processing. They offer a visual representation of the segmentation iterations and adjustments.

SAM3 Character Agent (OpenRouter) Usage Tips:

  • Ensure that the openrouter_api_key is valid and correctly entered to avoid authentication issues with the OpenRouter API.
  • Use a detailed character_description to improve the accuracy of the segmentation results, especially when dealing with complex images or multiple characters.
  • Adjust the max_iterations and confidence_threshold parameters to balance between processing time and segmentation accuracy based on your specific needs.

SAM3 Character Agent (OpenRouter) Common Errors and Solutions:

"Please provide a valid OpenRouter API key"

  • Explanation: This error occurs when the API key is missing or invalid, preventing the node from accessing the OpenRouter service.
  • Solution: Ensure that you have entered a valid API key in the openrouter_api_key parameter. Double-check for any typos or missing characters.

"Empty API response, retrying..."

  • Explanation: The node did not receive a response from the OpenRouter API, possibly due to network issues or service downtime.
  • Solution: Check your internet connection and ensure that the OpenRouter service is operational. If the issue persists, try again later or contact support for assistance.

SAM3 Character Agent (OpenRouter) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Segmentation-Agent
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.