DEV Community

wimdenherder
wimdenherder

Posted on

How to toonify yourself

Image description

Artificial intelligence is rapidly advancing, and it is now possible to utilize it to create a cartoon version of oneself. One can visit the website https://huggingface.co/spaces/PKUWilliamYang/VToonify to experiment with this technology. However, it should be noted that the server may be overwhelmed, leading to difficulties in accessing the video feature.

To overcome this issue, one can use the colab link and should first convert the video to the .mov format using the following command, which requires the installation of ffmpeg on one's computer:

ffmpeg -i <YOURVIDEO> -c:v libx264 -profile:v main -pix_fmt yuv420p -s 1280x720 -b:v 9710k -r 30 -g 30 -keyint_min 30 -c:a aac -ac 1 -ar 48000 -b:a 242k -strict -2 <OUTPUTNAME>.mov

Here is the link to the google colab page: https://colab.research.google.com/github/williamyang1991/VToonify/blob/master/notebooks/inference_playground.ipynb

You should execute the necessary steps, including uploading the video and rescaling it.

To download the resulting video, the traditional right-click method may not work. Instead, one must use the Chrome Developer Console by pressing cmd+shift+c and clicking on the video element to find the path, which will be in the format of "temp/output9f832f8huh".

Go to sidebar on the left with files
click .. to go to parent folder, and then open folder temp and the output file, click the dots to open menu to download it

Now mix it with original audio
ffmpeg -i <originalvideo>.mov -i <toonify-video>.mov -c:a copy -c:v copy -map 0:a -map 1:v -y <outputfile>.mov

Top comments (0)