Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

Available Nodes

CreateInstanceDiffusionTracking

CreateInstanceDiffusionTracking Node Documentation

Overview

The CreateInstanceDiffusionTracking node is part of the Instance Diffusion category of the ComfyUI-KJNodes library. This node generates tracking data suitable for Instance Diffusion tasks, a process often utilized in video or animation workflows where specific elements within a sequence need to be tracked or modified. The node supports the creation of prompts and bounding box configurations necessary for Instance Diffusion, making it a crucial component for users working with automated object or element tracking within ComfyUI.

Instance Diffusion itself is a method that integrates elements of instance segmentation and diffusion models, allowing users to specify prompts that guide which parts of an image or video frame should be altered based on predefined conditions or directions.

Functionality

The CreateInstanceDiffusionTracking node allows users to define:

  • A set of coordinates that track the movement of an object or region through different frames or instances.
  • A prompt format used to guide the diffusion process regarding specific classes or elements of interest.
  • Bounding boxes that define the region of interest (ROI) for the object or element being tracked.

Inputs

  • Coordinates: This input takes a list of coordinates that define the path or location of an object or region across various frames or instances. The coordinates are provided as a string in a JSON-like format.

  • Width: The width of the frame. This value specifies the horizontal dimensions in pixels of the overall frame where tracking is to take place.

  • Height: The height of the frame. This value specifies the vertical dimensions in pixels of the overall frame where tracking is to take place.

  • Bounding Box Width: The width of the bounding box around the object or region of interest.

  • Bounding Box Height: The height of the bounding box around the object or region of interest.

  • Class Name: A string representing the class name associated with the object or element being tracked. This is part of the identification used for generating the diffusion prompt.

  • Class ID: An integer representing the class identifier for the tracked object or element. This ID, combined with the class name, helps in generating the correct instance prompt format.

  • Prompt: A string representing the prompt used in Instance Diffusion. This prompt typically describes the object or element in more detail, influencing how instance-specific operations are performed.

  • Size Multiplier (optional): A floating-point list used to modify the size of the bounding boxes in relation to the coordinates across different instances. This can be useful for adjusting tracking precision dynamically.

  • Fit in Frame (optional): A boolean indicator specifying whether the bounding boxes should be adjusted to fit within the frame dimensions. This prevents bounding boxes from extending beyond the frame limits.

Outputs

  • Tracking Data: Produced as output, this data contains the necessary coordinates, prompt information, frame dimensions, and bounding box sizes needed for Instance Diffusion tasks. This information guides the diffusion model to identify and act on specific elements as defined by the user inputs.

  • Prompt String: A formatted string output representing the full prompt used in rendering Instance Diffusion. It combines the class name and ID with the user-defined prompt to generate diffusion instructions.

  • Frame Width: The output includes the overall pixel width of the frame as specified in the inputs.

  • Frame Height: The specified pixel height of the frame is also produced as output.

  • Bounding Box Width: The final pixel width of the bounding box after adjustments, if any, applied.

  • Bounding Box Height: The final pixel height of the bounding box, considering any modifications.

Usage in Workflows

The CreateInstanceDiffusionTracking node is used in ComfyUI workflows where:

  • Automated tracking of objects or regions across sequential images or frames is required.
  • Specific parts of an image need to be in focus for transformation or generation tasks.
  • Integration with advanced diffusion models is necessary to guide operations based on classes and prompts within a sequence.
  • Users seek to create animated transformations, transitions, or modifications by adjusting specific elements in a consistent manner over time.

This node is especially useful in workflows involving video editing, animation editing, and other creative endeavors where objects need to be consistently recharacterized or modified across frames using AI-driven methods.

Special Features and Considerations

  • Dynamic Size Adjustment: With the size_multiplier input, users can dynamically adjust the size of bounding boxes across instances, enabling accurate and flexible tracking that adapts to changes in object size or frame conditions.

  • Frame Fitting: The node includes a feature that adjusts bounding boxes to fit within frame dimensions, ensuring that any defined ROIs remain confined to the output size constraints, which is crucial for maintaining output integrity.

  • Comprehensive Prompt Construction: By integrating the tracking data with a customizable prompt, users can finely tune the behavior of diffusion models to act in a nuanced manner specific to their creative needs.

The CreateInstanceDiffusionTracking node thus plays a vital role in facilitating advanced diffusion-based workflows in ComfyUI, empowering users to achieve sophisticated tracking and transformation tasks with relative ease.