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
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 Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
coordinates | STRING | Yes | - | - | 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. |
width | INT | Yes | 512 | 16 - 4096 (Step: 1) | width (Input Parameter): Passes through the input image width value. |
height | INT | Yes | 512 | 16 - 4096 (Step: 1) | height (Input Parameter): Passes through the input image height value. |
bbox_width | INT | Yes | 512 | 16 - 4096 (Step: 1) | bbox_width (Input Parameter): Passes through the input bounding box width value. |
bbox_height | INT | Yes | 512 | 16 - 4096 (Step: 1) | bbox_height (Input Parameter): Passes through the input bounding box height value. |
class_name | STRING | Yes | class_name | - | class_name (Input Parameter): Specifies a category name for the tracked instance, e.g., "person" or "car". |
class_id | INT | Yes | 0 | 0 - 255 (Step: 1) | class_id (Input Parameter): Assigns a numeric ID to the instance for unique identification, ranging from 0 to 255. |
prompt | STRING | Yes | prompt | - | prompt (Input Parameter): Passes through the input prompt text. |
size_multiplier | FLOAT | No | [1] | - | Optional list of float values for size multiplier. |
fit_in_frame | BOOLEAN | No | True | - | fit_in_frame (Input Parameter): Whether to fit the instance within the frame. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| tracking | TRACKING | Tracking data conforming to the InstanceDiffusion format requirements. |
| prompt | STRING | prompt (Output Parameter): Directly passes through the input prompt text. |
| width | INT | width (Output Parameter): Directly passes through the input image width value. |
| height | INT | height (Output Parameter): Directly passes through the input image height value. |
| bbox_width | INT | bbox_width (Output Parameter): Directly passes through the input bounding box width value. |
| bbox_height | INT | bbox_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.
CreateInstanceDiffusionTracking Node Source Code Link
The CreateInstanceDiffusionTracking node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.