-
-
Notifications
You must be signed in to change notification settings - Fork 358
Essential AI Tools and Libraries A Guide to Python Git C Compile Tools FFmpeg CUDA PyTorch
Full tutorial link > https://www.youtube.com/watch?v=-NjNy7afOQ0
Follow newer video : https://youtu.be/DrhUHnYfwC0
Welcome to the Pillars of AI Application Libraries: How to Install Tutorial! 🤖 Are you ready to embark on a journey of installing AI libraries and applications with ease? 💻 In this video, we'll guide you through the process of installing Python, Git, Visual Studio C++ Compile tools, and FFmpeg on your Windows 10 machine. 📊 We'll also show you how to set your default Python version, create a virtual environment, and install any application with a specific Python version. 🔓
Whether you're a beginner or an expert, this tutorial is designed to help you overcome potential errors and mistakes that you may encounter during the installation process. 💡 So, let's get started! 🎬 Throughout the tutorial, we'll provide advanced tips and tricks to help you navigate the installation process with ease. 💪
Tutorial GitHub Readme File
Must Follow New Resource (18 September 2024) :
Public Post: https://www.patreon.com/posts/111553210
Stable Diffusion GitHub repository
https://github.com/FurkanGozukara/Stable-Diffusion
SECourses Discord To Get Full Support
https://discord.com/servers/software-engineering-courses-secourses-772774097734074388
#Python #StableDiffusion #AI #Torch #PyTorch #VENV
00:00:00 Introduction of what you will learn in Essential AI Tools and Libraries A Guide
00:04:04 What is command line interface (cmd) and how to open it
00:04:15 How to check and verify your default installed Python
00:04:27 How to verify whether Git is installed or not
00:04:37 How open and edit your environment path and why it is extremely important
00:04:50 How to edit system environment variables
00:05:31 How to install Python on Windows
00:06:12 What configuration and settings you need when installing Python for AI applications
00:07:28 How to see where the system is finding my installed default Python
00:08:01 How to install Git on Windows
00:08:44 How to properly install Visual Studio C++ Compile tools to solve C++ 14.0 or greater is required
00:09:24 InsightFace install error and how we will fix it
00:11:25 How to disable pip cache or purge to redownload and fix erroneous pip files download or corrupted pip cache
00:12:16 How to install Git Large which is necessary for Git LFS
00:12:34 How to check if FFmpeg is installed and set on Windows
00:12:45 How to install and setup FFmpeg on Windows
00:13:40 How to add downloaded FFmpeg exes to the system environment variables path
00:14:18 How will system look system variables path with which order, which Python version will get used
00:14:36 How to verify if your FFmpeg setup is working correctly or not
00:14:59 How to install CUDA Toolkit libraries on Windows
00:15:46 How to find other and previous CUDA Toolkit versions
00:16:45 Where CUDA Toolkit libraries path are added in System Environment Variables path
00:17:12 All about Git commands such as checkout, clone, pull, stash, pop
00:17:22 How to install Automatic1111 Stable Diffusion Web UI properly
00:17:46 How to open a CMD in that current drive directly
00:17:56 How to do a git clone to download the Automatic1111 Web UI or any GitHub repository
00:18:18 How to do a git checkout to switch different branches such as dev branch
00:18:38 Explanation of different branches in GitHub repository, example Automatic1111 repo
00:19:00 How to do git pull to update and verify latest version of a repo
00:19:10 How to switch back to main / master branch
00:19:27 When and how to use git stash and git stash pop commands
00:21:04 How to fix please commit your changes or stash them before you merge error
00:21:44 How to get back your modified file after git pull and overwrite
00:22:29 Python virtual environment / venv operations
00:22:42 How to start installation of Automatic1111 SD Web UI after git clone
00:23:51 How to activate any Python virtual environment / venv, example venv of Automatic1111 Web UI
00:24:27 How to install latest PyTorch / Torch version to Automatic1111 SD Web UI
00:24:44 How to uninstall any library from a VENV
00:25:05 How to list specific versions of any Python library to install any specific version from list
00:25:26 How to install specific version of PyTorch with GPU and CUDA
00:25:41 How to fix PyTorch / Torch with only CPU support installation
00:26:02 How to install older versions of PyTorch with previous CUDA and GPU
00:26:14 How to list certain CUDA version compatible PyTorch / Torch versions
00:26:32 If you are not able to find your specific version library it is due to your Python version
00:26:45 How to compose a virtual environment / VENV with Python
00:27:12 How to install different Python versions at the same time
00:28:29 How to copy file path directly in Windows
00:28:39 How to use second installed Python version
00:28:49 How to generate specific Python version having virtual environment / VENV
00:29:34 How to change your default Python version
00:30:58 How to install runpodctl or any exe to your system cmd
-
00:00:00 Greetings, everyone.
-
00:00:01 Welcome to the Pillars of AI Application Libraries: How to Install Tutorial.
-
00:00:07 If you are interested in generative AI, such as Stable Diffusion, such as large language
-
00:00:12 models, web UI, such as voice cloning, such as text-to-speech, image-to-image, text-to-image,
-
00:00:19 text-to-video, video-to-video, image-to-video, and anything that includes AI, this tutorial
-
00:00:26 will help you tremendously.
-
00:00:28 This tutorial is prepared for regular users, not for programmers.
-
00:00:33 Therefore, if you are not a programmer, if you are not an expert, watching and following
-
00:00:38 this tutorial will make your AI journey much more easier.
-
00:00:43 I am going to show you how to install any Python version.
-
00:00:46 I will install Python 3.10 and 11 and show you how to set your default Python version.
-
00:00:53 I am going to show how to install Microsoft Visual Studio C++ Compile tools.
-
00:00:58 This installation will fix the Microsoft Visual C++ 14 or greater is required error, such
-
00:01:04 as the error that you are getting when you are installing Roop deep fake application,
-
00:01:10 or any other application that compiles its own wheel on your computer.
-
00:01:15 I am going to show how to install and setup FFmpeg on your Windows.
-
00:01:19 So all of the applications that depend on FFmpeg will work without any issues, such
-
00:01:25 as Whisper or such as video animation AI applications.
-
00:01:31 This installation will fix all of the errors that are related to FFmpeg.
-
00:01:34 I will show how to install CUDA libraries.
-
00:01:37 In some cases, CUDA libraries are also necessary for compiling, for installing AI applications,
-
00:01:44 AI libraries.
-
00:01:45 I will show how to install Git and Git Large, which is necessary, mandatory to clone and
-
00:01:51 install open source repositories, GitHub repositories.
-
00:01:55 I will show how to do Git checkout, Git pull, Git clone, Git stash, Git stash pop.
-
00:02:01 These will be also very useful in your AI journey.
-
00:02:06 If you are interested in AI, you really need to know these commands, what they do.
-
00:02:11 I will show also advanced stuff such as generate your own virtual environment, and I will show
-
00:02:16 how to activate already installed virtual environment and install or uninstall any library
-
00:02:23 because sometimes you may need to install specific libraries to fix the errors.
-
00:02:29 And by watching this tutorial, you will learn that as well.
-
00:02:32 I will show how to have multiple Python versions, how to set your default Python version, how
-
00:02:39 to generate a virtual environment, or install any application with a certain Python version.
-
00:02:45 I suggest you to have a single Python version, Python 3.10.11, but if it is necessary because
-
00:02:51 sometimes it is necessary to have multiple Python versions, after watching this tutorial,
-
00:02:55 you will not have any issues.
-
00:02:57 I will show how to install any application and set its environment path variable so you
-
00:03:04 will be able to utilize all of the applications.
-
00:03:07 I will show as an example runpodctl, which is used to transfer files between RunPod and
-
00:03:13 your computer.
-
00:03:14 So, this file link will be in the description of the video and also in the comment section
-
00:03:18 of the video.
-
00:03:19 I will update this file if it be necessary.
-
00:03:21 I am showing everything on a freshly installed Windows 10 virtual machine.
-
00:03:27 So, this is a clean installation, and I will show everything on this machine so you will
-
00:03:33 not have any issues to follow this tutorial.
-
00:03:36 So, please watch this tutorial very carefully, entirely, and I am giving you a guarantee
-
00:03:43 that you will save a huge amount of time that will be caused by the possible errors and
-
00:03:50 mistakes that you will encounter in the future.
-
00:03:53 And just for this tutorial.
-
00:03:54 I installed a fresh computer.
-
00:03:56 So, I will show everything on a fresh computer.
-
00:03:59 None of the things previously installed and this will make it easier to follow this tutorial.
-
00:04:04 So, let me first open a cmd.
-
00:04:08 Cmd is command line interface command prompt.
-
00:04:10 Usually, we work with cmd when we are working with open-source applications.
-
00:04:15 When I type Python, you see there is no Python, and it is opening this page.
-
00:04:20 But do not install from this page.
-
00:04:22 Installing from here will cause you problems in the future.
-
00:04:25 So, no Python installed.
-
00:04:27 When I type git, you see git is not installed.
-
00:04:30 Let me also show you my environment path.
-
00:04:32 Now, environment path and variables are extremely important.
-
00:04:36 Why?
-
00:04:37 Because applications will look at environment path to determine where the application is
-
00:04:43 installed.
-
00:04:44 By application, what I mean I mean that, for example, the Python where it is installed
-
00:04:47 or your CUDA libraries where it is installed, or FFmpeg where it is installed.
-
00:04:52 So, you need to understand and learn how to edit system environment variables, and edit
-
00:04:59 path.
-
00:05:00 I just typed env into my search bar, and I am opening edit system environment variables.
-
00:05:06 This is inside the control panel.
-
00:05:08 Then click this environment variables button here, and you see this is a fresh installation
-
00:05:12 so there aren't any set environment variables.
-
00:05:15 Let me show you the path variable.
-
00:05:17 This is where the applications by default look and there is also a system variables
-
00:05:22 path.
-
00:05:23 As you are seeing right now, it is also fully empty.
-
00:05:25 You just need to add applications to the path here.
-
00:05:29 I will show them in the tutorial.
-
00:05:31 Okay, so let's first begin with installing the Python.
-
00:05:35 Why Python 3.x you may wonder because this is the most widely supported and best working
-
00:05:43 Python version right now.
-
00:05:44 So, do not install Python 11, 3.11, or 3.12.
-
00:05:48 You will have a lot of problems with the open-source AI applications.
-
00:05:53 So, to download it, let's go to this link.
-
00:05:56 Let me also make this full screen.
-
00:05:58 Okay, so this is the Python 3.10.11 official version.
-
00:06:02 Let's download Windows installer 64 bit.
-
00:06:06 Okay, it is downloaded.
-
00:06:08 Let's start it.
-
00:06:10 Now.
-
00:06:11 Follow here very carefully.
-
00:06:12 You see there is add Python exe to PATH.
-
00:06:15 You need to select it so it will add it to our environment variables path.
-
00:06:19 Also, click customize installation, select everything here.
-
00:06:23 Next, select everything here, and also change this path.
-
00:06:28 Install it directly into your C drive like this without any space character.
-
00:06:33 So, do not install like this.
-
00:06:35 Do not have any space character.
-
00:06:37 Do not have any special English character.
-
00:06:39 So, I will make it like this.
-
00:06:42 Python 3.
-
00:06:43 Actually Python 3.10.11.
-
00:06:44 Okay, let's click install.
-
00:06:47 It will ask me this okay, let's click yes and just wait.
-
00:06:51 Okay, so the installation has been completed.
-
00:06:52 There is also this important question to ask.
-
00:06:57 Disable path length limit.
-
00:06:58 You should also click this.
-
00:07:00 It will disable the path length limit.
-
00:07:03 It is important.
-
00:07:04 And now when I start a new command line, I type cmd into my search bar and click command
-
00:07:10 prompt.
-
00:07:11 Let me show you where I am typing it.
-
00:07:12 So, you see I have a search bar here.
-
00:07:14 When I type cmd here, it is appearing like this.
-
00:07:17 So, I start a command interface, and now when I type Python, I see 3.10.11 Why?
-
00:07:24 Because it is looking into the system environment path.
-
00:07:27 So, when I open my environment variables, click environment variables, and it is not
-
00:07:32 inside this path inside user variables because this is specific to that user, and we installed
-
00:07:39 it for all of the users.
-
00:07:41 So, it is inside this system variables path, and it is added to the very top.
-
00:07:48 As you are seeing right now.
-
00:07:49 See Python 3.10.11 scripts, and see Python 3.10.11.
-
00:07:54 This is how the applications will find your Python.
-
00:07:58 Okay, Python installation has been completed.
-
00:08:01 Now, as a next step, let's install Git because Git is necessary to clone AI repositories,
-
00:08:07 GitHub repositories, and install the stuff.
-
00:08:10 So, click download for Windows.
-
00:08:12 Select it like this: 64-bit Git for Windows setup.
-
00:08:16 Start to download.
-
00:08:17 Run the application from downloads.
-
00:08:19 Click yes.
-
00:08:21 Just click next.
-
00:08:22 Next next, you don't need to change anything, just click everything next and install.
-
00:08:28 Because the default Git installation is sufficient for us to install AI applications.
-
00:08:33 Okay, now when I type cmd, and when I type git, you see git is installed.
-
00:08:40 Okay, nice.
-
00:08:41 Then, what should we install?
-
00:08:44 We need to install Visual Studio C++ Compile tools and why this is extremely important.
-
00:08:52 I don't know have you seen my Roop the deep fake tutorial.
-
00:08:57 It requires InsightFace library.
-
00:09:00 And InsightFace library requires C++ tools.
-
00:09:04 Let me demonstrate to you.
-
00:09:05 So, I do pip install InsightFace and let's see the error that we are going to get because
-
00:09:12 we don't have the C++ tools installed yet.
-
00:09:16 It is installing all of the necessary packages as you are seeing right now, and when it is
-
00:09:21 compiling, we get this error.
-
00:09:23 Let me show you that.
-
00:09:24 So, the error we got is Microsoft Visual C++ 14 or greater is required and that is why
-
00:09:31 installation of InsightFace failed.
-
00:09:33 A lot of my YouTube followers have got this error, and they had a hard time to fix this.
-
00:09:41 So, let's go to the Visual Studio C++ Compile tools.
-
00:09:46 Open this link and in here, scroll to down.
-
00:09:50 In here, you will see Visual Studio tools.
-
00:09:54 From here, go to the build tools for Visual Studio.
-
00:09:57 Click download.
-
00:09:59 Open in the downloads folder.
-
00:10:01 Right-click, run as administrator.
-
00:10:03 Click yes.
-
00:10:05 Click continue.
-
00:10:06 Then you will get this screen.
-
00:10:08 On this screen select this.
-
00:10:10 You see Desktop Development with C++ and you don't need to select anything else.
-
00:10:16 This is the latest version 17.8.3 and click install - install while downloading.
-
00:10:24 So, this is a big package, but it will install everything that we need for us meanwhile downloading.
-
00:10:30 It may take a while depending on your internet speed and your hard drive speed.
-
00:10:35 Okay, the installation has been completed.
-
00:10:37 Let's close this window.
-
00:10:39 It didn't even tell us to restart the Windows.
-
00:10:42 Now I want to test the installation of InsightFace one more time.
-
00:10:47 Let's open another cmd and do pip install InsightFace and let's see we will get any
-
00:10:54 error or not.
-
00:10:55 We should not get any error.
-
00:10:57 Also, you need to open a new cmd after the installation.
-
00:11:01 New command line interface.
-
00:11:03 It is using the cached pip files.
-
00:11:06 Okay, it is building the wheel.
-
00:11:08 This is where it compiles itself and it compiled I think.
-
00:11:13 No errors.
-
00:11:14 So, it used the C++ tools that we have installed.
-
00:11:19 Okay, now it is running the setup.py file.
-
00:11:23 You can also disable this cache of the tools.
-
00:11:25 So, I added another link here that shows the pip caching.
-
00:11:30 Sometimes, your cache may get corrupted so you may need to clear your cache.
-
00:11:36 When you open the link that I shared here, you will see in the very bottom pip cache
-
00:11:40 list, pip cache list setuptools, pip cache purge.
-
00:11:45 So this will clear your cache.
-
00:11:47 So the pip will redownload all of the cached files again.
-
00:11:52 You can also disable cache with this command.
-
00:11:55 So, let's see the installation.
-
00:11:57 Yes, the InsightFace has been installed without any error.
-
00:12:01 So, the C++ tools installation fixed the major problem that you might encounter.
-
00:12:07 So, when you encounter this problem, Microsoft Visual C++ 14 or greater is required, this
-
00:12:14 is the thing that you need to install.
-
00:12:16 I also added a link for Git Large.
-
00:12:17 So, ever if you need Git Large, download it from here.
-
00:12:22 Install it by default.
-
00:12:24 This will allow you to git clone large repositories like 5 gigabyte, 10 gigabyte files having
-
00:12:31 repositories.
-
00:12:32 Okay, it is already installed.
-
00:12:33 Now FFmpeg.
-
00:12:34 This is super important.
-
00:12:35 So, when I open a cmd and type FFmpeg, you see FFmpeg is not recognized.
-
00:12:42 So, how am I going to install it?
-
00:12:45 Click this link.
-
00:12:46 This is the latest version.
-
00:12:48 You can also manually find this link.
-
00:12:50 How?
-
00:12:51 Open a new tab and type download FFmpeg.
-
00:12:53 You will go to its official website which is here.
-
00:12:56 When I click here.
-
00:12:57 Click Windows, click Windows builds by BtbN.
-
00:13:03 In here you will see the latest link.
-
00:13:05 So this link is from there basically.
-
00:13:08 The FFmpeg is downloaded so I will extract it into the downloads folder.
-
00:13:14 Okay, let's extract like this.
-
00:13:16 I right-click it and extract.
-
00:13:18 On Windows 11 you may be look for more options.
-
00:13:21 So, the extracted folder is here.
-
00:13:24 Enter inside binary folder and copy all these 3 exe files or cut them.
-
00:13:30 Move back into your C drive.
-
00:13:33 Make a new folder as FFmpeg_exes or whatever the name.
-
00:13:38 Do not put any space character.
-
00:13:40 Okay, so this is my FFmpeg exe path.
-
00:13:44 So, when I click here, I will ctrl-C or right-click and copy.
-
00:13:49 I will open the environment variables one more time.
-
00:13:52 Click environment variables: go to the path in system variables or user variables.
-
00:13:59 Doesn't matter.
-
00:14:00 If you have multiple user accounts, install it into the system variables path.
-
00:14:04 Edit: click new, paste it.
-
00:14:08 Alternatively, you can also click new, click browse, and in here, select its folder from
-
00:14:15 C drive.
-
00:14:16 FFmpeg_exe: okay, it is added, okay.
-
00:14:18 By the way, the system will look starting from top to the bottom.
-
00:14:23 So wherever it finds at the top, it will use it.
-
00:14:27 If you have multiple Python versions, the very top will get used by default.
-
00:14:32 Okay.
-
00:14:33 Click okay.
-
00:14:34 Click okay.
-
00:14:35 Click okay.
-
00:14:36 After that, open a new cmd command line and type FFmpeg and you see.
-
00:14:40 We got the latest version of FFmpeg by default installed into our system and it supports
-
00:14:48 all of the libraries of FFmpeg.
-
00:14:50 This is the latest and biggest version of FFmpeg.
-
00:14:53 Okay, we got the FFmpeg too.
-
00:14:56 Now time to install CUDA libraries.
-
00:14:58 To download and install CUDA libraries, you need to register a free Nvidia developer account.
-
00:15:06 Let's click Windows.
-
00:15:07 Actually, they changed it.
-
00:15:09 Wow!
-
00:15:10 Nice.
-
00:15:11 So, let's click exe, and download.
-
00:15:13 Previously they were asking you to log in, but looks like they changed it.
-
00:15:17 Alternatively, you can also download from this link that I have uploaded into Hugging
-
00:15:22 Face repository.
-
00:15:23 So, from either this link or from here, you can download it.
-
00:15:27 Okay, so the download has been completed.
-
00:15:29 Let's open the folder, right-click, and run as administrator.
-
00:15:33 If you have multiple CUDA installations, the system may get confused about which one to
-
00:15:40 use, so I suggest you to uninstall previous ones and install whatever the version that
-
00:15:45 you need.
-
00:15:46 You can also find other CUDA versions very easily, so all you need to do is type CUDA
-
00:15:54 Toolkit and archive and it will allow you to look through all of the CUDA versions as
-
00:16:01 you are seeing right now.
-
00:16:02 You can download and install any version that is necessary, but I suggest you to install
-
00:16:08 and have CUDA 11.8 version right now.
-
00:16:12 In future, it may get changed, but currently most of the AI libraries most of the AI applications
-
00:16:18 are using this version, but let's see, it should still allow me to install.
-
00:16:23 So, I click custom advanced click yes.
-
00:16:26 Okay, everything is selected.
-
00:16:28 Click next.
-
00:16:29 This is where it will get installed by default: C program files, Nvidia GPU computing toolkit,
-
00:16:35 CUDA and version.
-
00:16:36 Okay, let's click everything and next.
-
00:16:38 All right.
-
00:16:39 The installation is starting.
-
00:16:41 Okay, the installation has been completed.
-
00:16:43 Click next and close.
-
00:16:45 After that, let's open the system environment variables one more time and let's see if there
-
00:16:50 is anything new.
-
00:16:52 Let's open the path and now you see the CUDA is added into the very top of my system variables
-
00:17:00 path.
-
00:17:01 So, when any program looks for CUDA toolkit CUDA libraries, it will look into these two
-
00:17:08 folders and that is very nice.
-
00:17:09 Okay, it is set up.
-
00:17:12 We got the CUDA installed, we got the Git installed, and now it is time to learn about
-
00:17:17 git checkout, git pull, git stash, git stash pop.
-
00:17:20 So I will install Automatic1111 Stable Diffusion web UI.
-
00:17:24 Let's type Automatic1111 web UI.
-
00:17:27 Okay, let's go to the repository, let's copy its URL and let's open back our C drive.
-
00:17:35 I suggest you to install directly into your any drive, not install into documents, pictures,
-
00:17:41 downloads, wherever, install into C, D, G, directly into any drive.
-
00:17:46 So, let's open a new cmd in this drive.
-
00:17:49 So, you see how I have opened the cmd inside this folder, then type git clone, copy-paste
-
00:17:56 the URL and hit enter and it will clone the repository into your C drive.
-
00:18:03 Enter inside it.
-
00:18:04 Now I will start another cmd inside this drive.
-
00:18:07 So, I open cmd here.
-
00:18:09 Then now I am in this folder.
-
00:18:11 This is where your folder is currently located.
-
00:18:15 Now I can do many operations.
-
00:18:17 For example, let's do git checkout dev.
-
00:18:20 Now we are into the development branch and what is it you may wonder.
-
00:18:25 Currently there are 14 branches of Automatic1111 web UI.
-
00:18:29 When you click branches you will see that when they were last time updated.
-
00:18:34 So, the last time updated development branch was five days ago.
-
00:18:38 There is also Gradio 4 branch, Test fp8 branch and there is release candidate branch.
-
00:18:44 When I click dev branch you will see that it is 468 commits ahead of the main branch.
-
00:18:52 So, this branch has 468 improvements / fixes over the main branch.
-
00:19:00 After I checked out this branch I can do git pull to verify it is latest version and it
-
00:19:04 is latest version.
-
00:19:05 So, this is how you update a branch.
-
00:19:07 Let's return back to main branch.
-
00:19:10 So, git checkout main.
-
00:19:12 Okay, there is no main branch so git checkout master.
-
00:19:17 Sometimes people are preferring main, sometimes they are preferring master so you see the
-
00:19:21 master branch is the default branch.
-
00:19:24 Now let's see the other ones.
-
00:19:26 Git stash.
-
00:19:27 So, when is git stash and git stash pop are useful.
-
00:19:31 To be it useful you need to have a repository that is updated and you have conflicting files.
-
00:19:37 To show you that I will do this.
-
00:19:39 I will clone my repository.
-
00:19:41 This is my own repository.
-
00:19:43 By the way, you should also fork it.
-
00:19:46 Star it, open notifications and if you sponsor for me I would appreciate it very much.
-
00:19:51 So, let's refresh this.
-
00:19:53 Okay, let's copy it, let's go back to our C drive and let's open a cmd, type git clone
-
00:19:59 and copy paste the URL.
-
00:20:00 For copy pasting it.
-
00:20:01 I right-click.
-
00:20:02 You can also alternatively right-click here and paste from here.
-
00:20:05 So, let's clone it.
-
00:20:07 Okay, it is getting cloned and in this repository I will change something and then I will make
-
00:20:15 an update to my repository and I will do git pull.
-
00:20:17 Let me show you what I mean.
-
00:20:18 So, open it here.
-
00:20:20 So, this is how I open git pull and you see, you see it says already up-to-date.
-
00:20:26 Then I will change the readme file.
-
00:20:29 Okay, for changing it, let's open it with notepad here.
-
00:20:34 Okay, and in here what should we change.
-
00:20:38 Strategies ok, I will type it like this.
-
00:20:41 Then I will make an update to my repository.
-
00:20:45 Let me do update on my computer.
-
00:20:47 Okay, I did an update to repository.
-
00:20:50 Let's refresh it.
-
00:20:51 So, when I click this commits you see it was just now and I changed the update readme file.
-
00:20:58 I just added a new keyword here.
-
00:21:00 Now when I say git pull let's see what happens.
-
00:21:04 Okay, it says that please commit your changes or stash them before you merge.
-
00:21:11 Because there is a confliction of the files.
-
00:21:15 The updated file and my modified file are conflicting.
-
00:21:19 This is when it is useful to have.
-
00:21:22 So, what I am going to do is I will do git stash and it will save my modified file.
-
00:21:29 Then I will do git pull.
-
00:21:31 You see now it is updated.
-
00:21:33 The file is changed.
-
00:21:34 Now when I open the readme file let's open it again with notepad.
-
00:21:39 You see my changes is gone and it is updated to latest version.
-
00:21:44 However, I want my modification to be back.
-
00:21:47 So, what I need to do is, I will do git stash pop, and it will return back my original file,
-
00:21:54 modified readme.md.
-
00:21:55 So, when I open back it, I will see that it is returned back to the my version.
-
00:22:01 So, you see, my 'ok' word, which I have written here, is back, and 'new' is still here.
-
00:22:08 So, it pulled my change and merged it with the newest file as you are seeing right now.
-
00:22:14 This is when it is useful.
-
00:22:16 Okay, this is a complicated stuff, but sometimes you may be in need of that.
-
00:22:22 Now, what else do we need?
-
00:22:24 We have shown the git checkout, git pull, git clone, git stash.
-
00:22:29 Okay, now time to how to activate a virtual environment, how to make a virtual environment,
-
00:22:35 how to uninstall and install a specific library.
-
00:22:38 So, for installing Stable Diffusion Automatic1111 Web UI, I will double-click and start webui-user.bat
-
00:22:45 file, and this file will automatically generate a virtual environment.
-
00:22:50 So, theoretically in your AI application, sometimes you may be needed to modify certain
-
00:22:57 library, and in such cases, you need to update its generated virtual environment and make
-
00:23:06 the changes.
-
00:23:07 So, how we are going to do that?
-
00:23:09 Currently, it is downloading this Torch version into our virtual environment, and it will
-
00:23:14 install all of the libraries.
-
00:23:16 After installation has been completed, I will change the installed Torch version.
-
00:23:21 Currently, Automatic1111 Web UI installer is installing the Torch version 2.0.1.
-
00:23:27 After the installation has been completed, I will activate the virtual environment folder,
-
00:23:33 and I will install the Torch version 2.1, the latest version.
-
00:23:38 You will see how I am going to do it.
-
00:23:40 Okay, the installation has been completed.
-
00:23:41 Obviously, since this is a virtual machine, and it is not a bare-metal virtual machine,
-
00:23:47 it is not able to access the GPU, but it is not important.
-
00:23:51 Now, I will show how to activate the virtual environment of Automatic1111 Web UI.
-
00:23:57 It doesn't matter on any application that generates its own virtual environment.
-
00:24:03 The procedure is the same.
-
00:24:05 So enter inside scripts, this is the folder where you need to start the cmd like this:
-
00:24:10 inside virtual environment, inside scripts, type activate, and now it is activated.
-
00:24:16 Whatever the changes you make will only be effective in this virtual environment, not
-
00:24:22 in any other of virtual environments or in your system-wide Python installation.
-
00:24:27 So, let's install the latest Torch.
-
00:24:29 I type PyTorch.
-
00:24:31 Let's go to PyTorch website, and you see the latest version is 2.1.1.
-
00:24:35 So, I copied this link, and so first I will uninstall Torch, Torch Vision, and Torch Audio.
-
00:24:44 To do that, pip uninstall torch, torchvision and torchaudio and then type --yes, and it
-
00:24:52 will uninstall the currently installed Torch versions.
-
00:24:57 Then, I will first modify the copied command like this, and I will change the version to
-
00:25:05 the specific version.
-
00:25:07 If you want to see all of the versions, type like this, and then it will show you all of
-
00:25:12 the available versions.
-
00:25:13 Currently, these are all the available versions, as you are seeing right now.
-
00:25:16 So, let's install a specific version.
-
00:25:20 These are all for CUDA 11.8, you see, at the end, it shows this is for CUDA 11.8.
-
00:25:26 So, which version do we want to install?
-
00:25:29 So, let's install 2.1.0 and type, and it will install the Torch 2.1.0 with GPU support.
-
00:25:37 Why?
-
00:25:38 Because we are providing an index URL.
-
00:25:41 You see, this is why this Torch installation will have GPU support.
-
00:25:48 If you don't provide this index URL, it will install Torch only for CPU.
-
00:25:53 It will not install it for GPU.
-
00:25:55 So, this index URL has to be provided for Torch to be installed with GPU support.
-
00:26:02 Alternatively, let's say you want to install an older version.
-
00:26:05 So, what you need to do, let's cancel this, and let's return back to this, and change
-
00:26:11 the CUDA version, like 11.3.
-
00:26:14 Now, it will list me CUDA version 11.3 compatible Torch versions.
-
00:26:21 You see, 1.11.0.
-
00:26:23 By the way, this is also depending on your Python version.
-
00:26:27 Some libraries will not be compatible with all of the Pythons.
-
00:26:32 If you are not seeing a specific version that you need, then it is also meaning that your
-
00:26:37 Python version is not compatible with your library version.
-
00:26:41 Currently, the Python version of this virtual environment is 3.10.11.
-
00:26:45 Okay.
-
00:26:46 So how can you also compose a virtual environment?
-
00:26:50 Let's open a folder inside here.
-
00:26:52 Let's open a new cmd, so I will type Python -m venv and the folder name of venv venv.
-
00:26:59 Okay, it is now vevnv, and you see, it is generated.
-
00:27:04 This will be generated with your default Python.
-
00:27:07 Let's say my default Python is 3.10.11.
-
00:27:09 What if you want to have multiple Pythons?
-
00:27:13 Okay, let's also download Python 3.11.
-
00:27:17 You can't have multiple Pythons of the same version like Python 3.10.5 or Python 3.10.7,
-
00:27:24 but you can have multiple different major versions.
-
00:27:28 So, this is Python 3.11, and from here, let's download the Windows installer.
-
00:27:35 Okay, let's install it.
-
00:27:37 I will not add it to the path, so it will not conflict with my 3.10.
-
00:27:43 Let's customize next.
-
00:27:45 Okay, install everything.
-
00:27:47 I am not adding it to the environment variables.
-
00:27:49 This is important.
-
00:27:50 Otherwise, I have to change the environment variable order.
-
00:27:53 Okay, this is 10.11 like this: Okay, install.
-
00:27:59 Okay, the installation has been completed.
-
00:28:02 Let's open our environment variables.
-
00:28:05 From here, let's look at the environment variables, and we will not see that Python in our path.
-
00:28:13 You see, Python 3.11 is not here.
-
00:28:16 So, when I type cmd and type Python, I should still get 3.10.11, not 3.11.
-
00:28:23 So, how can I utilize Python 11 version?
-
00:28:27 Enter inside Python 11, right-click the exe file while keep hitting the shift key, and
-
00:28:34 you see there is Copy as path.
-
00:28:36 Copy it, and let's enter inside this folder, type cmd.
-
00:28:41 This time, I will copy-paste the path of the specific Python version like this.
-
00:28:46 You see, it also has a quotation mark, and I will type -m venv, and let's say 3.11 venv
-
00:28:54 like this, or let's say venv 3.11, and hit enter, and it will generate a virtual environment
-
00:29:02 based on this Python version installation.
-
00:29:05 Now, let's move into a new folder.
-
00:29:08 For moving into folders, type cd, type venv, hit tab, and it will auto-complete the name
-
00:29:14 like this.
-
00:29:15 You see, I am hitting the tab key, then move into the scripts, type activate, and let's
-
00:29:20 type Python --version, and you see the virtual environment.
-
00:29:26 Python version is 3.11, or let's say, just type Python, and now it is also 3.11 as you
-
00:29:32 are seeing.
-
00:29:33 You can also change your default Python version.
-
00:29:36 Let's open the environment variables, click environment variables, click edit path and
-
00:29:42 in here, click new, then click browse.
-
00:29:46 Select the Python 11 from here, 3.11, then also click new, and click browse, and then
-
00:29:55 go to the 3.11, and in here, you need to select scripts.
-
00:30:00 Okay.
-
00:30:01 You see, now we have two of them.
-
00:30:03 Let's move this to the up version like this, this, and these two, and will it be okay,
-
00:30:08 will it be sufficient?
-
00:30:10 Let's see.
-
00:30:11 Python.
-
00:30:12 And no, still, 3.10 is default.
-
00:30:15 Why?
-
00:30:16 Because the order of the environment path variables matters.
-
00:30:21 So, I edit.
-
00:30:22 I will move these to the very top like this, then also move this to the very top like this.
-
00:30:28 Okay, click.
-
00:30:29 Okay, okay, then open a new cmd.
-
00:30:32 You need to open a new one.
-
00:30:33 Type Python.
-
00:30:35 And now, my main Python.
-
00:30:37 My default Python is 3.11.
-
00:30:39 This is how you can set up multiple Pythons.
-
00:30:43 This is how you can add, modify, change, path, change your default applications.
-
00:30:49 This is also the same for runpodctl.
-
00:30:52 Runpodctl is the utility that we use for RunPod.
-
00:30:56 If you are following my RunPod tutorials, you will know that.
-
00:30:58 So, we need to first download the runpodctl.
-
00:31:03 How am I going to do that?
-
00:31:05 So, let's copy this.
-
00:31:06 Let's open a new folder inside C. Let's say runpodctl_exe.
-
00:31:12 Open a new cmd inside this folder.
-
00:31:16 Copy-paste the link.
-
00:31:17 Okay, if there is no wget on Windows.
-
00:31:20 So, we need to just download this file from here actually.
-
00:31:26 It will download a file like this.
-
00:31:29 Okay, let's say download suspicious file.
-
00:31:33 Let's open it, and I will cut it.
-
00:31:35 Return back into the runpodctl_exe.
-
00:31:39 Let's name it as runpodctl.exe like this.
-
00:31:43 Let's open a new environment variable.
-
00:31:45 Currently, when I type cmd and type runpodctl, you see, it is not recognized.
-
00:31:50 So, I go to environment variables.
-
00:31:52 I go to path, edit, click new, and click browse.
-
00:31:57 Let's select the runpodctl from here.
-
00:32:01 Okay, okay okay okay.
-
00:32:03 Let's open a new CMD.
-
00:32:05 And when I now type runpodctl, you see, now it is by default.
-
00:32:10 So now, I can use runpodctl.
-
00:32:12 This is the logic of pathing in Windows.
-
00:32:15 This is super important to learn and understand.
-
00:32:19 I will update this file as it be necessary.
-
00:32:21 The link to this file will be in the description of the video and also in the comment section
-
00:32:26 of the video.
-
00:32:27 I appreciate it very much if you support me on Patreon, when you click this link, you
-
00:32:32 will see our Patreon page.
-
00:32:34 I am sharing a lot of useful scripts here with guidance, written tutorials, instructions.
-
00:32:42 You see I have 75 sharing.
-
00:32:44 We have over 3400 members, but not all of them are paid members.
-
00:32:49 You can also join for free, but if you join for free, you will not see the subscription-based
-
00:32:55 scripts, only the free ones.
-
00:32:57 You can buy me a coffee and support me.
-
00:32:59 I would appreciate that very much.
-
00:33:01 We have two supporters so far.
-
00:33:03 You can follow me on Medium.
-
00:33:05 I am writing a lot of articles, sharing super important stuff here.
-
00:33:10 You can follow me on CivitAI.
-
00:33:12 I am writing a lot of articles on CivitAI as well.
-
00:33:16 You can follow me on DeviantArt.
-
00:33:17 You should subscribe to our channel.
-
00:33:19 You can follow me on LinkedIn.
-
00:33:22 I have over 3000 followers.
-
00:33:24 I am sharing a lot of useful information here as well.
-
00:33:27 You can also purchase our Udemy course, but I suggest you become a Patreon member and
-
00:33:34 follow our YouTube channel.
-
00:33:36 That is better.
-
00:33:37 But if you don't have any other options, you can purchase my Udemy course and access the
-
00:33:43 scripts there.
-
00:33:44 However, Patreon is the most up-to-date way, and you can follow me on Twitter.
-
00:33:48 I hope you have enjoyed this tutorial, hopefully much more amazing tutorials are coming and
-
00:33:55 hopefully, they will help you significantly.
-
00:33:57 For example, I am going to make a tutorial for Magic Animate Automatic Installer and
-
00:34:04 how to use it.
-
00:34:05 This tutorial was mandatory for that tutorial because you had to install C++ tools and FFmpeg.
-
00:34:11 This is why I recorded this tutorial previously, but this is a major tutorial.
-
00:34:15 This tutorial will help you significantly if you are interested in AI overall.
-
00:34:16 Thank you very much.
-
00:34:17 See you later hopefully.
