How to create infinite AI video using Deforum & Stable diffusion

Rudraksh Dixit
3 min readMay 30, 2023

--

You must have encountered this viral TikTok & Reels trend to create infinite AI videos. Here’s how to make it.

Download stable diffusion

Clone the below GitHub repo and follow the installation instructions

https://github.com/AUTOMATIC1111/stable-diffusion-webui

After cloning the repo, cd into the folder and run the command

./webui.sh 

Open the local address(http://127.0.0.1:7860) in the terminal

Goto Extensions tab -> Load from -> Install Deforum

After installing, click to apply and restart in the installed tab of Stable diffusion

Download RevAnimated model inside models->Stable-diffusion folder

Restart the service and you should see this, select Deforum tab

Change the settings of Run tab to:

Note: Increasing step size will increase the time to generate the clip and
decreasing will cause less similar images in the clip

In KeyFrame :

Note: Max frames decides the length of the video, more the frames longer it's 
going to take to generate

for Strength tab in KeyFrame

Strength schedule
0: (0.65), 25:(0.55)

Translation X
0:(0), 30:(15), 210:(15), 300:(0)

Translation Y
0: (0)

Translation Y
0:(0)

Translation Z
0:(0.2), 60:(10), 300:(15)

Rotation 3D X
0:(0), 60:(0), 90:(0.5), 180:(0.5), 300:(0.5)

Rotation 3D Y
0:(0), 30:(-3.5), 90: (-2.5), 180:(-2.8), 300:(-2), 420:(0)

Rotation 3D Z
0:(0), 60:(0.2), 90:(0), 180:(-0.5), 300:(0), 420:(0.5), 500:(0.8)

For Noise tab in Strength

Change Noise schedule to:

0:(-0.06*(cos(3.141*t/15)**100)+0.06)

for Depth warping and FOV

Prompts tab

Enter prompts in JSON format where the key is the frame number and the value will be a description of generated frames. More the steps in the Run tab, the more accurately the clips will be generated here

In Init tab you can add the picture for starting frame, it can be a web URL or a local URL

Click Generate on the right to generate your clip. Download FFMPEG first to generate a video

Note: FFMPEG is required to generate the video, otherwise only images will be
saved in the folder
Note: Video takes a lot of time to generate. 

Your clip will be saved in stable-diffusion-webui -> output -> img-to-img, select the project folder and it will contain a video file and generated images for each frame.

Video reference: here

--

--

Rudraksh Dixit
Rudraksh Dixit

Written by Rudraksh Dixit

MERN stack developer, Trader, EDM enthusiast

Responses (1)