Hacker News new | ask | show | jobs
by tlack 883 days ago
how I wish it had a strength setting..

you can try blending the before and after with PIL but it will probably look even more disturbing

    strength = 0.5
    horrific_image = Image.blend(image_with_normal_skin_and_teeth, 
    kinda_awful_gfpgan_image, strength)
let me know if you find something better
1 comments

Fortunately, that is indeed a thing :) several post-processing tools have some sort of gfpgan_strength (searching as-is should yield results on a few repos) param being passed, also it's been a while since diffusion-based restoration methods are equipped to diminish stochasticity enough to produce great results, worth the time as well! Also noteworthy: https://openmodeldb.info/?t=faces+restoration+texture-genera...
In Auto1111, that just uses Image.blend. :)

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob...

Hah, so high tech- Turns out the said repos used to do the same, then one of them later added CodeFormer under the hood, conflated the strength with affinity and didn't bother renaming (calling codeformer --gfpgan_strength looks very unhinged to me but oh well haha). It's definitely doable though! What I had in mind as a GAN equivalent (used to apply in WSI context while back) is akin to Rayleigh EigenDirections in terms of latent space navigation https://www.ecva.net/papers/eccv_2022/papers_ECCV/html/7277_... There's some code out there, unsure if it's streamlined for this use case but can lend a hand if you decide to give it a shot :)