KJNodes/InstanceDiffusiongenerated

CreateInstanceDiffusionTracking

This node receives a JSON string containing object bounding box coordinates and, combined with user-defined categories, IDs, and prompt words, constructs the tracking data structure required by InstanceDiffusion.

Create Instance Diffusion Tracking

tracking
prompt
width
height
bbox_width
bbox_height
coordinates
STRING
width
512
height
512
bbox_width
512
bbox_height
512
class_name
class_name
class_id
0
prompt
prompt
size_multiplier
1
fit_in_frame
KJNodes

The CreateInstanceDiffusionTracking node receives a JSON string containing object bounding box coordinates and, combined with user-defined categories, IDs, and prompts, constructs the tracking data structure required by InstanceDiffusion.

The CreateInstanceDiffusionTracking node is a specialized tool for generating instance tracking data. Its core function is to encapsulate object coordinates, category information, and prompts into a specific format, enabling subsequent InstanceDiffusion nodes to identify and process specific instances within an image. This node serves as a crucial bridge connecting object detection with refined image generation.

Node Function

This node receives a JSON string containing object bounding box coordinates and, combined with user-defined categories, IDs, and prompts, constructs the tracking data structure required by InstanceDiffusion. Its internal mechanism adheres to the specific format of InstanceDiffusion, for example, organizing data in the form "class_id.class_name": "prompt", ensuring compatibility with downstream generation nodes.

Node Parameter Description - CreateInstanceDiffusionTracking

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
coordinatesSTRINGYes--coordinates (Input Parameter): A JSON string containing object bounding box coordinates, serving as the foundation for generating tracking data. The format must meet the requirements.
widthINTYes51216 - 4096 (Step: 1)width (Input Parameter): Passes through the input image width value.
heightINTYes51216 - 4096 (Step: 1)height (Input Parameter): Passes through the input image height value.
bbox_widthINTYes51216 - 4096 (Step: 1)bbox_width (Input Parameter): Passes through the input bounding box width value.
bbox_heightINTYes51216 - 4096 (Step: 1)bbox_height (Input Parameter): Passes through the input bounding box height value.
class_nameSTRINGYesclass_name-class_name (Input Parameter): Specifies a category name for the tracked instance, e.g., "person" or "car".
class_idINTYes00 - 255 (Step: 1)class_id (Input Parameter): Assigns a numeric ID to the instance for unique identification, ranging from 0 to 255.
promptSTRINGYesprompt-prompt (Input Parameter): Passes through the input prompt text.
size_multiplierFLOATNo[1]-Optional list of float values for size multiplier.
fit_in_frameBOOLEANNoTrue-fit_in_frame (Input Parameter): Whether to fit the instance within the frame.

Output

Parameter NameData TypeDescription
trackingTRACKINGTracking data conforming to the InstanceDiffusion format requirements.
promptSTRINGprompt (Output Parameter): Directly passes through the input prompt text.
widthINTwidth (Output Parameter): Directly passes through the input image width value.
heightINTheight (Output Parameter): Directly passes through the input image height value.
bbox_widthINTbbox_width (Output Parameter): Directly passes through the input bounding box width value.
bbox_heightINTbbox_height (Output Parameter): Directly passes through the input bounding box height value.

Usage Scenarios

This node is highly useful in workflows for creating animations or generating consecutive video frames. For example, you can first use an object detection node to obtain the coordinates of "person heads" in each frame of a video, then feed this sequence of coordinates into this node, specifying the category as "head" and the corresponding prompt. This provides the InstanceDiffusion node with precise, frame-by-frame instance control information.

Notes

Ensure the input coordinate string is valid JSON format. Additionally, the output data format of this node is fixed and must strictly match the input requirements of the InstanceDiffusion node; otherwise, workflow execution may fail.

The CreateInstanceDiffusionTracking node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…