> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-custom-nodes-sdk-v2-frontend.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) implements the Kohya Deep Shrink technique by applying downscaling and upscaling operations to specific blocks in a model.

PatchModelAddDownscale (Kohya Deep Shrink) implements the Kohya Deep Shrink technique by applying downscaling and upscaling operations to specific blocks in a model. It reduces the resolution of intermediate features during processing and then restores them to their original size, which can improve performance while maintaining quality. The node allows precise control over when and how these scaling operations occur during the model's execution.

## 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                            | COMBO     | Yes      | "bicubic"<br />"nearest-exact"<br />"bilinear"<br />"area"<br />"bislerp" |
| `upscale_method`       | The interpolation method used for upscaling operations                              | 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.

## 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`
