Enhanced Unsharp Mask in PhotoFlow - please test!

The guided filter generates a variance-dependent blending between the original and the blurred images. The higher the variance is locally, the lower is the weight of the blurred image. However, such weight is never 0, so some degree of blurring (and therefore of halos) is always present. This gets accentuated when the number of scales is increased, because of the contribution of blurs at larger radii. For example, with radius=3 and 6 scales one gets contributions (with decreasing strength) from radii of 3, 6, 12, 24, , 48 and 96 pixels!

yes, because almost all transitions are considered “edges” and therefore not blurred by the underlying guided filter.

Yes, because of the contribution of larger radii that adds some “local contrast” to larger-scale variations on top of the sharpening of small textures.

With 1 scale, all the sharpening comes from the blur at the base radius (3 pixels in your example). When you increase the number of scales, contributions at larger radii are introduced that “replace” the one at 3 pixels, so sharpening of small textures is decreased…

Personally I would suggest to start with a base radius of 1 and 3 scales, at least if the goal is to sharpen fine details. I will also tweak a bit the relative strength of the scale contributions, lowering the weight of larger radii.

I will check what is going on, although I consider the “show mask” feature mostly a temporary diagnostic tool while developing the filter.