Face gets darker and I don't think the hands are being detected.
Closed this issue · 6 comments
Links weren't showing right on my end. So here they are.
With After Detailer
https://shibiko.ai/outputs/2023-08-13_12-36-34.png
Without After Detailer
https://shibiko.ai/outputs/2023-08-13_09-33-24.png
I still don't have any idea about this issue.
So I updated to the latest, but still get discoloration. It seems like the image either loses contrast or brightness.
In order to test this I modified some code to test things.
def composite(
init: Image.Image,
mask: Image.Image,
gen: Image.Image,
bbox_padded: tuple[int, int, int, int],
composite_image_enhance: dict[str] | None = None,
) -> Image.Image:
img_masked = Image.new("RGBa", init.size)
img_masked.paste(
init.convert("RGBA").convert("RGBa"),
mask=ImageOps.invert(mask),
)
img_masked = img_masked.convert("RGBA")
size = (
bbox_padded[2] - bbox_padded[0],
bbox_padded[3] - bbox_padded[1],
)
resized = gen.resize(size)
output = Image.new("RGBA", init.size)
output.paste(resized, bbox_padded)
enhance_keys = ["sharpness", "color", "contrast", "brightness"]
if composite_image_enhance is not None and any(key in composite_image_enhance for key in enhance_keys):
if "sharpness" in composite_image_enhance:
output = ImageEnhance.Sharpness(output).enhance(composite_image_enhance["sharpness"])
if "color" in composite_image_enhance:
output = ImageEnhance.Color(output).enhance(composite_image_enhance["color"])
if "contrast" in composite_image_enhance:
output = ImageEnhance.Contrast(output).enhance(composite_image_enhance["contrast"])
if "brightness" in composite_image_enhance:
output = ImageEnhance.Brightness(output).enhance(composite_image_enhance["brightness"])
else:
output = ImageEnhance.Brightness(output).enhance(1.0875)
output = ImageEnhance.Contrast(output).enhance(1.05)
output.alpha_composite(img_masked)
return output.convert("RGBA")
I added this composite_image_enhance
to the __call__
and composite()
call.
I found that increasing the brightness from ~1.05 to ~1.08 and combining it with increasing the contrast by ~1.01 to ~1.03, the image looks normal or at least very close to it.
Black hair and dark backgrounds are usually the easiest to test with as a coloration tint is noticeable. Black starts to get a greenish tint to it.
If it helps I do use Abyss Orange Mix 3