H3 Delta Color Carry (alpha):
The H3DeltaColorCarry node is designed to address and correct the color bias introduced during the VAE (Variational Autoencoder) round-trip process, specifically targeting the prefix of a video sequence. This node is particularly useful in scenarios where multiple VAE round-trips can accumulate color biases, leading to undesirable darkening effects. By applying a subtle exposure and saturation correction in the RGB space, the node ensures that only the intended color adjustments are applied to the latent space, effectively canceling out the encode bias. This correction is spatially low-passed and tapered, ensuring a smooth transition from the original to the corrected frames, while leaving audio components untouched. The node is adapted from the ComfyUI-MiniMaxH3-Contex-Loop's latent color carry method and is tailored for use in masked-prefix graphs, making it a valuable tool for maintaining color consistency in video processing workflows.
H3 Delta Color Carry (alpha) Input Parameters:
samples
This parameter represents the target video latent, which is the output from the extend graph's VAEEncode. It is crucial for the node to know which part of the video sequence needs the color correction.
vae
The VAE (Variational Autoencoder) model used for encoding and decoding the video frames. It is essential for the node to perform the necessary transformations on the video latent.
anchor_stats
A JSON string containing the scene color statistics of the first scene's delivered tail. This data is used as a reference point for the color correction process.
current_stats
A JSON string containing the scene color statistics of the current predecessor's tail. This is compared against the anchor_stats to determine the necessary color adjustments.
prefix_frames
This integer parameter specifies the number of frames in the prefix that will be corrected. It must be on the 17k+5 grid, with a default value of 39, a minimum of 22, and a maximum of 3600. This determines the extent of the video sequence that will undergo color correction.
strength
A float value that controls the intensity of the color correction, ranging from 0.0 to 1.0, with a default of 0.50. This parameter allows you to adjust how strongly the correction is applied.
max_luma_shift
This float parameter sets the maximum allowable change in luminance, clamped in 8-bit code values. It ranges from 0.0 to 32.0, with a default of 6.0, ensuring that the brightness adjustments remain within a reasonable range.
max_saturation_change
A float value that limits the maximum change in saturation, ranging from 0.0 to 0.5, with a default of 0.06. This parameter helps maintain natural-looking colors by preventing excessive saturation changes.
spatial_kernel
An integer that defines the size of the spatial kernel used for low-passing the latent delta. It must be an odd number between 1 and 15, with a default of 3. This parameter controls the smoothness of the transition between corrected and uncorrected frames.
H3 Delta Color Carry (alpha) Output Parameters:
samples
The corrected video latent, which has undergone the specified color adjustments. This output is crucial for ensuring that the video sequence maintains consistent color quality throughout.
report
A string report detailing the brightness and saturation adjustments applied, as well as the number of steps and the root mean square (RMS) of the delta. This output provides valuable feedback on the correction process, helping you understand the changes made to the video latent.
H3 Delta Color Carry (alpha) Usage Tips:
- Ensure that the
prefix_framesparameter is set correctly on the 17k+5 grid to avoid errors and ensure proper correction of the intended video segment. - Adjust the
strengthparameter to control the intensity of the color correction, starting with the default value and fine-tuning as needed for your specific video content. - Use the
max_luma_shiftandmax_saturation_changeparameters to prevent excessive changes that could lead to unnatural-looking results, especially when working with videos that have subtle color variations.
H3 Delta Color Carry (alpha) Common Errors and Solutions:
color carry runs on the VIDEO latent before H3 V2V Init packs audio - wire it earlier
- Explanation: This error occurs when the node is applied after the audio has been packed into the video latent, which is not supported.
- Solution: Ensure that the node is applied to the video latent before the H3 V2V Init process that packs the audio.
color carry: prefix_frames must sit on the 17k+5 grid (39, 56, 90, ...); got <value>
- Explanation: The
prefix_framesparameter is not set to a valid value on the 17k+5 grid. - Solution: Adjust the
prefix_framesparameter to a valid value such as 39, 56, or 90, ensuring it aligns with the 17k+5 grid requirements.
color carry spatial kernel must be odd
- Explanation: The
spatial_kernelparameter is set to an even number, which is not allowed. - Solution: Change the
spatial_kernelparameter to an odd number within the allowed range (1 to 15).
