Skip to content

[FEATURE] 处理带纹理图片时启用切块处理会导致纹理部分模糊 #688

Closed

Description

@mayo-v

Please carefully review each item in the checklist below | 请认真检查以下清单中的每一项 | 以下のチェックリストの各項目を注意深く確認してください

  • Searched and didn't find a similar issue | 已经搜索过,没有发现类似issue | 類似の問題が見つかりませんでした

Is your feature request related to a problem? | 你的feature请求是否与一个问题有关? | あなたのfeatureリクエストは質問に関連していますか?

使用RealRESRGAN_X2plus处理有关人物以及室内场景时,开启切块处理后生成的图片部分模糊,部分纹理错误

Detail | 详细描述 | 詳細な説明

使用RealRESRGAN_X2plus处理图片时,图片较大或者批量处理时不开启切块处理会报错,只能开启切块处理;
处理图片如果包含人物、沙发等带有纹理的织物时,处理后的图片部分切块纹理模糊、错误、切块拼接接缝明显。
软件版本:4.0
操作系统:windows 11 25H2
CPU:Intel 12600KF
GPU:Nvidia RTX 5060

Additional context | 附加内容 | 追加コンテキスト

软件内设置:模型:RealRESRGAN_X2plus,设备:CUDA,自定义倍率默认,保存格式:jpg,开启切块处理。
附上处理前图片与处理后图片,图片来源于网络,可以明显看到地面部分存在模糊且边缘有分界线
original image:
Image

Processed image:
Image

Activity

  1. added
    enhancement
    on Dec 18, 2025
  2. NULL204 commented on May 29, 2026

    @NULL204
    Member

    这算是特性吧,硬件不足的妥协,ai的回答你看一下,我觉得回答的挺好
    在超分辨率(Super-Resolution, SR)或AI图像放大处理中,启用“切块处理”(Tiling / Patching)时出现边缘分界线(接缝)和纹理模糊,是一个非常经典的计算机视觉现象。
    这通常是由于神经网络的局部计算特性以及切块融合算法的副作用共同造成的。以下是导致这一现象的核心原因分析:

    1. 为什么会出现“分界线(接缝)”?

    • 感受野(Receptive Field)截断: 超分模型(如 ESRGAN, SwinIR 等)在处理图像时,依赖于像素周围的上下文信息(感受野)。当图像被强行切块后,位于切块边缘的像素突然失去了其原本相邻的像素信息。
    • 边缘填充(Padding)效应: 为了让卷积神经网络能够处理切块边缘,算法通常会进行“填充”(比如补零、边缘镜像反射等)。这种人为构造的边缘信息与原本真实的图像信息完全不同,导致模型在切块边缘输出了与整图处理时完全不同的像素颜色和亮度,拼接后就形成了肉眼可见的“分界线”。

    2. 为什么纹理部分(如地面)会明显“模糊”?

    出现模糊,往往是因为软件为了掩盖上述的分界线而采取了妥协的融合策略:

    • 重叠融合(Overlap Blending)的副作用: 为了消除硬生生的接缝,主流的切块处理软件会采用“重叠切块”策略(即相邻切块之间有一定宽度的重叠区域),并在拼接时对重叠区域使用羽化(Alpha混合/高斯渐变)。
    • 高频细节被抹平: 将两张极其相似但不完全一致的纹理图像(由于分别超分计算,重叠区域的生成结果会有微小差异)进行透明度叠加混合,本质上等同于做了一次低通滤波(模糊处理)。
    • 地面纹理的特殊性: 地面通常包含大量高频细节(如沙砾、草地、水泥颗粒等)。这类随机且细碎的纹理对“像素对齐”的要求极高。一旦两个切块的重叠区域在微观上无法完美对齐,羽化融合就会瞬间将这些锐利的颗粒感平均化,导致肉眼看起来像被涂抹过一样模糊。

    如何缓解或解决这个问题?

    如果你在处理时遇到了这个问题,可以尝试通过调整参数或工作流来改善:

    1. 增大重叠区域(Tile Overlap / Padding):
    • 大多数切块超分工具(如 Stable Diffusion 中的 Tiled VAE / Tiled Diffusion,或独立超分软件)都允许设置重叠像素大小。
    • 对策: 适当增加重叠像素(例如从 32 提高到 64 或 128)。重叠区域越大,边缘截断的影响越小,融合过渡会更自然。
    1. 调整羽化/平滑参数(Tile Smoothing):
    • 如果在重叠区域仍然模糊,可能是由于羽化过度。查看软件中是否有控制融合强度的参数,适当降低混合的宽度。
    1. 使用更高级的无缝切块算法:
    • 如果是 AI 绘画中的超分(如 Stable Diffusion),强烈建议使用 Tiled VAE 或 MultiDiffusion 插件。它们在底层算法上优化了潜空间或像素空间的特征融合,比简单的“切图->超分->硬拼接加羽化”效果要好得多,能最大限度保留纹理锐度。
    1. 硬件允许下尽量采用“整图处理”:
    • 切块处理本质上是为了妥协显存(VRAM)不足。如果条件允许,尝试稍微缩小超分的倍率,或者清理后台显存占用,关闭切块功能直接进行整图超分,这是保留纹理和避免接缝最根本的方法。
  3. Issues-translate-bot commented on May 29, 2026

    @Issues-translate-bot

    Bot detected the issue body's language is not English, translate it automatically.


    This is considered a feature, a compromise due to insufficient hardware. Take a look at AI’s answer. I think it’s quite good.
    In super-resolution (SR) or AI image enlargement processing, edge dividing lines (seams) and texture blur appear when "Tiling / Patching" is enabled, which is a very classic computer vision phenomenon.
    This is usually due to a combination of the local computational nature of neural networks and the side effects of the tile fusion algorithm. The following is an analysis of the core reasons leading to this phenomenon:

    1. Why do “demarcation lines (seams)” appear?

    • Receptive Field (Receptive Field) truncation: Super-resolution models (such as ESRGAN, SwinIR, etc.) rely on contextual information (receptive field) around pixels when processing images. When the image is forcibly sliced, the pixels located at the edge of the slice suddenly lose their original adjacent pixel information.
    • Edge filling (Padding) effect: In order to allow the convolutional neural network to process the tile edges, the algorithm usually performs "padding" (such as zero padding, edge mirror reflection, etc.). This artificially constructed edge information is completely different from the original real image information, causing the model to output a completely different pixel color and brightness at the edge of the slice than when processing the entire image. After splicing, a "demarcation line" visible to the naked eye is formed.

    2. Why are textured parts (such as the ground) obviously "blurred"?

    Blurredness often occurs because the software adopts a compromised fusion strategy in order to cover up the above-mentioned dividing lines:

    • Side effects of Overlap Blending: In order to eliminate hard seams, mainstream tile processing software will adopt the "overlap tile" strategy (that is, there are overlapping areas of a certain width between adjacent tiles), and use feathering (Alpha blending/Gaussian gradient) on the overlapping areas when splicing.
    • **High frequency details are smoothed out: ** Performing transparency overlay and blending of two very similar but not completely consistent texture images (due to separate super-resolution calculations, there will be slight differences in the generation results of overlapping areas) is essentially equivalent to doing a low-pass filtering (blurring process).
    • Speciality of ground textures: The ground usually contains a lot of high-frequency details (such as gravel, grass, cement particles, etc.). This kind of random and fragmented texture requires extremely high "pixel alignment". Once the overlapping areas of the two cuts are not perfectly aligned microscopically, Feather Fusion instantly averages out these sharp grains, resulting in a blur that looks smeared to the naked eye.

    How can I mitigate or resolve this issue?

    If you encounter this problem during processing, you can try to improve it by adjusting parameters or workflow:

    1. Increase the overlapping area (Tile Overlap/Padding):
    • Most tiled super-resolution tools (such as Tiled VAE / Tiled Diffusion in Stable Diffusion, or standalone super-resolution software) allow setting the overlap pixel size.
    • Countermeasures: Increase the overlap pixels appropriately (for example, from 32 to 64 or 128). The larger the overlapping area, the smaller the impact of edge truncation and the more natural the blending transition will be.
    1. Adjust feathering/smoothing parameters (Tile Smoothing):
    • If blur remains in overlapping areas, it may be due to excessive feathering. Check whether there are parameters in the software that control the fusion intensity and appropriately reduce the width of the blend.
    1. Use more advanced seamless tile algorithm:
    • If it is super scores in AI painting (such as Stable Diffusion), it is strongly recommended to use the Tiled VAE or MultiDiffusion plug-in. They optimize the feature fusion of latent space or pixel space on the underlying algorithm, which is much better than the simple "cut image -> super resolution -> hard splicing and feathering", and can retain the texture sharpness to the maximum extent.
    1. **Use "whole image processing" as much as possible if the hardware allows: **
    • Tiling processing is essentially to compensate for insufficient video memory (VRAM). If conditions permit, try to slightly reduce the over-resolution magnification, or clear the background memory usage, turn off the tile function and directly perform over-resolution on the entire image. This is the most fundamental method to preserve texture and avoid seams.
  4. mayo-v commented on May 31, 2026

    @mayo-v
    Author
  5. Issues-translate-bot commented on May 31, 2026

    @Issues-translate-bot

    Bot detected the issue body's language is not English, translate it automatically.


    Hello, I'm really sorry that I just saw your email. I haven't used QQ mailbox recently. Thank you for your answer. Thank you.

    V
    @.***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions