lllyasviel / IC-Light

More relighting!
Apache License 2.0
4.82k stars 326 forks source link

Preserve the high-frequency component (fine details) in the original image #42

Open woct0rdho opened 3 months ago

woct0rdho commented 3 months ago

Nice work! I'm already using it in our indie game dev. I see some people complaining that the AI will change details in the original image, so I just want to mention that we can separate the high-frequency component from the original image and replace it into the processed image.

We can use, e.g. Erasing Appearance Preservation to separate the base color and the high-frequency component, for which I have a Python implementation here

Result of replacing high-frequency component

fewjative commented 3 months ago

Am I correct in that the right most image in the row of 3 is your IC-light output and then the final is essentially a composite of high frequency + IC light?

woct0rdho commented 3 months ago

The top left one is the original image, the top center one is the low frequency of the original image (so the difference between the two is the high frequency), and the top right one is the low frequency of the processed image

loboere commented 3 months ago

The code does not have the subtraction and addition part, can you add it please?

woct0rdho commented 3 months ago

The code does not have the subtraction and addition part, can you add it please?

We have another (rather trivial) script here, and in real use there can be more pipeline between the two scripts

tttonyalpha commented 3 months ago

@woct0rdho Nice results! Did you use a foreground cutout pipeline from here or a pipeline from here, or you write another pipeline?

OlegRuban-ai commented 1 week ago

Hello! Can you show how you apply the code with LC Lights? It is not clear at what step you use the results obtained by cutting out the background and applying its embeddings in t2i/i2i pipelines