KJNodes/weightsgenerated

Weight Schedule Convert(WeightScheduleConvert)

This node can automatically detect the type of input data and perform corresponding conversions based on the output type selected by the user.

Weight Schedule Convert

FLOAT
STRING
INT
input_values
0
output_type
list
invert
repeat
1
remap_to_frames
0
interpolation_curve
FLOAT
remap_values
remap_min
0.00
remap_max
1.00
KJNodes

The Weight Schedule Convert node automatically detects the type of input data and performs corresponding conversions based on the user-selected output type.

The Weight Schedule Convert node is a data format conversion tool. Its core function is to convert input weights or numerical sequences between different formats, such as lists, Pandas Series, or PyTorch tensors. It is designed to simplify the data format requirements of different nodes within a workflow, ensuring compatibility in the data flow.

Node Functionality

This node can automatically detect the type of input data and perform corresponding conversions based on the user-selected output type. It supports processing data in list, Pandas Series, and PyTorch Tensor formats. It also provides auxiliary functions such as numerical remapping, sequence inversion, and repetition to accommodate more complex processing needs.

Node Parameter Description - Weight Schedule Convert

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
output_typeCOMBOYesmatch_input"match_input", "list", "pandas series", "tensor...The target output format. Options are "list", "pandas series", or "tensor". The default is "match_input".
input_valuesFLOATYes0.0-The input weight or numerical sequence. Supports list, Pandas Series, or PyTorch Tensor format.
invertBOOLEANYesFalse-invert (Input Parameter): A boolean switch. If enabled, the order of the input numerical sequence is reversed.
repeatINTYes11 - 255 (Step: 1)repeat (Input Parameter): Sets the number of times to repeat the input sequence. The value range is 1 to 255, with a step of 1.
remap_to_framesINTNo0--
interpolation_curveFLOATNo--interpolation_curve (Input Parameter): An optional sequence of floating-point numbers used to define an interpolation curve, adjusting the transition of values when remapping to frames.
remap_valuesBOOLEANNoFalse--
remap_minFLOATNo0.0-100000 - 100000.0 (Step: 0.01)-
remap_maxFLOATNo1.0-100000 - 100000.0 (Step: 0.01)-

Output

Parameter NameData TypeDescription
FLOATFLOATFLOAT (Output Parameter): Outputs the converted sequence of floating-point numbers.
STRINGSTRINGSTRING (Output Parameter): Outputs the converted numerical sequence as a string, facilitating viewing or logging.
INTINTINT (Output Parameter): Outputs the converted sequence of integers (typically obtained by rounding floating-point numbers).

Usage Scenarios

In animation or video generation workflows, this node can be used to convert a list of weights describing style intensity changes into the specific format required by other nodes (e.g., a LoRA scheduler). After obtaining a string of numerical values from a text or curve editor, you can use this node to ensure these values are correctly recognized and processed by downstream nodes.

Notes

Please note that this node primarily performs format conversion and basic numerical adjustments. Complex mathematical operations or interpolation may require combining it with other specialized nodes.

The Weight Schedule Convert node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…