Closed MaxJa4 closed 1 year ago
Dark images seem fixed, but regular / bright images lack brightness after the normalization. Investigating.
Turns out, the chainner function to_uint8
already has a normalization function - it just wasn't used.
I did the same as the internal normalization now does, just re-implemented. Then I found out about it.
Now, the black/white clipping is gone without any brightness issues.
Comparison:
Note: All chainner upscalers are fixed now, I just applied it to some in this example to show the difference.
Done from my side.
Just saw that you already found the issue. My last commit still used the numpy to_uint8 and not the chainner one. This PR can be closed now, I suppose.
Description
Addresses the clipping issue described in https://github.com/vladmandic/sd-extension-chainner/issues/6.
Only positive values were normalized before, not negative ones.
Notes
Offset approach: Adding the absolute of the min-value (negative) to the whole tensor/image and then normalizing resulted in a grayish dull image. --> not used Clamping approach: Best/proper results were achieved by just 'clamping' all negative clipping values to zero. --> implemented
Before
After