[SD Advanced Tutoria]Make an Animated GIF Using SD

[SD Advanced Tutoria]Make an Animated GIF Using SD

AI  Learning Assistant No 1
AI Learning Assistant No 1
August 22nd, 2023

Stable Diffusion AI is a great way to synthesize images from text. Do you can spice up your artworks with animation?

In this step-by-step guide, we will add an animated waterfall and moving clouds to the image of a fantasy steam punk castle shown below. The prompt for generating this image can be found in this page.

After this tutorial, you will be able to recreate this final animated GIF image:

Stable Diffusion GUI

We will need to use a more advanced Stable diffusion GUI for this tutorial. Most online generators won’t cut it. We will use this GUI. See my quick start guide for setting up in Google’s cloud server.

Starting image

The prompt and parameters necessary to generate the original image can be found in this page. Alternatively, you can save the following image to your computer for this tutorial.

Starting image for this tutorial.

Step 1: Add a waterfall

We will use inpainting to add the waterfall.

In the Stable Diffusion GUI, go to img2img tab and select the inpaint tab.

Upload the starting image by dragging and dropping it to the inpaint image box.

Use the paintbrush tool to create a mask like below. The masked area is where the waterfall will be located.

Inpaint mask for the waterfall.

Put in the following settings:



Sampling method


Sampling steps




Batch size


Parameters for inpainting the waterfall

Hit Generate. You should get 8 different images with a waterfall added.

Increase CFG value if you see an unwanted object. Decrease it if you prefer to have more variations.

Hit generate again until you see an image you like. Save that image to your computer.

I picked the image below for the castle image with waterfall added.

Waterfall added by inpainting.

This image will be our base image for the animated GIF. In the next step, we will create small variations of this image and use them as the frames for the animated GIF.

Step 2: Animate the water fall and the clouds

An animated GIF is nothing but a series of images displayed consecutively. The variations between images should be subtle but noticeable in order to create a perception of animation.

To do so, we first drag and drop the castle image with the waterfall to the inpaint box.

Create the inpaint mask like below.

Inpaint mask for animating the cloud and the waterfall.

Use the following parameters for inpainting.


cloudy, steam

Sampling method


Sampling steps




Denoising strength


Batch size


Parameters for inpainting the waterfall

Recall we don’t want to change the image too much so using a low denoising strength like 0.2 is very important. (Recall that denoising strength of 0 changes nothing and at 1 your original image in the masked area will be completely ignored.)

Below are a few images I generated. If you pay close attention, you should see they have small differences.

You will want to cherry-pick the images you want to use for the animated GIF.

You will need 5 to 10 images. Save them to your computer.

Increase denoising strength if you want more variations. Decrease if you want less.

Step 3: Create the animated GIF

Now we will make the animated GIF.

You can use any tool of your choice but in this tutorial we will use the free site ezgif.com. Upload the images of your choice by using the “Choose Files” button and then clicking the “Upload and make a GIF!” button.

In the next screen, check the “crossfade frames” under the “Effects” section and click “Make a GIF!”

Finally, save the animated GIF. The animated GIF should look like:

Animated waterfall and moving clouds added.

For comparison, this is the animated GIF created with denoising strength 0.1.

Animated GIF created with denoising strength 0.1. The variation is more subtle.

Tweaks for your own artwork

Note that the settings in this article are specific for the image we used. You may need to play with the following parameters when you create your own artworks.

  • Prompts for inpainting: Change to what you want to add in place of the mask.
  • CFG: Increase if you see irrelevant objects or too much variations.
  • Denoising strength: Increase if you want more changes in your animated GIF.
  • GIF delay time and crossfade parameters: Adjust to smooth out the animations.

Reprinted from View Original
Collection Navigation
# 1 [SD Advanced Tutoria]How to fix parameters?
# 2 [SD Advanced Tutorial]How to automatically fix faces and hands
# 3 [SD Advanced Tutorial]How to run SDXL models
# 4 [SD Advanced Tutorial]Speed up Stable Diffusion
# 5 [SD Advanced Tutorial]3 ways to control lighting in Stable Diffusion
# 6 [SD Advanced Tutorial]Video to video with Stable Diffusion
# 7 [SD Advanced Tutorial]3 methods to upscale images in SD
# 8 [SD Advanced Tutorial]Control image composition in SD
# 9 [SD Advanced Tutorial]How to generate animals in SD
# 10 [SD Advanced Tutorial]How to make a video with SD
# 11 [SD Advanced Tutorial]How to generate realistic people in SD
# 12 [SD Advanced Tutorial]Stable Diffusion SDXL Beta Model
# 13 [SD Advanced Tutorial]SD Samplers: A Comprehensive Guide
# 14 [SD Advanced Tutorial]Midjourney vs SD: Which one should you pick?
# 15 [SD Advanced Tutorial]What is hypernetwork
# 16 [SD Advanced Tutorial]AUTOMATIC1111: A Beginner’s Guide
# 17 [SD Advanced Tutoria]What are LoRA models and how to use them in AUTOMATIC1111
# 18 [SD Advanced Tutoria]ControlNet v1.1: A complete guide
# 19 [SD Advanced Tutoria]How to remove extra limbs with Stable Diffusion inpainting
# 20 [SD Advanced Tutoria]Stable Diffusion prompt: a definitive guide
# 21 [SD Advanced Tutoria]Instruct Pix2Pix: Edit and stylize photos with text
# 22 [SD Advanced Tutoria]How to use outpainting to extend images
# 23 [SD Advanced Tutoria]ChatGPT: How to generate prompts for Stable Diffusion
# 24 [SD Advanced Tutoria]How to run Stable Diffusion on Google Colab (AUTOMATIC1111)
# 25 [SD Advanced Tutoria]Stable Diffusion Installation Tutorial (Mac M1/M2)
# 26 [SD Advanced Tutoria]How to use negative prompts?
# 27 [SD Advanced Tutoria]How does negative prompt work?
# 28 [SD Advanced Tutoria]How does Stable Diffusion work?
# 29 [SD Advanced Tutoria]Stable Diffusion Workflow
# 30 [SD Advanced Tutoria]Depth-to-image in SD 2
# 31 [SD Advanced Tutoria]How to install SD on Windows
# 32 [SD Advanced Tutoria]How to use embeddings in Stable Diffusion
# 33 [SD Advanced Tutoria]How to install Stable Diffusion 2.1 in AUTOMATIC1111 GUI
# 34 [SD Advanced Tutoria]How to cartoonize photo with Stable Diffusion
# 35 [SD Advanced Tutoria]How to use Dreambooth to put anything in Stable Diffusion (Colab notebook)
# 36 [SD Advanced Tutoria]How to use VAE to improve eyes and faces
# 37 [SD Advanced Tutoria]Turn amateur into professional with img2img
# 38 [SD Advanced Tutoria]How to use AI image upscaler to improve details
# 39 [SD Advanced Tutoria]How to run Stable Diffusion 2.0 and a first look
# 40 [SD Advanced Tutoria]A Beginner's Guide to SD Models
# 41 [SD Advanced Tutoria]How to stylize images using Stable Diffusion AI
# 42 [SD Advanced Tutoria]Basic information of Stable Diffusion
# 43 [SD Advanced Tutoria]Top Free Stable Diffusion AI Image Generator Sites
# 44 [SD Advanced Tutoria]Image AI generates fashion ideas
# 45 [SD Advanced Tutoria]Make an Animated GIF Using SD
# 46 [SD Advanced Tutoria]Common Problems in AI
# 47 [SD Advanced Tutoria]Change prompt word parameters
# 48 [SD Advanced Tutoria]AI removes unwanted objects
# 49 [SD Advanced Tutoria]Fine-tune AI images with tips
# 50 [SD Advanced Tutoria]What is Stable Diffusion?


no dataCoffee time! Feel free to comment