How to Set Up and Use Stable Diffusion Deforum Notebook for AI Animations in Google Colab

Key moments:
1:15 Download the Models
1:35 Set Up Google Drive
3:42 Set Up the Nvidia Gpu
4:37 Connect to Google Drive
6:03 Animation Modes
6:37 Interpolation
11:10 Animation Prompts
15:13 Create Video from Frames

In this Deep Learning Tutorial, We’ll take a look at How To Generate AI Images and Art with Stable Diffusion in google colab. First of all, we will take a look at how to set up the notebook and the settings. Then we will see some examples of AI-generated images from text prompts and create a frame interpolation video.

⭐Enroll in OpenCV GPU Course: https://nicolai-nielsen-s-school.teachable.com/p/opencv-gpu-course
⭐Enroll in YOLOv7 Course:https://nicolai-nielsen-s-school.teachable.com/p/yolov7-custom-object-detection-with-deployment

Colab Notebook: https://colab.research.google.com/github/deforum/stable-diffusion/blob/main/Deforum_Stable_Diffusion.ipynb

Patreon: https://www.patreon.com/thecodinglibrary/membership

Join as a member or Patreon to get access to exclusive perks:
https://www.youtube.com/channel/UCpABUkWm8xMt5XmGcFb3EFg/join

GitHub: https://github.com/niconielsen32

Join the public Discord chat here: https://discord.gg/5TBkPHHZA5

We will go more in-depth with some of the mentioned elements in future videos. I’ll be doing other tutorials alongside this one, where we are going to use C++ for Algorithms and Data Structures and Artificial Intelligence. The purpose of this tutorial and channel is to build an online coding library where different programming languages and computer science topics are stored in the YouTube cloud in one place.

Feel free to comment if you have any questions about the things I’m going over in the video or just in general, and remember to subscribe to the channel to help me grow and make more videos in the future. 🙂

Tags for the video:
#StableDiffusion #PretrainedModels #DeepLearning

17 Comments

  1. I followed all the steps exactly but there seem to be some errors in the code in "Run". Can you help? It stops after 0s and displays the following at the bottom of the Run section:

    —————————————————————————
    NameError Traceback (most recent call last)
    <ipython-input-54-cb30409e1f82> in <module>
    480 # dispatch to appropriate renderer
    481 if anim_args.animation_mode == '2D' or anim_args.animation_mode == '3D':
    –> 482 render_animation(args, anim_args)
    483 elif anim_args.animation_mode == 'Video Input':
    484 render_input_video(args, anim_args)

    1 frames
    <ipython-input-45-b7a5e2b7dd7f> in generate(args, return_latent, return_sample, return_c)
    296 os.makedirs(args.outdir, exist_ok=True)
    297
    –> 298 sampler = PLMSSampler(model) if args.sampler == 'plms' else DDIMSampler(model)
    299 model_wrap = CompVisDenoiser(model)
    300 batch_size = args.n_samples

    NameError: name 'model' is not defined

    It also highlights this line of code underlined in red

    # sample the diffusion model
    sample, image = generate(args, return_latent=False, return_sample=True)

  2. Hey, thanks a lot for this tutorial.

    I'm getting this error every time I try to Create video from frames…

    ————————-

    /content/drive/MyDrive/AI/StableDiffusion/2022-09/20220903000939_%05d.png -> /content/drive/MyDrive/AI/StableDiffu'/content/drive/MyDrive/AI/StableDiffusion/2022-09/sion/2022-09/20220903000939.mp4

    —————————————————————————

    ValueError Traceback (most recent call last)

    <ipython-input-13-3c866f80e278> in <module>

    24 fname = f"{path_name_modifier}_%05d.png"

    25 all_step_dirs = [os.path.join(args.outdir, d) for d in os.listdir(args.outdir) if os.path.isdir(os.path.join(args.outdir,d))]

    —> 26 newest_dir = max(all_step_dirs, key=os.path.getmtime)

    27 image_path = os.path.join(newest_dir, fname)

    28 print(f"Reading images from {image_path}")

    ValueError: max() arg is an empty sequence

    —————————————————————————–

    What I'm missing?

  3. Sorry to bother. I'm getting this error:
    ValueError Traceback (most recent call last)

    <ipython-input-9-454b1046edd9> in <module>

    24 fname = f"{path_name_modifier}_%05d.png"

    25 all_step_dirs = [os.path.join(args.outdir, d) for d in os.listdir(args.outdir) if os.path.isdir(os.path.join(args.outdir,d))]

    —> 26 newest_dir = max(all_step_dirs, key=os.path.getmtime)

    27 image_path = os.path.join(newest_dir, fname)

    28 print(f"Reading images from {image_path}")

    ValueError: max() arg is an empty sequence

    cana you help me?

  4. Smart video. Slow down and speak a little more pronounced for clarity please. you can speak well and coherently but you are mumbling a little bro. i can see you making good tutorials. subbed and liked.

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2024 AI Art Video Tutorials