-
-
Notifications
You must be signed in to change notification settings - Fork 362
Hunyuan Image 21 by Tencent Full Tutorial and 1 Click to Install Ultra Advanced App to Use Locally
Full tutorial link > https://www.youtube.com/watch?v=dNeA5mJ36hA
Hunyuan Image 2.1 just published by Tencent and I have been working on developing the very best app to let you use HunyuanImage-2.1 with easiest and most accurate way. In this tutorial video, I will show you how to literally 1-click to install this model and our app on Windows (locally), Massed Compute (cloud) and RunPod (cloud).
SECourses HunyuanImage 2.1 Pro link : https://www.patreon.com/posts/138531984
Comparison Slider : https://www.patreon.com/posts/133935178
Hugging Face upload / download tutorial : https://youtu.be/X5WVZ0NMaTg
Our Discord : https://discord.com/servers/software-engineering-courses-secourses-772774097734074388
Our Reddit : https://www.reddit.com/r/SECourses/
My LinkedIn : https://www.linkedin.com/in/furkangozukara/
Video Chapters
00:00:00 Introduction to Hunyuan Image 2.1 Gradio App
00:00:50 Detailed Application Feature Overview
00:01:20 Seed, Image Count, Auto-Enhance & Refiner Features
00:01:57 Aspect Ratio, Resolution & Advanced CFG Settings
00:02:30 Config Management, Prompt Tools & Image Refinement
00:03:13 Output Management: Saved Images & Metadata
00:03:43 One-Click Installer & Robust Downloader Explained
00:04:33 Windows Installation Guide - Getting Started
00:05:41 Windows - Fixing Model Downloads & Current Limitations
00:06:38 Massed Compute Setup - Deploying an Instance
00:07:32 Setting Up ThinLinc for Remote Desktop Access
00:08:33 Connecting to Massed Compute & Transferring Files
00:09:56 Massed Compute - Running the Installation Script
00:10:53 Troubleshooting Model Downloads on Massed Compute
00:11:34 Running the Application & First Image Generation
00:13:52 Improving Prompts with Auto-Enhance Feature
00:15:34 Using the Refiner for Higher Quality Images
00:16:23 Comparing Before & After Refiner Results
00:17:32 How to Use Multi-Line Prompting
00:17:55 Backing Up Your Generated Images from Massed Compute
00:19:59 How to Properly Terminate Your Massed Compute Instance
00:20:20 RunPod Installation Guide - Introduction
00:21:06 Setting Up Your RunPod Instance (GPU & Template)
00:22:09 Connecting to RunPod & Starting the Installation
00:23:53 RunPod - Model Download & Troubleshooting
00:25:06 Running the Application on RunPod
00:26:08 How to Back Up Your Data from RunPod
00:27:43 How to Properly Terminate Your RunPod Instance
HunyuanImage-2.1: Revolutionizing High-Resolution Text-to-Image Generation
Introduction
In the rapidly evolving field of artificial intelligence, text-to-image generation models have become pivotal tools for creators, designers, and developers. Among the latest advancements is HunyuanImage-2.1, an open-source diffusion model developed by Tencent's Hunyuan team. Released on September 10, 2025, this model specializes in generating ultra-high-definition images at 2K resolution (2048 × 2048 pixels), setting new standards for efficiency, quality, and multilingual support. Designed to bridge the gap between textual descriptions and visually stunning outputs, HunyuanImage-2.1 leverages advanced diffusion transformer (DiT) architecture to produce cinematic compositions with remarkable fidelity.
This article delves into the intricacies of HunyuanImage-2.1, exploring its architecture, key features, training methodologies, performance benchmarks, and practical applications. As an efficient alternative to resource-intensive models, it promises to democratize high-quality image generation for a global audience.
Background on Tencent's Hunyuan AI Ecosystem
Tencent, a leading technology conglomerate, has been at the forefront of AI innovation through its Hunyuan series. The Hunyuan family includes large language models (LLMs) and multimodal systems tailored for various tasks, from natural language processing to visual generation. HunyuanImage-2.1 builds upon predecessors like Hunyuan-DiT, incorporating lessons from extensive research in diffusion models.
The model's development emphasizes efficiency, addressing common pain points in text-to-image systems such as high computational demands and poor text-image alignment. By integrating multimodal capabilities, HunyuanImage-2.1 not only generates images but also ensures they accurately reflect complex prompts in both English and Chinese, making it a versatile tool for international users.
Architecture and Technical Innovations
At its core, HunyuanImage-2.1 employs a two-stage pipeline: a base text-to-image model followed by a refiner model. This structure optimizes for both speed and quality, allowing the generation of detailed images while minimizing artifacts.
Text Encoders
The model uses dual text encoders to enhance semantic understanding:
A multimodal large language model (MLLM) improves alignment between text and images, enabling nuanced interpretations of prompts.
A multilingual, character-aware ByT5 encoder excels in glyph-aware processing, ensuring accurate text rendering in generated images, particularly for non-Latin scripts like Chinese characters.
Some background music by NoCopyrightSounds : https://gist.github.com/FurkanGozukara/ab4eadc006ffde7071f63d629b0198b7
-
00:00:00 Hunyuan Image 2.1 has been published by Tencent yesterday. So many people are
-
00:00:05 talking about this model right now. Currently, none of the applications,
-
00:00:10 not even ComfyUI, are supporting this model yet. Therefore, I have developed a very amazing,
-
00:00:16 very easy-to-use Gradio application with one-click installers. And today, I will show you how to use
-
00:00:22 this model. Tencent published this application just yesterday. It is still in early stages, but
-
00:00:28 I used the official pipeline and built a Gradio application that you will be able to use this
-
00:00:34 model with all features, with extra features we have, with the most accurate and highest quality.
-
00:00:40 Currently, not even ComfyUI is supporting this model. However, my application is fully
-
00:00:45 supporting it with so many features. So let's begin to see the features our application has.
-
00:00:50 We allow to choose regular versus distilled model usage. The distilled model works with 8 steps,
-
00:00:56 also its inference is two times faster per step. We support model offloading,
-
00:01:02 re-prompt model offloading, and refiner offloading. Refiner really improves the quality,
-
00:01:07 therefore I recommend you to use it. We support multi-line prompting. You see each line, you can
-
00:01:13 write a new prompt and enable multi-line prompt here, and it will generate each line like this.
-
00:01:20 We support custom seed or -1 seed, which is random seed. When you set the number of images,
-
00:01:26 for example, it is set 2 here, it will generate two images for per prompt like this.
-
00:01:30 We support re-prompt model. When you enable this and enable auto-enhance,
-
00:01:35 it will automatically enhance the prompt according to the LLM that authors are
-
00:01:41 recommending. We support using refiner, and I recommend using 8 steps refiner. As I said,
-
00:01:46 it is improving the quality. We support negative prompt so that you can use negative prompts to
-
00:01:52 make images either more realistic or more like cartoonish or 3D. We support custom
-
00:01:57 aspect ratios. By clicking this, it will automatically set your aspect ratio and
-
00:02:02 the resolution. The native resolution of this model is 2048 to 2048 pixels.
-
00:02:08 We support different guidance scales, CFG scale for both refiner and also for regular
-
00:02:14 model inference. So you can set different CFG scale for the base model and the refiner. We
-
00:02:19 support inference steps differently for both base model and the refiner model. Moreover,
-
00:02:24 we support shift values for base model and refiner separately.
-
00:02:30 We have fully working config settings, so you can load the configuration that you want or you can
-
00:02:35 save new ones from here. Type name, save, refresh, it will appear. And the application will remember
-
00:02:41 when you next time restart the application which config was used last. Furthermore,
-
00:02:46 you can use this prompt enhancement tool to see what your prompt will be like when
-
00:02:52 you use it. Just type and enhance prompt. Moreover, you can also refine your existing
-
00:02:57 images. So you just upload your existing image here. Let me show you, for example,
-
00:03:02 this one. It will automatically detect the aspect ratio and set the closest aspect ratio
-
00:03:08 here. You see, this is set. Then it will use the refiner model to refine the image.
-
00:03:13 All of the generated images will be saved inside the outputs folder with their metadata so that
-
00:03:19 you can later look at their generation settings and you can replicate it. Also,
-
00:03:24 if you have enabled the refiner, it will save both without refiner and with refiner
-
00:03:30 so that you will have both of the versions. You will have metadata. When you open a metadata,
-
00:03:35 it will show you all the used settings like this.
-
00:03:38 Hopefully, I will improve this application as you request it. Normally, installation of this
-
00:03:43 model is extremely hard. You have to download so many different models into the different folders,
-
00:03:49 but I have prepared one-click to install and download for Windows, for RunPod,
-
00:03:55 and for Massed Compute. My robust downloader, but it is really robust, will automatically download
-
00:04:01 all of the necessary models into the necessary folders. So you won't spend any time. Moreover,
-
00:04:07 my installer generates a virtual environment and it uses Torch 2.8 and CUDA 12.9. You don't even
-
00:04:15 need to install them. You just need to have Python and also Git because I am using all
-
00:04:21 pre-compiled libraries like FlashAttention, and I am compiling them with support of all
-
00:04:27 of the GPUs out there. So it will be the easiest installation that you have seen. So let's begin.
-
00:04:33 So as usual, I have prepared an amazing post which will show you all the directions. The link of this
-
00:04:39 post will be in the description of the video. I recommend you to read this post before starting
-
00:04:44 using it. Download the latest zip file. It is here or it will be in the very bottom where you will
-
00:04:50 see in the very bottom attachments here. Move the downloaded zip file into any disk where you want.
-
00:04:57 So I will extract it into my E drive. To install on Windows, just double-click Windows install or
-
00:05:02 update.bat file and it will start installation and automatically install everything. All you
-
00:05:08 need is Python 3.10.11 and Git installed. The rest will be fully automatic. It will
-
00:05:15 do everything automatically for you. Then once the installation has been successfully done,
-
00:05:20 you need to Windows start up.bat file. I already have installed version. Windows start up.bat
-
00:05:27 file, run. It will start the application and the application has started. Now I
-
00:05:32 can use it. It is pretty simple to use. It will show you all the messages here.
-
00:05:37 Moreover, during the installation, if you get any model download errors,
-
00:05:41 which shouldn't happen because I made it extremely robust, all you need to do is Windows fix model
-
00:05:47 download.bat file. It asks you whether you want to download Hunyuan Image 2.1 plus refiner or
-
00:05:54 distilled version. You can download either of them or you can download both of them. And I
-
00:05:58 recommend to download all of them. It will start downloading. Since I have previously downloaded,
-
00:06:03 it is just going to download the missing file, which is this one. The other ones
-
00:06:08 were all previously downloaded, therefore it will just skip them downloading. This
-
00:06:13 downloader is extremely robust. It has full resume capability and everything.
-
00:06:19 However, currently on Windows, we won't be able to use this because it is lacking VRAM
-
00:06:24 optimizations at the moment. I won't be able to show you on Windows yet. So I will show you
-
00:06:29 on Massed Compute. However, when we can use it on Windows, when the optimizations become available,
-
00:06:34 I will update this post and notify everyone. So don't worry about that.
-
00:06:38 So how we are going to use it on Massed Compute and on RunPod? First of all,
-
00:06:42 you see there is Massed Compute instructions.txt file. My Massed
-
00:06:46 Compute installation is same as other ones. If you have watched any previous tutorials,
-
00:06:50 you know it. Please use this link to register. After registering and logging in your panel,
-
00:06:56 put up some billing here. Then go to deploy. And the GPU selection, I recommend RTX Pro 6000 right
-
00:07:03 now. You can also select H100 or A100, it is up to you, but this GPU is both cheap and extremely fast
-
00:07:11 and it has 96 GB of VRAM. From category, select creator. From image, select SECourses. Then we
-
00:07:19 have a discount coupon. This coupon is working on all of the GPUs. It is SECourses. Verify. You see,
-
00:07:25 this price is amazing. It is much cheaper than the RunPod prices, only $1.47 per hour. Deploy.
-
00:07:32 Once you deploy it, it will show you new instance successfully created. And now you just need to
-
00:07:37 wait for initializing to be completed to proceed. Meanwhile, if you don't have previously installed
-
00:07:43 ThinLinc client, let me show you how to do that. So when you click details, it will show you login
-
00:07:49 URL, Ubuntu, and password. And you need to download this ThinLinc client. Go to there,
-
00:07:54 select your operating system. It can be Windows, Mac, Linux. I am on Windows,
-
00:07:59 and double-click the installation. Yes. Then click next, accept, next, install. So it is just next,
-
00:08:06 next, next, accept. Run ThinLinc client. Then in the options, you need to set up a local device,
-
00:08:12 and you see clipboard synchronization is enabled, this is important, and drivers. So click details,
-
00:08:17 and you see there is a driver that I did add. So add a folder from your computer where you will
-
00:08:23 be able to synchronize files, but small files, big files will fail. Read and write permission,
-
00:08:28 okay, then okay. Then move the downloaded file into your synchronization folder.
-
00:08:33 This is my synchronization folder, so I will put it there. And it is here.
-
00:08:37 So the machine is now ready. I will connect it. Copy the login URL, paste here server.
-
00:08:43 Copy the username, paste here Ubuntu. Copy the password and paste here. If you select this "End
-
00:08:50 existing session", it will terminate all of the running applications on your machine. So
-
00:08:55 this is a critical thing. You need to select this only when your synchronization drive
-
00:09:00 doesn't work or when you cannot connect the machine. It will not delete your data, but it
-
00:09:05 will terminate all the running applications. So it is like restarting your server. Okay,
-
00:09:10 I am connecting right now. The connection speed depends on where you live, your internet service,
-
00:09:15 and we are almost ready. And it is started. So go to home and go to Thin Drives,
-
00:09:21 select Massed Compute shared folder. Wait for the synchronization folder to become available because
-
00:09:27 this is slow. So for big files, use Hugging Face upload, download, use OneDrive, Google Drive,
-
00:09:34 any of them you can use. Okay, we have the zip file here. You see Hunyuan Image 2.1 version 3
-
00:09:40 downloads. So I am dragging and dropping it into the downloads folder. We never install
-
00:09:45 anything inside this folder, never. So go to downloads folder, right-click and extract here,
-
00:09:51 and open the folder. And now double-click Massed Compute instructions read.txt file. There is this
-
00:09:56 install command. Copy it. When you are inside this folder, click this three dots icon, open
-
00:10:02 in terminal, right-click and paste, and hit enter. And it will start automatic installation. Again,
-
00:10:07 we don't need to do anything. We just wait for installation to be completed.
-
00:10:12 The installation on Massed Compute is like 10 times faster than the RunPod usually.
-
00:10:16 So once the installation of the libraries is finished, it will ask you to which models to
-
00:10:20 download. Let's download all of them, choice 3, and it will start downloading. The downloading is
-
00:10:26 really fast on Massed Compute as well. You see we are getting 700 MB per second right now. My
-
00:10:33 downloader splits model download into 16 parallel pieces, so we download with 16x speed compared to
-
00:10:41 single download. Okay, model downloads on Massed Compute finished. You see we have failed 3,
-
00:10:47 and these failed files are just very small JSON files. Let's run the downloader again.
-
00:10:53 We were just rate limited, sometimes happens. So I will just copy-paste and option 3. It
-
00:10:59 will just skip the already downloaded files as you can see, and they were all hash verified,
-
00:11:04 so they were 100% accurately downloaded. Now it will try to download missing JSON files. Let's
-
00:11:10 just wait for a second. You see it is skipping the files after verifying their hash. Okay,
-
00:11:16 almost done. And those JSON files... okay, yes. So it is downloading. There were one
-
00:11:23 real model as well. Okay, now it is all downloaded accurately, 100% accurately.
-
00:11:29 Now we can start the application. To start the application, copy this command and inside this
-
00:11:34 folder, open another terminal and paste. This will start with Gradio live share,
-
00:11:40 but if you don't want it, you can just remove the live share. And Gradio live share started.
-
00:11:44 So I will copy it and use it in my own PC like this. So it will be much more faster to use.
-
00:11:51 So, how you can use? You can just type a prompt here and right away use it. You can
-
00:11:56 use distilled model. Make sure to decide which model you will use at the beginning.
-
00:12:01 Distilled model is much faster with only 8 steps, but its quality is lower. So let's
-
00:12:07 begin with using the default settings. You can select your aspect ratio from here. So
-
00:12:13 let's make our aspect ratio like this. And we can also apply auto-enhance. Currently
-
00:12:18 it is not applied, so you can see. So let's just generate an image and see the result.
-
00:12:23 Since currently these models are huge, it is even taking a lot of time to just load into
-
00:12:29 the RAM disk. For example, let's type nvitop and you can monitor what is happening. First,
-
00:12:34 it is loading into memory, then it will move them into the GPU. You can also see the status of what
-
00:12:39 is happening in the started CMD window. And it shows the options that we have selected as like
-
00:12:46 this. But I saw that GGUF versions of the model is being made. Probably in few days, you may run this
-
00:12:53 in ComfyUI, but this is official, best quality pipeline. So if you want to compare, if you want
-
00:13:00 to test right now, this is the way of doing that. Okay, it is loading the models. You see it has so
-
00:13:04 many different parts to be loaded and my installer is handling everything automatically for you. Once
-
00:13:11 you generated an image, the subsequent generations are taking under 1 minute to generate with the
-
00:13:17 best quality. Okay, generation started. Okay, you see the timing is getting better. Next generation
-
00:13:22 will be much more faster to do. And it shows all the settings. We are using shift 4, this random
-
00:13:28 seed. This mean flow is used with distilled model, and it is using this by 3.5, the resolution,
-
00:13:34 the sampling steps, the guidance scale, the CFG scale. It also has some negative prompt.
-
00:13:39 This model supports negative prompts as well. And this is the step speed, 1.36 it/s. So the
-
00:13:47 first generation takes like 1 minute, but the next ones will be even faster. Let's see the generated
-
00:13:52 image. And yes, we have it. Currently it is not very realistic because these models are tending
-
00:13:58 to be not very realistic. We need to improve the... Let's try raw iPhone photo of... Okay,
-
00:14:03 let's try like this and generate image. Let's see the next one speed. So you see it started
-
00:14:08 immediately generating and it will take like 35-40 seconds to generate. So we can see the process
-
00:14:14 here. Yes, you see it took like 40 seconds to generate. Okay, interesting. It put it like this.
-
00:14:20 So, we can also automatically enhance the prompt. Okay, let's make this like this. Raw photo of a
-
00:14:26 beautiful landscape with mountains taken with iPhone. Then let's enable auto-enhance prompt
-
00:14:30 and let's generate. When you enable auto-enhance prompt, it will take longer because it will also
-
00:14:35 run the enhancer LLM pipeline. So it will take some time to enhance. You see it is loading the
-
00:14:42 LLM to enhance the prompt. It is not like embedded thing into the model. It is using some LLMs. Okay,
-
00:14:48 it is starting. This is by the way fully official pipeline published by the Tencent
-
00:14:54 Hunyuan developers. So we are using it. This is the highest quality probably we can assume that.
-
00:15:00 The prompt will be also shown here. So we will see it in a minute. It's taking like one minute. Okay.
-
00:15:06 So it changed the prompt into this. By the way, all generations are saved inside Hunyuan folder,
-
00:15:13 outputs folder with their metadata. So you can also see them with their metadata
-
00:15:18 as well. And the images are here. And we will see new prompt here as well. Okay,
-
00:15:23 the prompt arrived and the image has arrived. Yes. You see, it improved the prompt.
-
00:15:28 Then there is also refiner. Let's also try with refiner as well. So this time I will disable
-
00:15:34 auto-enhance prompt since my prompt is enhanced and I will enable refine and generate. When you
-
00:15:40 use both refiner and base model, it obviously takes huge amount of RAM memory because it is
-
00:15:47 keeping the other model onto RAM to not reload again. Therefore, make sure that your machine
-
00:15:53 has a lot of RAM if you are going to use both of the models like this case because
-
00:15:59 just the refiner itself is 30 GB model as you can see. Okay, refiner started. Refiner is only
-
00:16:06 4 steps. It is taking longer per step, but it is fine. And the refine completed and we
-
00:16:12 got the refined image like this. I think it is a little bit of improvement. In the outputs folder,
-
00:16:17 you will see both pre-refiner like this and let's see the refined version like this. Yes.
-
00:16:23 We can see that refiner definitely improved the quality. And this is currently viewed inside the
-
00:16:31 ThinLinc client. Yes, I can definitely say that refiner really improved the quality. So let's
-
00:16:37 move these files into our computer to look. Okay, copy and let's go to home, thin, Massed Compute
-
00:16:44 shared folder. This is my folder name. You can put whatever you want. This is how you can move files,
-
00:16:49 but small files. Okay, let's just paste it there. Then when I go back to my computer,
-
00:16:55 outputs folder, you see it is currently synchronizing and I can see that. Okay,
-
00:17:00 this is raw version and this is the refined version. The refined version is much better.
-
00:17:06 So let's use our image comparison slider application. Select the output and make a
-
00:17:12 comparison. Full screen. Okay, this left one is without refiner and the right one is with
-
00:17:18 refiner. I can see that it significantly improved the quality. This is 2048 pixels to 2048 pixels by
-
00:17:27 default. So this application is extremely advanced. Try it and see if it is working
-
00:17:32 better for your professional cases, your cases. To use multi-line prompt, all you need to do is
-
00:17:37 just enable this and just type your prompts like this: dog, cat, bus, and it will generate each one
-
00:17:43 of them. Moreover, you can set number of images from here to generate multiple images at once.
-
00:17:48 Okay, so once you are done with Massed Compute, how to back up your data and terminate it? I will
-
00:17:55 show that right now. So first of all, I will move my all output, copy, then go to home, go to Thin
-
00:18:02 Drives, go to Massed Compute shared folder. This is the name that I have given. You can give any
-
00:18:08 name, but it will be always inside Thin Drives in your Massed Compute cloud. So paste here. I
-
00:18:16 will say apply this to all and merge so that it will add all the newest files, replace. Then you
-
00:18:24 will see that it will copy them. Okay, there are a few things, skip all, and the rest will be copied.
-
00:18:32 It happened because I had copied few of them previously. This copy is very slow. Why? Because
-
00:18:38 currently it is also synchronizing with my shared folder in my PC. When I go to my shared folder and
-
00:18:46 inside outputs, I should see that new files are arriving here. Yes. So you see, as it copies the
-
00:18:54 files into the shared folder, they are also being copied into my PC. Once this option is completed,
-
00:19:03 then I can safely terminate my Massed Compute because I did back up all the data. However,
-
00:19:11 I would recommend you to use OneDrive or Google Drive for faster upload and download. Moreover,
-
00:19:17 there is also a tutorial that I have made. Just type SECourses wget, and you will see this
-
00:19:23 tutorial. This tutorial also shows you how you can use Hugging Face Jupyter notebook to upload
-
00:19:30 and download into Hugging Face. It is the fastest way to back up big data. Especially for big data,
-
00:19:38 I recommend to use that strategy so that you will be able to back up your data into Hugging
-
00:19:44 Face and download from there whenever you want. It can be next time when you set up a
-
00:19:49 Massed Compute, you can use the Hugging Face setup repository, extremely fast download and upload.
-
00:19:55 So once all the generations are copied like this,
-
00:19:59 it is completed. Return back to your Massed Compute instance. If you stop it,
-
00:20:03 it will not stop your billing. You need to delete it. Currently it is stopped. I can start again,
-
00:20:08 but there is no point of stopping. Then I need to delete and then it will not use my credits.
-
00:20:14 So now I will show how to install it on RunPod. Download the latest zip file from the post. Move
-
00:20:20 it into any disk where you want to follow and extract all. Okay, let's extract all. Then you
-
00:20:27 see there is RunPod instructions read.txt file. This is my RunPod installation way, always the
-
00:20:33 same. So once you learn how to install one of my applications, you understand the logic and you
-
00:20:38 can follow it always. Please register RunPod with this link, I appreciate that. After registering,
-
00:20:43 sign in. And after signing, click billing and add some credits to your account. Then go to Pod. You
-
00:20:49 can also use storage, which is permanent storage system, if you don't want to reinstall every time.
-
00:20:54 And for permanent storage system, I already have a tutorial here. So you can follow it, but I will
-
00:21:00 now show you new instance installation. So go to Pod, as I said. From here, you can make some
-
00:21:06 selections. I recommend you select this disk and I recommend you to select this RAM amount. Then
-
00:21:12 my recommended GPU is RTX Pro 6000. And in the template, this is super important, pay attention
-
00:21:18 to the template that this txt file is telling you. It is telling you to use this. Don't worry,
-
00:21:24 just use it. So, change template. From templates, you see RunPod PyTorch 2.2.0. This is official
-
00:21:30 template. Don't worry, this template will still work on RTX 5000 series because my installation is
-
00:21:36 handling that automatically. Then edit template, this is important. Set disk like 200 GB. This is
-
00:21:43 important. You can also expose other ports to connect via proxy if you want, but I recommend
-
00:21:50 to use Gradio live share, which I'm going to show. And deploy on demand. RunPod initialization will
-
00:21:55 be really fast, but its installation is just way slow than Massed Compute because its disk drives
-
00:22:02 are shared among so many users and since they have network storage system, it is even more slower.
-
00:22:09 So once you see this green icon, click here and click "Connect JupyterLab Interface".
-
00:22:14 When you first time try, it may fail. You may try again and again and if it never works,
-
00:22:19 get a new machine because that machine is broken. Furthermore, pay attention to this utilization,
-
00:22:24 memory, and disk. Make sure that they are all like this because sometimes it is being a bugged GPU.
-
00:22:30 And before even starting installation, you can do this: pip install nvitop. This is for
-
00:22:36 verifying your GPU. nvitop. And now you should see a window like this that shows your GPU. If it is
-
00:22:43 not working, this machine is broken. Just dump it and get a new one. Then you will see that there is
-
00:22:49 this upload icon. Click that, select the file you have downloaded, and upload. It should be almost
-
00:22:54 instant. Right-click the zip file and extract archive. Then click this refresh and you will
-
00:22:59 see files like this. Open RunPod instructions read.txt file. Just copy this install command.
-
00:23:05 This is almost same in my all applications and hit enter. This will automatically set
-
00:23:11 up a virtual environment and install it into there and it will also download the models. The
-
00:23:16 installation and model download will take huge time on RunPod. So if you want to use storage,
-
00:23:22 you can set a new storage and the only difference is that you click this volume name, you click this
-
00:23:27 "Deploy Pod with Volume" and you select GPU. Then the rest is exactly same. You see, we came
-
00:23:33 to this part and from this part it is exactly same. However, it will be permanent so that you
-
00:23:38 won't be needed to install again and again. It will stay. But permanent storage may be slower
-
00:23:44 as a disk and also it will use your credits as long as it exists. You see, monthly cost is $35.
-
00:23:53 So the installation on RunPod started. Once the library installation completed,
-
00:23:57 it will ask you which models to download. I recommend to download all of them, option 3,
-
00:24:02 and the download will start. My downloader uses 16 connections to speed up. However,
-
00:24:08 RunPod download speeds are usually not that good. And then it will verify their
-
00:24:12 hash and it will be even slower on RunPod because RunPod disks are slow,
-
00:24:17 but this will ensure that all of the models are accurately, 100% accurately downloaded.
-
00:24:22 So the model downloads have been completed, but I see two failed because probably we were
-
00:24:28 rate limited. Yes, I can see that some JSON files caused rate limit. You see. So what you can do,
-
00:24:34 you can just run this prompt again. Okay, let's try. And it will just skip existing
-
00:24:41 downloads and it will download missing ones. You see, since we verify with hashes and log them,
-
00:24:48 it will just skip hash verified files and it will just download the missing file. Okay, it says that
-
00:24:53 we had a one missing file. It downloaded it. It is verifying the other files as well. Okay, you see,
-
00:25:00 now we have no issues with models. They are 100% accurately downloaded with verified hashes. Now
-
00:25:06 to run the application, I will just run this terminal. Unfortunately, starting applications,
-
00:25:12 loading models on RunPod is really, really slow compared to Massed Compute because of
-
00:25:17 their disk speeds. We can also see their disk speed here. You see, it says that it is 120 MB
-
00:25:24 per second. And this is supposed to be NVMe disk. You see, 140 MB per second. It's extremely slow.
-
00:25:31 Okay, the application started. I'm going to use this Gradio live share. You can also use this port
-
00:25:35 to connect, 7861 as you can see. So I can connect from this proxy port or I can connect from Gradio
-
00:25:43 live share, which I recommend. Then let's generate an image, an example image. I won't show again the
-
00:25:49 rest, just watch the Massed Compute part starting from here. The interface is also very clear, easy
-
00:25:56 to use. I also explained it in the very beginning of the tutorial video, so you can also watch it.
-
00:26:02 Okay, so once you are done with the RunPod usage, how to properly close it or terminate it?
-
00:26:08 First of all, I recommend you to download all of the generated images. To do that,
-
00:26:13 we go back to workspace, enter inside Hunyuan Image 2.1 SECourses. You will see outputs.
-
00:26:20 Everything we have generated so far will be saved here with images, with their metadata,
-
00:26:26 everything. So let's go to this folder, right-click outputs and download as an archive.
-
00:26:33 Then it will start the download like this. You see currently it is downloading. Wait for download to
-
00:26:38 be completed. If you have so large data, this may fail. Then you can use runpodctl to download. You
-
00:26:47 need to install runpodctl. I have a tutorial for that, I'm showing that. For runpodctl,
-
00:26:53 it is so faster. runpodctl send and the folder name while you are inside the accurate folder.
-
00:27:00 You see currently I'm inside this folder. It will first generate a zip file of the folder, then it
-
00:27:06 will give you a link to download all of them. But usually, this other method should work. You
-
00:27:11 see it has also downloaded. For runpodctl, I will copy this, open a CMD wherever I want to download,
-
00:27:18 and hit enter. Then it will use the runpodctl that I have in my disk and in my environment path. You
-
00:27:25 see it is way, way faster. Actually, installation of runpodctl is so easy. You just put it into a
-
00:27:31 folder like this, runpodctl.exe, and you add it into your environment variables, into your path
-
00:27:38 variable, like this. You see runpodctl. Then it will automatically recognize it to download.
-
00:27:43 So how I am going to terminate my machine? First of all, I need to stop this pod. Stop
-
00:27:49 pod. Even when I stop it, it will still use my credits because it is still using the disk space.
-
00:27:58 Then I need to terminate the pod and terminate pod and everything is deleted forever. If I were
-
00:28:04 using a storage system, there is no stopping there. So let me demonstrate quickly. Let's not
-
00:28:10 just break my template. Deploy on demand. When you use the network storage system,
-
00:28:15 you won't see a stop option because there is no stopping. You just terminate it. However,
-
00:28:20 this time, all the data will remain on my network storage system. So I will just terminate
-
00:28:27 it. Then next time when I use network storage system, my data will be there, already ready.
