0:00 hello I'm starting a new series of 0:01 tutorials on stable diffusion AI using 0:03…
- User
0:00 hello I'm starting a new series of 0:01 tutorials on stable diffusion AI using 0:03 the comfy UI interface every day I'm 0:06 learning more about it and uh I'll share 0:08 the things I've learned with you you 0:10 know I'll explain it from a graphic 0:12 designer's perspective in a way that's 0:14 easy to understand so anyone can use it 0:17 I'll structure it into episodes allowing 0:19 you to watch in a certain order and 0:21 progress from beginner to Advanced in 0:25 this first episode I'll discuss what 0:27 comfy UI is and its advantages and 0:30 disadvantages then we'll quickly go 0:32 through the installation process 0:35 download different models so by the end 0:37 of this video you'll be able to generate 0:39 your first image for free using your own 0:41 computer when it comes to stable 0:43 diffusion there are multiple interfaces 0:45 to choose from each with its own 0:47 characteristics some are easier to use 0:49 While others are more complex or faster 0:52 popular interfaces include automatic 0:54 1111 Forge UI invoke and today's Focus 0:58 comfy UI 1:00 comfy UI is a user interface framework 1:03 that lets you create and manage 1:05 workflows by visually connecting 1:07 different tasks um much like building 1:09 with Lego blocks each block or node 1:12 represents a specific function and by 1:15 connecting them you can easily construct 1:17 complex processes advantages of using 1:20 comfy UI comfy UI lets you create 1:23 workflows quickly and flexibly without 1:25 being limited by preset options each 1:28 node shows a specific function making it 1:30 easy to see the entire process you can 1:33 easily share your workflows um and use 1:35 ones made by others promoting 1:37 collaboration comfy UI requires no 1:39 coding just drag and drop nodes to 1:42 create and customize workflows for your 1:44 needs downsides of using comfy UI the 1:47 organization of nodes and comfy UI can 1:49 vary between workflows um which can be 1:52 confusing when using other people's 1:54 setups the detailed view of processes 1:56 might overwhelm uh average users who 1:59 prefer simpl 2:00 despite no coding requirements there is 2:02 a learning curve to effectively use 2:05 nodes and build workflows complex 2:07 workflows can affect performance um 2:10 slowing down your computer if it doesn't 2:11 meet system requirements despite these 2:14 downsides comfy UI remains a strong and 2:16 versatile tool uh for creating and 2:19 managing workflows especially for users 2:21 who need detailed control once you have 2:23 your workflow set up it is fast and 2:25 efficient initially I avoided comfy UI 2:28 because it seemed too complex with all 2:30 the 2:31 nodes but after spending a few days with 2:35 some 2:36 tutorials I started to appreciate its 2:39 capabilities so let's start with the Installing ComfyUI on Windows 2:41 installation um you can visit the GitHub 2:43 page for comy UI in the feature section 2:47 you'll find everything it can do such as 2:49 stable diffusion video stable audio and 2:52 other supported features there's also a 2:55 list of shortcuts um available finally 2:58 you'll find the installation 2:59 instructions I have Windows operating 3:01 system and an Nvidia RTX 4090 card so 3:05 I'll demonstrate the installation for 3:07 Windows and Nvidia if you have a 3:09 different operating system or graphics 3:11 card you can find installation 3:14 instructions below for those systems for 3:16 system requirements you'll need a recent 3:18 operating system and the more vram your 3:21 video card has the faster it will 3:23 generate especially if it's from the RTX 3:26 series therefore Nvidia cards are 3:29 preferred for for their speed I tested 3:31 it on a 6 GB vram video card and it 3:35 worked okay but not very quickly so I 3:38 would recommend opting for an Nvidia 3:39 card with at least 8 gigabyte of vram or 3:41 more and ensure you have 16 gigabyte of 3:44 ram in your system for a smoother 3:46 workflow for Windows it's quite 3:49 straightforward you just need to click 3:50 on the direct download link for the 3:53 portable version and choose a folder 3:55 where you want to store it I'll choose 3:56 to put it on my D drive and create a 3:59 folder named comfy UI the archive is in 4:02 7z format and you can extract it using 4:04 szip you can find a download link here 4:07 or in my case I have WinRAR and we'll 4:10 use that to extract it now let's 4:13 navigate into that newly extracted 4:15 folder you'll notice it indicates that 4:17 it's portable inside you'll find several 4:20 dobat files and a readme file that you 4:24 should read the readme file explains 4:26 which dobat file you need to run 4:28 depending on what you want to do for 4:30 Optimal Performance use Nvidia GPU 4:33 because it's much faster than the CPU 4:35 and the redmi file also includes 4:37 additional information such as where to 4:39 place the models and other relevant 4:41 details double click on the Run Nvidia 4:44 GPU dobat file and a command window will 4:47 open and this will launch the comfy UI 4:49 you can view here details about your 4:51 graphics card including how much vam and 4:53 RAM you have once it finishes a new 4:56 browser window will automatically open 4:59 display playing The Comfy UI interface 5:03 you can use the mouse wheel to zoom in 5:05 or out or you can use shortcuts like alt 5:07 plus and ALT minus you can move the 5:09 canvas around by clicking on it and 5:11 dragging or you can press the space bar 5:14 uh and move the cursor you can also 5:16 click on nodes and drag them around 5:18 arrange the interface so that it fits 5:20 your screen comfortably those little 5:22 rectangular windows are called nodes in 5:24 comfy UI you connect these nodes to load 5:27 models input text create images 5:30 and save your work in a step-by-step 5:32 process the lines between nodes show how 5:34 information moves between them 5:36 connecting each part of your work 5:38 together the Q prompt button in comfy UI 5:41 adds your current image generation task 5:43 to a list allowing multiple tasks to run 5:46 one after another automatically um if I 5:49 click on it it should generate an image 5:52 uh but instead I get an error first of 5:54 all when you encounter an error it's 5:56 helpful to look at which nodes the error 5:58 occurred in um you can see that the load 6:00 checkpoint node has a red outline and 6:03 the message says value is not in the 6:05 list which means it couldn't find that 6:07 specific checkpoint with that name on 6:09 our computer if I click on that list and 6:11 try to select a model um you'll notice I 6:14 can't find one because I haven't 6:16 downloaded any checkpoints for this to 6:18 work therefore we need a stable 6:20 diffusion model there in order for it to Downloading and Placing Models 6:22 work properly the easiest way to get 6:24 models is to visit the civit AI website 6:27 there you'll find a tab labeled model 6:30 click on it to see various types of 6:31 models what I like to do is sort them by 6:34 highest rating or most downloads you can 6:37 also use filters to select a specific 6:39 time period like a week or a month for 6:42 file format I prefer safe tensor because 6:45 it's safer than the ckpt format uh the 6:48 most popular models are typically v1.5 6:51 sdxl and recently sd3 I will select an 6:56 sdxl model which is the one I usually 6:59 use let's go to the search and look for 7:01 Juggernaut models here we have a few 7:04 options this one is the sdxl version and 7:08 this one is the v1.5 version I'll choose 7:11 the XL version and you can see there are 7:14 different versions available such as um 7:17 the hyper version however I prefer 7:19 version X because in my opinion it 7:21 offers better quality let's download 7:23 this model by clicking on the download 7:25 button with the down arrow icon after 7:27 that you need to place it in a specific 7:29 folder navigate to The Comfy UI folder 7:31 then locate the models directory inside 7:34 there's a folder named checkpoints where 7:36 you store all your stable diffusion 7:38 models um regardless of the version 7:41 click save and wait for the download to 7:44 complete since it's quite large around 6 7:47 GB it will take some time to finish 7:49 downloading let's download an SD v1.5 7:52 model as well suitable for those with 7:54 less powerful video cards to generate 7:56 images faster at lower sizes you can go 7:59 to the filters and select only v1.5 8:01 models or you can search for Juggernaut 8:04 again and choose the v1.5 version the 8:07 latest version is called reborn so you 8:09 can download that one before downloading 8:12 make sure to check for um the base model 8:15 label to ensure it's the correct base 8:17 model for example if it says 8:19 v1.5 it's crucial to use the same base 8:22 model across all your models this is 8:25 important because features like control 8:27 net will only work with you know the 8:30 same base model type for v1.5 models 8:33 you'll need v1.5 control net and related 8:36 extensions while sdxl models will 8:39 require corresponding sdxl components 8:41 and extensions for now it's important to 8:44 understand that the base model exists 8:47 and what type it is I'll talk more about 8:48 it in future episodes so don't stress to 8:51 much click download and place it in the 8:53 same U checkpoints folder as the 8:57 previous model if you check other models 9:00 you'll notice that each one specifies 9:02 its base model often with different 9:04 versions from various dates generally 9:07 newer versions have undergone more 9:08 training and provide better quality so 9:11 you'll likely prefer the latest version 9:14 if I quickly navigate to comfy UI then 9:16 go to models and checkpoints you'll see 9:19 that the download isn't finished yet 9:21 it's still in progress if I skip ahead a 9:24 few minutes both models the reborn and X 9:27 versions are now here and ready the 9:29 installation of comfy UI isn't 9:31 complicated at all you simply download 9:33 comfy and the model and you're done I 9:36 could have made a two-minute video 9:37 showing just that however I prefer to 9:40 explain each step in detail so you have 9:42 a better understanding of what's 9:43 happening this way you'll be able to do 9:46 more than just clicking generate and 9:49 getting an image you'll understand how 9:51 to use it effectively if you try to load Generating Your First Image 9:53 the newly downloaded model and nothing 9:55 happens it's likely because the comfy UI 9:57 was already open and when we downloaded 10:00 the model in this case you need to click 10:02 on refresh and now you should see the 10:05 models appear in the list both the 10:07 reborn and X versions should be visible 10:10 now I'll select the sdxl version I will 10:12 resize the node to see the model name 10:14 better you can only adjust it from uh 10:16 the bottom right corner after resizing 10:18 you can then move the node into place 10:20 now if I try to generate again using the 10:23 Q prompt you'll notice that we have a 10:26 green outline around this checkpoint 10:28 note um but that's not all you can 10:30 follow the flow to the next node and see 10:33 that it's also green if each node turns 10:36 green all the way to the end it means 10:38 the image was successfully generated 10:41 however if any nodes turn red there's a 10:43 problem that needs to be addressed and 10:45 for this prompt here is the result now 10:48 I'll choose the other model the reborn 10:50 version to see if it works I'll click on 10:52 Q prompt as you can see the flow moves 10:56 quickly from one node to the next you'll 10:57 notice in the command window that it 10:59 generated in just a few seconds the 11:01 first time may take longer um because 11:04 it's also loading the new model um if I 11:06 generate again you'll see it only took 11:08 one second for a 5 on 12 pixel image in 11:11 the next episode I'll provide more 11:14 detailed explanations of what each node 11:16 does but for now here's the short 11:19 version this workflow uh loads the model 11:22 using the uh load checkpoint node it 11:25 encodes the positive prompt where we 11:27 describe what we want like a glass 11:29 bottle and the negative prompt with 11:31 words you want to avoid like Watermark 11:33 using two clip text and code prompt 11:36 nodes these encoded prompts are then fed 11:39 into the case sampler node which adjusts 11:42 parameters such as seed steps and CFG to 11:46 generate a latent image based on these 11:48 inputs the latent image is decoded using 11:51 the vae decode node and the final step 11:54 involves saving the generated image with 11:57 the save image node each model performs 12:00 best with specific settings and many 12:02 models come with recommended 12:05 configurations if we return to the model 12:07 page and scroll down um clicking on show 12:11 more reveals all the details here you'll 12:13 find information such as recommended 12:15 image size number of steps and other 12:19 relevant settings these details help 12:21 optimize the 12:22 performance of each model according to 12:25 its 12:26 specifications as you can see here it 12:28 indicates 12:30 512x 768 pixels for the image width and 12:34 height the v1.5 base models were trained 12:37 on images sized 512 by 512 pixels you 12:42 can go slightly larger up to 768 pixels 12:45 but exceeding this might cause the model 12:47 to interpret the image as 2 512 pixel 12:49 images resulting in double heads and 12:52 various distortions so we can create 12:55 Square landscape and portrait images as 12:58 long as they are closed 13:00 to those values let's try the portrait 13:03 orientation look for the empty latent 13:06 image node and here you can enter the 13:09 width and height I will use 768 for the 13:12 height and press okay let's see what 13:15 else we have here it mentions um sampler 13:18 DPM plus plus 2m caras so we'll look for 13:22 sampler in the list we can find it here 13:25 although it doesn't have two plus signs 13:28 but it has two PS so it's essentially 13:32 the same but with a different name 13:34 however we don't have Caris in the name 13:36 instead Caris is placed under um Schuler 13:40 in uh in the next field so where it says 13:43 schedular normal um we replace normal 13:46 with Caris um it also mentions steps 35 13:49 and cfg7 so we'll add those values as 13:53 well since we're testing things out 13:55 let's also try their example if I look 13:57 where the images are 13:59 um and click on the I button I can see 14:03 the prompts and settings used to 14:05 generate that image I can copy the 14:08 positive prompt and paste it into my 14:10 positive prompt field and do the same 14:12 for the negative prompt you'll notice 14:15 the settings are the same only the seat 14:17 is fixed but I'll leave mine random when 14:20 I cue The Prompt I get this beautiful 14:22 portrait image not bad for a v1.5 14:27 model uh let me try a few more Times Yes 14:29 it seems to be working just fine now Saving and Loading Workflows 14:32 that we've configured all the settings 14:33 and everything is working well we don't 14:36 want to set up these configurations 14:37 every time instead we can save the 14:39 entire workflow so we can return to it 14:41 later or you know share it with others 14:44 click on Save and save it in a location 14:48 where you can easily find it again I 14:51 recommend creating a workflows folder 14:54 somewhere on your drive for organization 14:57 uh give it a descriptive name so you 14:59 know what it's all about and and there 15:02 you have it you've created um your 15:04 working 15:05 v1.5 um workflow for this specific model 15:09 let's go to the sdxl model page for the 15:13 Juggernaut version XR 10 and uh click on 15:16 show more here we have recommended 15:20 settings for both the normal version and 15:22 the hyper version since we downloaded 15:24 the normal version we'll use the 15:26 settings for that one now let's load 15:29 that sdxl model into our comfy UI 15:35 interface I prefer the sdxl model over 15:38 v1.5 because now I can create 1024px 15:41 images if you enter values for width and 15:43 height around that number it should work 15:45 fine the sampler steps and CFG settings 15:50 um are similar to the other Juggernaut 15:52 model so I'll leave those the 15:54 same I'll copy the positive and negative 15:57 prompts from one of the examples to see 15:59 what we can get since the image width 16:02 and height are larger it will take 16:05 longer to 16:07 generate however the image quality is 16:09 better in my 16:10 opinion so now we have a working 16:14 workflow for sdxl as well we can save 16:17 this workflow to preserve all the 16:18 settings for later I'll give it a name 16:20 that I'll remember now that the workflow 16:23 is saved we can clear the current 16:25 workflow using the clear button using 16:28 the load button we can load other 16:30 workflows for example I can load the um 16:33 reborn version if I want or I can click 16:36 load again to get the sdxl version 16:38 workflow everything works fine now as 16:42 you can see I can test it quickly and it 16:44 works great let me show you where the 16:47 generated images are saved you can 16:49 navigate to The Comfy UI folder then 16:52 into uh the output folder here you'll 16:55 find all the images that have been 16:57 generated um another cool feature is 17:00 that these images embed the workflow 17:02 information so if you drag an image into 17:05 the comfy UI interface it will load the 17:07 workflow used to generate that 17:09 image for example um this image was uh 17:14 generated with reborn and it contains 17:18 the uh positive and negative prompts as 17:21 well as the settings if I drag another 17:23 image you'll see that the settings are 17:25 different for that 17:26 image if we want to close comfy UI we 17:30 can simply close the command window uh 17:32 you'll notice in the interface it says 17:34 reconnecting but if you refresh nothing 17:36 will be 17:37 there let me show you another thing uh 17:39 first I'll delete the zip archive we use 17:42 to um extract comfy UI to save some 17:45 space then to make it easier for us to 17:48 start comfy UI without navigating to the 17:51 folder uh we can create a shortcut for 17:53 it right click on the Run Nvidia GPU bat 17:57 file then go to send to and choose 18:00 desktop this will create a shortcut on 18:02 the desktop for it now if we go to the 18:05 desktop we can give it a better name 18:07 like comfy UI right click on it and 18:09 select properties then click on change 18:13 icon click okay and you can select an 18:16 icon from there such as a star perhaps 18:18 click okay and then 18:20 apply um let's see if it 18:22 works double click on it and yes it's 18:25 loading the command window and now we 18:27 have the last interface we used so now 18:29 we can clear the workflow and create one 18:32 from scratch I'll show you how to do 18:33 that in the next episode you can load 18:35 the default 18:37 workflow um but for now let's load the 18:39 sdxl workflow and test it with a cute 18:44 cartoon house the house looks 18:46 cute if you want to do more such as Installing ComfyUI Manager 18:48 loading other people's workflows or 18:50 installing custom nodes you'll need a 18:53 manager for that called comfy UI manager 18:56 and you can find it on the GitHub page 18:58 page and I highly recommend getting it 19:02 just follow these instructions to 19:03 install it navigate to The Comfy UI 19:06 folder then go to custom nodes in the 19:09 address bar type acmd and press enter 19:12 this will open a command window next 19:15 copy the text from step two and paste it 19:17 into the command window then uh press 19:19 enter this action um will uh clone or 19:24 copy the custom node uh which we refer 19:27 to as the manager into your folder wait 19:30 for the process to finish then you can 19:32 close the command window to restart 19:34 comfy UI close the command window and 19:37 reopen um The Comfy UI interface the 19:40 first time you do this it will perform 19:42 some initial setup tasks such as 19:44 installing the necessary components for 19:46 the manager to function which are called 19:48 dependencies because it relies on them 19:51 and now you will notice in the bottom 19:53 right corner you have a button called 19:56 manager if you click on it you can see 19:59 it has more options and buttons from 20:02 here you can update everything or just 20:05 the comfy UI for example if I click on 20:08 it you can see in the command window 20:11 that it is checking for updates uh when 20:15 it's done you'll see a successful update 20:17 message in the 20:19 interface also next time you need to 20:22 restart just go to manager and hit 20:25 restart instead of closing the command 20:28 window and trying to reopen it it will 20:31 handle everything for you and open a new 20:34 tab with a fresh interface one useful 20:37 feature is that if you install a 20:39 workflow from someone else that includes 20:42 custom nodes not on your computer you 20:44 can click on install missing nodes here 20:47 you'll see all the missing node names 20:49 listed uh with the option to install 20:51 them on the right in the next episode 20:54 I'll demonstrate how to build a workflow 20:56 from scratch and understand its 20:57 components I'll explain what each node 21:00 means how to add them move them connect 21:02 them and more if you find this helpful 21:05 please leave a like thank you for 21:06 watching 21:12 [Music] traduza para o portuugues e reescreva tirando os numeros de tempo quero criar um audio
- Assistant
Olá! Estou começando uma nova série de tutoriais sobre a IA de Diffusão Estável usando a interface Comfy UI. A cada dia, estou aprendendo mais sobre isso e compartilharei o que aprendi com você. Vou explicar tudo do ponto de vista de um designer gráfico, de modo que seja fácil de entender e qualquer um possa usar. Estruturarei isso em episódios, permitindo que você assista em uma ordem específica e progrida de iniciante a avançado.
Neste primeiro episódio, discutirei o que é a Comfy UI e suas vantagens e desvantagens. Em seguida, passaremos rapidamente pelo processo de instalação e pelo download de diferentes modelos, para que, ao final deste vídeo, você consiga gerar sua primeira imagem de graça usando seu próprio computador.
Quando se trata de difusão estável, existem várias interfaces, cada uma com suas características. Algumas são mais fáceis de usar, enquanto outras são mais complexas ou rápidas. As interfaces populares incluem Automatic1111, Forge UI, Invoke e o foco de hoje, Comfy UI. A Comfy UI é uma framework de interface de usuário que permite criar e gerenciar fluxos de trabalho ao conectar visualmente diferentes tarefas. É semelhante a construir com blocos de Lego; cada bloco ou nó representa uma função específica e, ao conectá-los, você pode facilmente construir processos complexos.
As vantagens do uso da Comfy UI incluem a possibilidade de criar fluxos de trabalho de maneira rápida e flexível, sem ser limitado por opções predefinidas. Cada nó exibe uma função específica, facilitando a visualização de todo o processo. É possível compartilhar seus fluxos de trabalho e usar os criados por outras pessoas, promovendo a colaboração. Além disso, a Comfy UI não requer programação; basta arrastar e soltar os nós para criar e personalizar os fluxos de trabalho conforme suas necessidades.
As desvantagens incluem a organização dos nós na Comfy UI, que pode variar entre os fluxos de trabalho, o que pode ser confuso ao usar as configurações de outras pessoas. A visualização detalhada dos processos pode sobrecarregar usuários comuns que preferem interfaces mais simples. Apesar de não haver requisitos de programação, existe uma curva de aprendizado para usar eficazmente os nós e construir fluxos de trabalho. Fluxos de trabalho complexos podem afetar o desempenho, desacelerando seu computador, se ele não atender aos requisitos do sistema.
Apesar dessas desvantagens, a Comfy UI continua sendo uma ferramenta forte e versátil para criar e gerenciar fluxos de trabalho, especialmente para usuários que precisam de controle detalhado. Uma vez que seu fluxo de trabalho esteja configurado, ele é rápido e eficiente. Inicialmente, evitei a Comfy UI porque parecia complexa, mas após passar alguns dias com alguns tutoriais, comecei a apreciar suas capacidades.
Agora, vamos ao processo de instalação. Você pode visitar a página do GitHub da Comfy UI, onde encontrará tudo o que ela pode fazer, como difusão estável em vídeo, áudio e outros recursos suportados. Existe também uma lista de atalhos. As instruções de instalação estão disponíveis; eu estou usando o sistema operacional Windows e uma placa de vídeo Nvidia RTX 4090, então demonstrarei a instalação para Windows e Nvidia. Se você tiver um sistema operacional ou uma placa de vídeo diferente, encontrará instruções de instalação abaixo para esses sistemas.
Para os requisitos do sistema, você precisará de um sistema operacional recente e quanto mais VRAM sua placa de vídeo tiver, mais rápido será o processo de geração, especialmente se for da série RTX. Por isso, placas Nvidia são preferidas pela velocidade. Testei em uma placa de vídeo com 6 GB de VRAM e funcionou, mas não muito rapidamente, então eu recomendaria optar por uma placa Nvidia com pelo menos 8 GB de VRAM ou mais e garantir que você tenha 16 GB de RAM no seu sistema para um fluxo de trabalho mais suave.
Para Windows, é bastante simples: você só precisa clicar no link de download direto da versão portátil e escolher uma pasta onde deseja armazená-la. Eu escolhi colocar no meu drive D e criar uma pasta chamada Comfy UI. O arquivo está no formato 7z e você pode extraí-lo usando 7-Zip; eu tenho o WinRAR e vou usá-lo para extrair. Agora vamos navegar até a nova pasta extraída. Você notará que indica que é portátil. Dentro, haverá vários arquivos .bat e um arquivo README que você deve ler. O arquivo README explica qual arquivo .bat você precisa executar dependendo do que você deseja fazer. Para performance ideal, use a GPU Nvidia, pois é muito mais rápida do que a CPU. O arquivo README também inclui informações adicionais, como onde colocar os modelos e outros detalhes relevantes.
Dê um clique duas vezes no arquivo .bat "Run Nvidia GPU" e uma janela de comando será aberta, iniciando a Comfy UI. Você verá detalhes sobre sua placa gráfica, incluindo quanta VRAM e RAM você possui. Quando terminar, uma nova janela do navegador será aberta automaticamente, exibindo a interface da Comfy UI. Você pode usar a roda do mouse para aumentar ou diminuir o zoom, ou usar atalhos como ALT + e ALT -. Você pode mover a tela clicando e arrastando, ou pressionar a barra de espaço e mover o cursor. Também pode clicar nos nós e arrastá-los, organizando a interface para que se ajuste confortavelmente à sua tela. Essas pequenas janelas retangulares são chamadas de nós na Comfy UI. Você conecta esses nós para carregar modelos, inserir texto, criar imagens e salvar seu trabalho em um processo passo a passo. As linhas entre os nós mostram como as informações se movem entre eles, conectando cada parte do seu trabalho.
O botão "Q Prompt" na Comfy UI adiciona sua tarefa atual de geração de imagem a uma lista, permitindo que várias tarefas sejam executadas uma após a outra automaticamente. Se eu clicar nesse botão, deve gerar uma imagem; no entanto, se ocorrer um erro, é útil verificar em quais nós o erro ocorreu. Você verá que o nó "Load Checkpoint" tem um contorno vermelho e a mensagem diz "value is not in the list", o que significa que ele não conseguiu encontrar esse checkpoint específico com esse nome no seu computador. Se eu clicar nessa lista e tentar selecionar um modelo, notarei que não consigo encontrar um porque ainda não fiz o download de nenhum checkpoint para que isso funcione. Portanto, precisamos de um modelo de difusão estável para que funcione corretamente.
A maneira mais fácil de obter modelos é visitar o site civit AI. Lá você encontrará uma aba chamada "Model". Clique nela para ver vários tipos de modelos. Eu gosto de classificá-los pela maior classificação ou mais downloads. Você também pode usar filtros para selecionar um período de tempo específico, como uma semana ou um mês. Para o formato de arquivo, prefiro "safe tensor" porque é mais seguro do que o formato ckpt. Os modelos mais populares são tipicamente v1.5, SDXL e, recentemente, SD3. Vou selecionar um modelo SDXL, que é o que costumo usar. Vamos à busca e procurar por "Juggernaut". Aqui temos algumas opções, sendo uma a versão SDXL e outra a versão v1.5. Vou escolher a versão XL e você pode ver que existem diferentes versões disponíveis, como a versão hyper. No entanto, prefiro a versão X porque, em minha opinião, oferece melhor qualidade. Vamos fazer o download desse modelo clicando no botão de download com o ícone de seta para baixo. Depois disso, você precisará colocá-lo em uma pasta específica. Navegue até a pasta Comfy UI, localize o diretório de modelos e dentro haverá uma pasta chamada "checkpoints", onde você armazenará todos os seus modelos de difusão estável, independentemente da versão. Clique em salvar e aguarde o download ser concluído. Como é bastante grande, cerca de 6 GB, pode levar algum tempo.
Vamos baixar também um modelo SD v1.5, que é adequado para aquelas placas de vídeo menos poderosas, para gerar imagens mais rápidas em tamanhos menores. Você pode ir aos filtros e selecionar apenas os modelos v1.5 ou pode buscar novamente por "Juggernaut" e escolher a versão v1.5. A versão mais recente é chamada "reborn", então você pode baixar essa. Antes de fazer o download, certifique-se de verificar a etiqueta do modelo base para garantir que seja o modelo correto. Se disser v1.5, é crucial usar o mesmo tipo de modelo base em todos os seus modelos. Isso é importante porque recursos como ControlNet só funcionarão com o mesmo tipo de modelo base. Para modelos v1.5, você precisará do ControlNet v1.5 e das extensões relacionadas, enquanto os modelos SDXL exigirão componentes e extensões correspondentes do SDXL.
Por enquanto, é importante entender que o modelo base existe e qual é o seu tipo. Farei mais discussões sobre isso em episódios futuros, então não se preocupe muito com isso. Clique em baixar e coloque-o na mesma pasta de “checkpoints” que o modelo anterior. Se você verificar outros modelos, notará que cada um especifica seu modelo base, geralmente com versões diferentes de várias datas. Em geral, versões mais novas passaram por mais treinamento e oferecem melhor qualidade, então você provavelmente preferirá a versão mais recente.
Se eu navegar rapidamente até a Comfy UI, então até modelos e checkpoints, você verá que o download ainda não foi concluído; ele ainda está em progresso. Se eu avançar alguns minutos, ambos os modelos, o "reborn" e o "X", estão agora aqui e prontos. A instalação da Comfy UI não é complicada; você simplesmente faz o download da Comfy UI e do modelo e pronto. Poderia ter feito um vídeo de dois minutos mostrando apenas isso. No entanto, prefiro explicar cada passo em detalhes para que você tenha uma melhor compreensão do que está acontecendo. Dessa maneira, você fará mais do que apenas clicar em gerar e obter uma imagem; você entenderá como usá-la eficazmente.
Se você tentar carregar o modelo recém-baixado e nada acontecer, provavelmente é porque a Comfy UI já estava aberta quando fizemos o download do modelo. Neste caso, você precisa clicar em "refresh" (atualizar) e agora você deve ver os modelos aparecerem na lista. Ambos, as versões "reborn" e "X", devem estar visíveis agora. Vou selecionar a versão SDXL e redimensionar o nó para ver o nome do modelo melhor. Você só pode ajustar a partir do canto inferior direito. Após redimensioná-lo, você pode mover o nó para o lugar. Agora, se eu tentar gerar novamente usando o "Q Prompt", notará que temos um contorno verde ao redor deste nó de checkpoint. Mas não é só isso; você pode seguir o fluxo até o próximo nó e ver que ele também está verde. Se todos os nós ficarem verdes até o final, significa que a imagem foi gerada com sucesso. No entanto, se algum nó ficar vermelho, há um problema que precisa ser solucionado.
E quanto a esse prompt, aqui está o resultado. Agora vou escolher o outro modelo, a versão "reborn", para ver se funciona. Clicando em "Q Prompt", você verá que o fluxo se move rapidamente de um nó para outro. Você notará na janela de comando que a geração ocorreu em apenas alguns segundos. A primeira vez pode demorar mais, pois está carregando o novo modelo. Se eu gerar novamente, você verá que apenas levou um segundo para gerar uma imagem de 512 por 512 pixels.
No próximo episódio, fornecerei explicações mais detalhadas sobre o que cada nó faz, mas por agora aqui está a versão resumida. Este fluxo de trabalho carrega o modelo usando o nó "load checkpoint", codifica o prompt positivo onde descrevemos o que queremos, como uma garrafa de vidro, e o prompt negativo com palavras que queremos evitar, como "watermark", usando dois nós de "clip text" e "code prompt". Esses prompts codificados são então alimentados no nó de "case sampler", que ajusta parâmetros como a semente, passos e CFG para gerar uma imagem latente com base nessas entradas. A imagem latente é decodificada usando o nó "vae decode" e o passo final envolve salvar a imagem gerada com o nó "save image".
Cada modelo se sai melhor com configurações específicas, e muitos modelos vêm com recomendações de configuração. Se voltarmos à página do modelo e rolarmos para baixo, clicando em "show more" (mostrar mais), podemos ver todos os detalhes. Aqui você encontrará informações como tamanho recomendado da imagem, número de passos e outras configurações relevantes. Esses detalhes ajudam a otimizar o desempenho de cada modelo de acordo com suas especificações. Como você pode ver, ele indica 512x768 pixels para a largura e altura da imagem. Os modelos base v1.5 foram treinados em imagens com 512 por 512 pixels. Você pode aumentar ligeiramente, até 768 pixels, mas ultrapassar isso pode fazer com que o modelo interprete a imagem como duas imagens de 512 pixels, resultando em cabeças duplas e várias distorções. Portanto, podemos criar imagens quadradas, paisagens e retratos desde que fiquem próximas desses valores.
Vamos tentar a orientação retrato. Procure pelo nó de imagem latente vazio e aqui você pode entrar com a largura e altura. Eu usarei 768 para a altura e pressionarei OK. Vamos ver o que mais temos aqui. Menciona o sampler "DPM++ 2M Caras", então vamos procurar "sampler" na lista. Podemos encontrá-lo aqui, embora não tenha dois mais, mas tem dois PS, então é essencialmente o mesmo, mas com um nome diferente. No entanto, não temos "Caras" no nome, em vez disso, o Caras está colocado sob "Schuler" no próximo campo. Então, onde diz "schedular normal", substituímos "normal" por "Caras". Também menciona passos 35 e CFG 7, então vamos adicionar esses valores também.
Agora, como estamos testando coisas, vamos tentar o exemplo deles. Se eu olhar onde estão as imagens e clicar no botão "i", posso ver os prompts e configurações usados para gerar aquela imagem. Posso copiar o prompt positivo e colá-lo no meu campo de prompt positivo, e fazer o mesmo para o prompt negativo. Você notará que as configurações são as mesmas, apenas a semente é fixa, mas deixarei a minha em aleatório. Quando eu aciono o prompt, obtenho esta bela imagem de retrato. Não é nada mal para um modelo v1.5. Deixe-me tentar mais algumas vezes. Sim, parece que está funcionando muito bem agora.
Agora que configuramos todas as configurações e tudo está funcionando bem, não queremos configurar essas configurações toda vez. Em vez disso, podemos salvar todo o fluxo de trabalho para que possamos voltar a ele mais tarde ou compartilhá-lo com outras pessoas. Clique em "Save" (Salvar) e salve em um local onde possa encontrá-lo facilmente. Recomendo criar uma pasta "workflows" (fluxos de trabalho) em algum lugar no seu disco para organização. Dê um nome descritivo para que saiba do que se trata e lá está, você criou seu fluxo de trabalho v1.5 para este modelo específico.
Vamos até a página do modelo SDXL para a versão Juggernaut XR 10 e clicar em "show more". Aqui temos configurações recomendadas tanto para a versão normal quanto para a versão hyper. Como baixamos a versão normal, usaremos as configurações para ela. Agora vamos carregar esse modelo SDXL em nossa interface Comfy UI. Prefiro o modelo SDXL ao v1.5, pois agora posso criar imagens de 1024px. Se você inserir valores para largura e altura em torno desse número, deve funcionar bem. As configurações de amostragem, passos e CFG são semelhantes à outra versão do modelo Juggernaut, então deixarei assim.
Vou copiar os prompts positivos e negativos de um dos exemplos para ver o que podemos obter. Como a largura e altura da imagem são maiores, levará mais tempo para gerar, no entanto, a qualidade da imagem é melhor na minha opinião. Agora temos um fluxo de trabalho funcionando para o SDXL também. Podemos salvar esse fluxo de trabalho para preservar todas as configurações para mais tarde. Darei a ele um nome que eu lembre.
Agora que o fluxo de trabalho está salvo, podemos limpar o fluxo de trabalho atual usando o botão "clear". Usando o botão "load" (carregar), podemos carregar outros fluxos de trabalho. Por exemplo, posso carregar a versão "reborn" se quiser, ou posso clicar em "load" novamente para obter o fluxo de trabalho da versão SDXL. Tudo funciona bem agora. Como você pode ver, posso testar rapidamente e está tudo ótimo.
Deixe-me mostrar onde as imagens geradas são salvas. Você pode navegar até a pasta Comfy UI, depois na pasta "output". Aqui você encontrará todas as imagens que foram geradas. Outra função interessante é que essas imagens incorporam as informações do fluxo de trabalho, então se você arrastar uma imagem para a interface Comfy UI, ela carregará o fluxo de trabalho usado para gerar aquela imagem. Por exemplo, esta imagem foi gerada com a versão "reborn" e contém os prompts positivos e negativos, bem como as configurações. Se eu arrastar outra imagem, verá que as configurações são diferentes para aquela imagem.
Se quisermos fechar a Comfy UI, podemos simplesmente fechar a janela de comando. Você notará que na interface diz "reconnecting", mas se você atualizar, nada estará lá. Deixe-me mostrar outra coisa. Primeiro, vou excluir o arquivo zip que usamos para extrair a Comfy UI, para economizar espaço. Para facilitar, podemos criar um atalho para iniciar a Comfy UI sem navegar até a pasta. Clique com o botão direito do mouse no arquivo .bat "Run Nvidia GPU", vá em "send to" e escolha "desktop". Isso criará um atalho na área de trabalho. Agora, se formos até a área de trabalho, podemos dar a ele um nome melhor, como "Comfy UI". Clique com o botão direito e selecione "properties", depois clique em "change icon". Você pode selecionar um ícone, como uma estrela, talvez. Clique em OK e depois em aplicar. Vamos ver se funciona; clique duas vezes nele e sim, está carregando a janela de comando e agora temos a última interface que usamos.
Agora podemos limpar o fluxo de trabalho e criar um do zero. Vou mostrar como fazer isso no próximo episódio. Você pode carregar o fluxo de trabalho padrão, mas por agora, vamos carregar o fluxo de trabalho SDXL e testá-lo com uma casa de cartoon fofa. A casa parece fofa.
Se você quiser fazer mais, como instalar gerenciadores da Comfy UI, carregar fluxos de trabalho de outras pessoas ou instalar nós personalizados, precisará de um gerenciador para isso chamado Comfy UI Manager, que você pode encontrar na página do GitHub. Eu recomendo fortemente obtê-lo. Basta seguir essas instruções para instalá-lo. Navegue até a pasta Comfy UI, então vá para "custom nodes". Na barra de endereço, digite "cmd" e pressione enter. Isso abrirá uma janela de comando. Em seguida, copie o texto da etapa dois e cole na janela de comando, depois pressione enter. Essa ação clonará ou copiará o nó personalizado, que chamamos de gerenciador, para sua pasta. Espere o processo terminar e depois você pode fechar a janela de comando.
Para reiniciar a Comfy UI, feche a janela de comando e reabra a interface da Comfy UI. Na primeira vez que você fizer isso, ele realizará algumas tarefas iniciais, como instalar os componentes necessários para o funcionamento do gerenciador, que são chamados de dependências. Agora você notará que no canto inferior direito há um botão chamado "manager" (gerenciador). Se você clicar nele, verá mais opções e botões. Aqui você pode atualizar tudo ou apenas a Comfy UI. Por exemplo, se eu clicar, você verá na janela de comando que está verificando atualizações. Quando terminar, você verá uma mensagem de atualização bem-sucedida na interface. Também, na próxima vez que precisar reiniciar, basta ir até "manager" e clicar em "restart" (reiniciar) em vez de fechar a janela de comando e tentar reabri-la. Isso cuidará de tudo para você e abrirá uma nova aba com uma interface fresca.
Um recurso útil é que se você instalar um fluxo de trabalho de outra pessoa que inclua nós personalizados que não estão no seu computador, você pode clicar em "install missing nodes" (instalar nós ausentes). Aqui você verá todos os nomes dos nós ausentes listados, com a opção de instalá-los à direita. No próximo episódio, vou demonstrar como construir um fluxo de trabalho do zero e entender seus componentes. Vou explicar o que cada nó significa, como adicionar, mover, conectar e muito mais. Se você achou isso útil, por favor, deixe um like. Obrigado por assistir!