> ## 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) 通过将下采样和上采样操作应用于模型中的特定块来实现 Kohya Deep Shrink 技术。

PatchModelAddDownscale (Kohya Deep Shrink) 通过将下采样和上采样操作应用于模型中的特定块来实现 Kohya Deep Shrink 技术。它在处理过程中降低中间特征的分辨率，然后将其恢复为原始大小，从而在保持质量的同时提升性能。该节点允许对模型执行期间这些缩放操作发生的时间和方式进行精确控制。

## 输入

| 参数      | 描述                      | 数据类型    | 是否必需 | 范围                                                                        |
| ------- | ----------------------- | ------- | ---- | ------------------------------------------------------------------------- |
| `模型`    | 要应用下采样补丁的模型             | MODEL   | 是    | -                                                                         |
| `层编号`   | 将应用下采样的具体块编号（默认：3）      | INT     | 是    | 1-32                                                                      |
| `收缩系数`  | 对特征进行下采样的因子（默认：2.0）     | FLOAT   | 是    | 0.1-9.0                                                                   |
| `开始百分比` | 去噪过程中下采样开始的起始点（默认：0.0）  | FLOAT   | 是    | 0.0-1.0                                                                   |
| `结束百分比` | 去噪过程中下采样结束的终止点（默认：0.35） | FLOAT   | 是    | 0.0-1.0                                                                   |
| `跳过后收缩` | 是否在跳跃连接之后应用下采样（默认：True） | BOOLEAN | 是    | -                                                                         |
| `收缩算法`  | 用于下采样操作的插值方法            | COMBO   | 是    | "bicubic"<br />"nearest-exact"<br />"bilinear"<br />"area"<br />"bislerp" |
| `放大方法`  | 用于上采样操作的插值方法            | COMBO   | 是    | "bicubic"<br />"nearest-exact"<br />"bilinear"<br />"area"<br />"bislerp" |

仅当当前去噪步骤位于 `start_percent` 和 `end_percent` 定义的范围内时，下采样补丁才会被应用，并且仅应用于 `block_number` 所选的块。当启用 `downscale_after_skip` 时，补丁在跳跃连接之后应用；当禁用时，则在跳跃连接之前应用。

## 输出

| 输出名称    | 描述             | 数据类型  |
| ------- | -------------- | ----- |
| `model` | 应用了下采样补丁的修改后模型 | MODEL |

> 本文档由 AI 生成。如果您发现任何错误或有改进建议，欢迎贡献！ [在 GitHub 上编辑](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/PatchModelAddDownscale/zh.md)

***

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