Gourieff / comfyui-reactor-node

Fast and Simple Face Swap Extension Node for ComfyUI
GNU General Public License v3.0
1.36k stars 128 forks source link

[Feature]: codeformer_fidelity (done) and codeformer_scale support #129

Open Arcitec opened 9 months ago

Arcitec commented 9 months ago

Feature description

codeformer_fidelity

After seeing what https://github.com/mav-rik/facerestore_cf can do with its codeformer_fidelity parameter, I realize that it's an incredibly important aspect of face restoration.

Without that parameter, face restore in ReActor node is almost useless.

I could set ReActor to face restore "none" and route the output to the separate "facerestore_cf" node, yes, but this is slower because that means it has to do face-detection twice. So it's better if codeformer_fidelity parameter is supported in ReActor.

It's gives a HUGE quality increase! :)

codeformer_scale

This 2nd parameter is something I just discovered now and haven't seen before. You can read about it in this article:

https://blog.segmind.com/best-settings-for-codeformer/

Basically, scale is how detailed and what resolution the output face will be. It's another huge quality increase. Look:

image

Why?

Together, fidelity and scale makes codeformer face restore quality massively improved!

Would be a huge improvement for ReActor node. The current face restoration in reactor-node is operating at like 30% of the quality that can be achieved if those parameters are added. :)

Gourieff commented 8 months ago

Thanks for the info 👍 I will take a look

ardha27 commented 8 months ago

Feature description

codeformer_fidelity

After seeing what https://github.com/mav-rik/facerestore_cf can do with its codeformer_fidelity parameter, I realize that it's an incredibly important aspect of face restoration.

  • GFPGan: Doesn't support it/doesn't use that parameter.
  • CodeFormer: Requires that parameter. At 0, the face looks nothing like the input but becomes very aesthetic. At 0.5 it's a mix. At 1.0 it very closely matches the input face but becomes high resolution. This usually produces the best faces.

Without that parameter, face restore in ReActor node is almost useless.

I could set ReActor to face restore "none" and route the output to the separate "facerestore_cf" node, yes, but this is slower because that means it has to do face-detection twice. So it's better if codeformer_fidelity parameter is supported in ReActor.

It's gives a HUGE quality increase! :)

codeformer_scale

This 2nd parameter is something I just discovered now and haven't seen before. You can read about it in this article:

https://blog.segmind.com/best-settings-for-codeformer/

Basically, scale is how detailed and what resolution the output face will be. It's another huge quality increase. Look:

image

Why?

Together, fidelity and scale makes codeformer face restore quality massively improved!

Would be a huge improvement for ReActor node. The current face restoration in reactor-node is operating at like 30% of the quality that can be achieved if those parameters are added. :)

can i find "codeformer_scale" on comfyui?

Gourieff commented 8 months ago

codeformer_fidelity is implemented https://github.com/Gourieff/comfyui-reactor-node/commit/ea536a43c8527341f1426d19ca438b4a0329d9e1

KINGLIFER commented 8 months ago

May I at least inquire how to implement codeformer_scale

Gourieff commented 8 months ago

But why do you need this option? You can scale with any model you want via Upscaler's Nodes or via Ultimate Upscaler

KINGLIFER commented 8 months ago

No this is the face because of the limitations. I made something that upscales a face but why have all those nodes when one can do it itself.

Gourieff commented 8 months ago

Because it's not the best way to upscale, there are a lot of models that can provide better quality

KINGLIFER commented 8 months ago

for the details of a faceswap? Can you be more specific?