Visit ComfyUI Online for ready-to-use ComfyUI environment
Modify model with downscaling and upscaling operations on specific blocks for AI artists to control resolution and optimize performance.
The PatchModelAddDownscale
node, also known as "PatchModelAddDownscale (Kohya Deep Shrink)," is designed to modify a model by applying downscaling and subsequent upscaling operations to specific blocks within the model. This node is particularly useful for AI artists who want to manipulate the resolution of intermediate features within a model, allowing for more control over the model's behavior and potentially improving performance or visual quality. By specifying parameters such as the block number, downscale factor, and the range of operation, you can fine-tune how and when the downscaling occurs. This node provides a flexible way to experiment with different downscaling and upscaling methods, making it a valuable tool for optimizing models for various tasks.
This parameter represents the model to which the downscaling and upscaling patches will be applied. It is a required input and should be a valid model object that you wish to modify.
This integer parameter specifies the block number within the model where the downscaling operation will be applied. The default value is 3, with a minimum of 1 and a maximum of 32. Adjusting this parameter allows you to target specific layers of the model for downscaling.
This float parameter determines the factor by which the selected block will be downscaled. The default value is 2.0, with a minimum of 0.1 and a maximum of 9.0. A higher downscale factor will reduce the resolution more significantly.
This float parameter defines the starting point of the downscaling operation as a percentage of the model's processing. The default value is 0.0, with a range from 0.0 to 1.0. This allows you to control when the downscaling begins during the model's execution.
This float parameter sets the ending point of the downscaling operation as a percentage of the model's processing. The default value is 0.35, with a range from 0.0 to 1.0. This parameter helps you define the duration of the downscaling effect.
This boolean parameter indicates whether the downscaling should occur after a skip connection within the model. The default value is True. Setting this parameter helps you control the exact point of downscaling in relation to skip connections.
This parameter specifies the method used for downscaling. Available options are "bicubic," "nearest-exact," "bilinear," "area," and "bislerp." Choosing the appropriate method can affect the quality and performance of the downscaling operation.
This parameter defines the method used for upscaling after the downscaling operation. Available options are "bicubic," "nearest-exact," "bilinear," "area," and "bislerp." Selecting the right method ensures that the upscaled features match the desired quality and resolution.
The output is the modified model with the applied downscaling and upscaling patches. This model can then be used for further processing or evaluation, incorporating the changes specified by the input parameters.
downscale_factor
values to find the optimal balance between performance and visual quality.start_percent
and end_percent
parameters to fine-tune the timing of the downscaling operation within the model's execution.downscale_method
and upscale_method
options based on the specific requirements of your task, as different methods can produce varying results.block_number
parameter is set between 1 and 32.downscale_factor
value is not within the allowed range.downscale_factor
to be between 0.1 and 9.0.start_percent
or end_percent
values are not within the range of 0.0 to 1.0.start_percent
and end_percent
parameters to values within the 0.0 to 1.0 range.© Copyright 2024 RunComfy. All Rights Reserved.