Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added super-resolution using GFPGAN and CodeFormer #117

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

A1Kumari
Copy link

@A1Kumari A1Kumari commented Feb 8, 2025

Enhanced Pipeline with Super-Resolution

How to Run

  1. Set up the environment:

    bash setup_env.sh
  2. Download the required checkpoints:
    GFPGAN: GFPGANv1.3.pth
    CodeFormer: codeformer.pth

    Place the checkpoints in the checkpoints/ directory.

  3. bash inference.sh --superres [GFPGAN/CodeFormer]


** Summary of Changes**

Here’s a brief explanation of what changes I made to each file:

File: latentsync/pipelines/lipsync_pipeline.py

  • Changes:
    • Added a helper function apply_superres to apply GFPGAN or CodeFormer.
    • Modified the __call__ method to calculate the resolution ratio and apply super-resolution if necessary.

File: inference.py

  • Changes:
    • Added a new argument --superres to allow users to choose between GFPGAN and CodeFormer.

File: inference.sh

  • Changes:
    • Updated the script to include the --superres parameter.

@chunyu-li
Copy link
Collaborator

Good work! 👍
I've been quite busy recently. I'll check this and merge it once I have some free time.

@SantiagoSchez
Copy link

SantiagoSchez commented Feb 13, 2025

I think some more changes are needed in this PR, as running gradio_app.py won't work anymore. Also, what codeformer package are you using for Python? None has the CodeFormerRestorer class as used in code. And GFPGAN 1.3.0 throws some errors due to conflicts with other dependencies; as a workaround, a version that worked for me was installing via pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary.

EDIT: this is just an AI hallucinating. Probably the author of the PR didn't even test it, as it doesn't work.

@romain130492
Copy link

Is implementing Codeformer in the roadmap @chunyu-li ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants