[Tip] De-uglyfying Faceswap under Linux

Installing and setting up FaceSwap


Forum rules

Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.

Locked
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 623 times

[Tip] De-uglyfying Faceswap under Linux

Post by torzdf »

 ! Message from: torzdf

Faceswap now installs a version of TK that displays fonts correctly. If you are still having display issues under Linux, you should reinstall faceswap

The instructions below are now obsolete, and should only be used as a measure of last resort

If you have installed Faceswap under Linux using the provided installer script, chances are that the fonts look ugly as all hell:

ugly.png
ugly.png (34.03 KiB) Viewed 34903 times

This is because Anaconda does not build TK with certain required libraries (for reference: https://github.com/ContinuumIO/anaconda ... ssues/6833)

There is a work around to fix this. It's a little hacky, but does work. I provide instructions below for Ububtu 20.04, but this should work for all Linux flavors with a slight change in commands to use your package manager.

  1. Firstly install tkinter for Python 3 for your system (amend this to the package name for tkinter and the installer for your distro if not using Ubuntu):

    Code: Select all

    sudo apt install python3-tk
    
  2. FInd where your system installs the library files for tkinter. For ubuntu this will be under /usr/lib/x86_64-linux-gnu/ You can locate the file with the following command:

    Code: Select all

    sudo find / -name libtk8.6.so
    
  3. Navigate to the library folder for your Faceswap Conda environment. The default location will be ~/miniconda3/envs/faceswap/lib so amend the below if you did not install Miniconda in the default location:

    Code: Select all

    cd ~/miniconda3/envs/faceswap/lib
    
  4. Backup the existing tkinter library file:

    Code: Select all

    mv libtk8.6.so libtk8.6.so.bk
    
  5. Finally create a symlink to you system tkinter library file. Make sure you amend the path below to the one you found in step 2:

    Code: Select all

    sudo ln -s /usr/lib/x86_64-linux-gnu/libtk8.6.so libtk8.6.so
    

Bask in your new found readability:

pretty.png
pretty.png (66.16 KiB) Viewed 34903 times
Last edited by torzdf on Fri Jan 05, 2024 5:36 pm, edited 1 time in total.

My word is final


Tags:
User avatar
tokafondo
Posts: 32
Joined: Mon Dec 16, 2019 1:43 pm
Has thanked: 10 times
Been thanked: 5 times

Re: [Tip] De-uglyfying Faceswap under Linux

Post by tokafondo »

Definitely works!! Thanks!!

User avatar
isokosan
Posts: 1
Joined: Tue Jan 05, 2021 5:52 pm

Re: [Tip] De-uglyfying Faceswap under Linux

Post by isokosan »

Works great! Thank you, looks way better.

User avatar
CarlosZcat
Posts: 4
Joined: Tue Dec 01, 2020 4:43 am
Has thanked: 4 times

Re: [Tip] De-uglyfying Faceswap under Linux

Post by CarlosZcat »

I followed these instructions carefully and it resulted in failing to start. I had no problems doing this in Linux Mint.

OS = Lubuntu 19.04 Disco Dingo

uname -a

5.11.0-38-generic #4220.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

python3 --version

Python 3.8.10

I just switched from Mint to Lubunto however, the Gui in Faceswap is really ugly and the fonts are very tiny.

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 623 times

Re: [Tip] De-uglyfying Faceswap under Linux

Post by torzdf »

That should work, so not sure why it hasn't, to be honest. Mine is tested working on Ubuntu 20.04

My word is final

Locked