> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-comfy-docs-comfyapi-search.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# PatchModelAddDownscale - ComfyUI Built-in Node Documentation

> PatchModelAddDownscale (Kohya Deep Shrink) applies the Kohya Deep Shrink technique to a model by shrinking intermediate features at a chosen block and then scaling them back to the

PatchModelAddDownscale (Kohya Deep Shrink) applies the Kohya Deep Shrink technique to a model by shrinking intermediate features at a chosen block and then scaling them back to their original size. The shrinking only happens during a selected part of the denoising process, which can reduce processing cost while keeping the final result close to the original.

## Inputs

| Parameter              | Description                                                                         | Data Type | Required | Range                                                                     |
| ---------------------- | ----------------------------------------------------------------------------------- | --------- | -------- | ------------------------------------------------------------------------- |
| `model`                | The model to apply the downscale patch to                                           | MODEL     | Yes      | -                                                                         |
| `block_number`         | The specific block number where downscaling will be applied (default: 3)            | INT       | Yes      | 1-32                                                                      |
| `downscale_factor`     | The factor by which to downscale the features (default: 2.0)                        | FLOAT     | Yes      | 0.1-9.0                                                                   |
| `start_percent`        | The starting point in the denoising process where downscaling begins (default: 0.0) | FLOAT     | Yes      | 0.0-1.0                                                                   |
| `end_percent`          | The ending point in the denoising process where downscaling stops (default: 0.35)   | FLOAT     | Yes      | 0.0-1.0                                                                   |
| `downscale_after_skip` | Whether to apply downscaling after skip connections (default: True)                 | BOOLEAN   | Yes      | -                                                                         |
| `downscale_method`     | The interpolation method used for downscaling operations (default: "bicubic")       | COMBO     | Yes      | "bicubic"<br />"nearest-exact"<br />"bilinear"<br />"area"<br />"bislerp" |
| `upscale_method`       | The interpolation method used for upscaling operations (default: "bicubic")         | COMBO     | Yes      | "bicubic"<br />"nearest-exact"<br />"bilinear"<br />"area"<br />"bislerp" |

The downscale patch is applied only when the current denoising step falls within the range defined by `start_percent` and `end_percent`, and only at the block selected by `block_number`. When `downscale_after_skip` is enabled, the patch is applied after the skip connection; when disabled, it is applied before the skip connection. Features are scaled back up to their original size afterwards, but only when the current feature size no longer matches the size recorded before downscaling.

The parameters `block_number`, `start_percent`, `end_percent`, and `downscale_after_skip` are marked as advanced options in the node interface.

## Outputs

| Output Name | Description                                     | Data Type |
| ----------- | ----------------------------------------------- | --------- |
| `model`     | The modified model with downscale patch applied | MODEL     |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/PatchModelAddDownscale/en.md)

***

**Source fingerprint (SHA-256):** `aa9434a521ab585b290a3bd8db804469bd3bb02103a0d830b6be6eb8e8c26a5e`
