All You Need to Animate Images with Speech for Free

SadTalker Demo

With advancements in technology, making images come to life by making them “talk” is now more accessible than ever. This blog post will guide you through the steps to animate images for free using an exciting tool called SadTalker. This tool allows you to create engaging and dynamic content without needing extensive technical expertise.

What is SadTalker?

SadTalker is a user-friendly application that animates still images, making them appear as if they are speaking. It utilizes advanced deep-learning techniques to map facial movements to audio input, creating a realistic talking effect on the chosen image. This can be especially useful for creating educational content, promotional materials, or simply for fun.

Getting Started with SadTalker

Step 1: Download and Install

To begin, you need to download SadTalker. You can find the latest version on their official website or GitHub page. The application is compatible with most operating systems, including Windows, macOS, and Linux.

Step 2: Prepare Your Image

Select the image you want to animate. For best results, choose a clear and high-resolution image where the face is prominently visible. SadTalker works best with frontal face images, but it can handle slight angles as well.

Animate Images correctly

Step 3: Audio Input

Next, you need an audio file of the speech you want the image to mimic. This could be a recording of your voice, a professionally recorded script, or any audio file that suits your needs. Ensure the audio is clear and of good quality to enhance the synchronization. I used AI-generated audio for my sample.

Step 4: Animate the Image

Open SadTalker on hugging face space and import your image and audio file. The interface is intuitive, guiding you through the necessary steps to combine the image and audio. The application processes the inputs and generates a video where the image appears to be talking.

Step 5: Export and Share

Once the animation is complete then you can preview the result within the application. If you’re satisfied with the outcome, then export the video in your desired format. SadTalker supports various output formats suitable for different platforms, including social media, websites, and presentations.

Animate Images on Windows

Step 1: Install Python 3.8

  1. Install Python 3.8 and check “Add Python to PATH”.
  2. Only Python 64bit worked for me.
  3. If you do not know how install Python 3.8 then follow this tutorial (I just googled it)

Step 2: Install ffmpeg

  1. following this tutorial or using scoop

Step 3: Download SadTalker from GitHub

If you are familiar with GIT then use https://github.com/OpenTalker/SadTalker.git to clone the repository on your PC otherwise:

  1. open the GitHub page
  2. click on the green “Code” button, and select “Download ZIP”.
  3. Extract the content off the downloaded file (SadTalker-main.zip) by right-clicking on it in the “Download” folder and selecting “Extract All…”.
  4. Press “Extract” in the popup window
  5. Navigate to C:\Users\<your username>\Downloads\SadTalker-main\SadTalker-main

Step 4: Download the Pre-Trained Models(checkpoints) and gfpgan models

  1. Download Pre-Trained Models from Google Drive.
  2. Extract the content and copy the checkpoints folder inside the “SadTalker-main” or “SadTalker” depending on how you did Step 3.
  3. Download gfpgan from Google Drive.
  4. Again Extract the content and copy the gfpgan folder in the “SadTalker-main” or “SadTalker” folder.

Step 5: Run the application

Run the “webui.bat” file. If everything works fine then the application will ask you to run the web app on the local URL: http://127.0.0.1:7860. However, this was not the case for me and that is why I decided to write this tutorial.

  • First, delete the venv folder that was created after your last run.
  • Change the bat file to the following:

@echo off

IF NOT EXIST venv (
C:\Users\<your username>\AppData\Local\Programs\Python\Python38\python.exe -m venv venv
) ELSE (
echo venv folder already exists, skipping creation…
)
call .\venv\Scripts\activate.bat

set PYTHON=”venv\Scripts\Python.exe”
echo venv %PYTHON%

%PYTHON% -m pip install –upgrade pip
%PYTHON% -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 –extra-index-url https://download.pytorch.org/whl/cu113
%PYTHON% -m pip install gradio==3.41.2

%PYTHON% Launcher.py

echo.
echo Launch unsuccessful. Exiting.
pause

  • The first change is to force the app to use Python 3.8 to create the virtual environment. if that is the only Python you have then you can use the original command: python -m venv venv
  • pip install –upgrade pip only update your pip.
  • torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 is necessary to use GPU rather than CPU. I have an RTX 4080 Graphic card and i9 13th 13900k CPU and the difference is not comparable.
  • gradio==3.41.2 fixes the UI error.
  • Run the “webui.bat” file again and you should be able to open the web app at http://127.0.0.1:7860.

Tips for Best Results

  • High-Quality Images: Use high-resolution images with clear facial features.
  • Clear Audio: Ensure the audio file is of high quality with minimal background noise.
  • Frontal Faces: Images with frontal facial views yield the best animation results.

Applications of Talking Images

Educational Content

Animated images can make educational content more engaging. For instance, historical figures can “speak” about their lives, making history lessons more interactive and enjoyable.

Marketing and Promotion

Businesses can use talking images in their marketing campaigns to create eye-catching advertisements and personalized messages from company mascots or representatives can add a unique touch to promotional materials.

Social Media and Entertainment

For social media influencers and content creators, talking images can add a fun and creative element to their posts, making their content stand out.

Conclusion

Creating talking images is no longer a complex task reserved for tech experts. With tools like SadTalker, anyone can animate images and bring them to life effortlessly. Whether you’re an educator, marketer, or just someone looking to have fun with your photos, SadTalker provides an accessible and free solution to make your images talk.

Give SadTalker a try and explore the endless possibilities of animated images! For more detailed instructions and updates, visit the official SadTalker page here.

I hope you enjoyed this post. Please check my AI Stand-Up: Funny Story on How to NOT Use AI.

Scroll to Top