Bing-su/asdff

Face gets darker and I don't think the hands are being detected.

Closed this issue · 6 comments

So the face oddly gets darker when using the pipeline and I don't notice hands getting fixed like in a11. How do I adjust it so the face isn't so dark.any way to focus on what we are selecting? Like face only, hands only, etc. Are there any models to change how the eyes are generated? Thanks!

With After Detailer
Without After Detailer

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

@Bing-su Mind taking a look?

I still don't have any idea about this issue.

I'm starting to think that it doesn't apply the VAE. When I try to simply brighten the section, it gets kinda close to the right brightness, but the color is off. @Bing-su @yangdeai

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

Screenshot_20231123-171208.png

So I've found these settings make the best results, fixing the color, contrast, and brightness. But it now is making me wonder if it is not properly using the VAE