Installing Magic Animate on Windows (Requires over 100 GB disk space (see description), NVIDIA GPU)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today we will be using magic anime to make a picture like this one of Mona Lisa come to life with Movement we will use this running animation as the input movement and now Mona Lisa is running so input image input animation output video of the input image moving in the animation we will also look at how to make our own input animation with our own video in this example here is a 4sec clip this was not a good example it turns out because the scaling of Mona Lisa in the input image and of Napoleon in the Dan video is significant as this one is much smaller this ends up being the resulting video oh dear but you get the idea you can use your own custom video that is scaled with a similar size unlike this example anyways let's get to it I created a fork of magic animat with changes needed to get it running on Windows we will create a new cond environment with python 3.10 I will leave a link to the prerequisite video in case you don't have cond we will also need get an FFM Peg installed from the prerequisite video at the very least next we will clone this repository using G clone and then we will install dependencies you may want to make sure ffmpeg is installed by running the ffmpeg command from a command prompt to see if it Returns the version information indicating it is installed let's install the dependencies from the requirements text file then we must download the pre-trained models we first need to create a new folder in this directory I am going to do it using the make directory command like this instead of through File Explorer because why not and here is the new folder we will need to CD into the folder and install the models using the three separate kit clone commands notice the git lfs installed to enable large file downloads and at the end we CD back to the root directory of the application in this command block I already downloaded the models earlier so I won't run the free git clone commands in this video but you would need to run the free commands once you run the three commands to download then CD back to the root folder of the app here is the pre train folder to which I downloaded earlier which contains the three subfolders one for each of the kit clone commands fair warning the downloads are huge over 100 gigabytes with that done we can launch the gradio web UI here we have the box where the result will go an input reference image and a motion sequence along with other settings later we will will look at creating our own custom motion sequence from an input video but for now we will use one of the buil-in ones I will scroll down and click the built-in example input image and motion sequence and then click animate this one is a Mona Lisa and then the sequence is someone running let's click animate and see what happens it will show the gradio loading icon in the result we can go to the cond prompt to track the progress it is using 100% of the GPU and Cuda during the entire time it is is finished let's take a look great note that the movement sequence person size should be about the same as the input image person size because if it is not we saw what happens with the Napoleon dance video example at the beginning this video is stored in the demo outputs folder but notice how the generated video shows us the two inputs and the one output in one video well what if we just want that one output of mod Lisa running in the video well we can run the other inference command for that I am going to control C to cancel out of the web UI app then on the GitHub page if we scroll down to the inference command we can call that command to run inference which will give us just Mona Lisa running let's first open this config file called animation. yaml it is in the configs prompts folder this lists all the inputs I am going to delete everything but the Mona Lisa image for the input image and delete everything except for the running animation for the input video and then save this config file now let's copy paste and run this inference command once it finishes go into the samples folder then the folder for the latest timestamp and then videos there will be the video with just Mona Lisa running and a folder with the video of all three like what we saw earlier from gradio next let's use a custom input video to create the movement animation for that we will be using this GitHub repository this currently doesn't work on Windows we can use WSL to run it locally but for this video I will just use the Google collab click on this link to open in Google coner run the first two cells to install the libraries while once that finishes scroll down to the next section here we will provide the input video and the desired output motion animation video name let's take a look at the input video I plan to use for best results use a video that has a person with about the same size as the person in the input image you are using I did not take my own advice just drag and drop the video to the Google collab below the folders in the box that says to upload them to session storage once that finishes we will see the video file listed on the left we must remember to change the input file name to match the name of the file we uploaded and we can leave the output file name as is for now after updating the file name we can run this cell when it finishes refresh the files on the left to see the new output file click the three dots and download the file let's take a look we can use this file as the input video when using the gradio app or as the video for when using the inference command I am going to rename it to be more descriptive and then drag and drop it to where the other animation videos are located for convenience when we modify the config file in the inputs applications driving dense post folder the recommended frame width and height of this animation video is 512 x 512 if we check any of the existing animation videos they are going to all be 512 x 512 the frame width and height of the one we generated from Google collab is going to take on the same frame width and height of the input video used this might work fine or you might be able to change the config value from 512 to something to match your video but I will just use this FFM command to change the frame width and height to 512 I am going to open another prompt window and CD to this folder and then run this command I will leave this command in the description it will create a new video copy of our animation video but we have a frame width and height of 512 CD to the folder copy paste and run the command now let's look at the generated videos properties to make sure it is the 512 x 512 great now I had ran the original video and then this video through the inference command but the progress wouldn't make it past 0% so I decided I would shorten the video from the current 6 seconds down to 4 seconds using another ffmpeg command here is the ffmpeg command that will take that video and create another video with just the first 4 seconds copy paste and run it spoiler alert this one also stayed at 0% for a long time I ended up just waiting for a while and it eventually started making progress so maybe I just needed to be more patient and here is the animation video with Just 4 seconds and 512 by 512 let's copy paste the file name to the config file as the input video to use for the animation under the video path we can specify this new file and then go back to the cond prompt and rerun the inference command this is where it would take a very long time at 0% I ended up quitting out the previous two times with the original one and with the 512x 512 6C Clips but this time I just waited for a long time it is finally progressing and is now at 4% on this GitHub comment it is mentioned to also have the FPS at 25 and to Center crop it and then resize and change the FPS I didn't Center cropet or change the FPS in my example but doing this should provide better results in addition to the size of the animation person being similar to the size of the image person 84 years later it has finally finished let's go to the folder where the results are stored and take a look even though we already know how it looks from the beginning of this video also you can use your own custom input image instead of the default Mona Lisa one but I ended up just using the Mona Lisa one in the example today that looks very interesting also your input video and image should have the same number of people otherwise you will get even more interesting results as I randomly click on folders and files here while I talk this application to run locally will require over 100 gab of disk space from the downloaded models and will require a GPU I have an RTX 3060 with 12 GB of RAM and generating the custom video took a long time as this technology and appc ation improves I am sure they will have improvements and enhancements as time goes on I am just going to watch this video in a loop and become hipnotized with the 4C dance clip over and over again maybe just for fun I might upload a 1our YouTube video with this 4C clip playing in a loop for the entire 1 hour that sounds like a fantastic idea that triggered an Alber appearance I will use that as the thumbnail for this video anyways that is all for now thanks for watching
Info
Channel: Natlamir
Views: 2,646
Rating: undefined out of 5
Keywords:
Id: Zie-TLS5ze8
Channel Id: undefined
Length: 10min 28sec (628 seconds)
Published: Thu Dec 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.