ComfyUI's work into the door guide, even a small white man can understand the function of each node interpretation

Today we're going to learnComfyUItheWorkflow. The best tutorials for learning a new thing are always the examples provided on the official website.

Here I'll illustrate with an example from the official website, followed by an example.

This will allow us to get up to speed quickly and go further.

Official Tutorial: https://comfyanonymous.github.io/ComfyUI_examples/2_pass_txt2img/

Download the text: https://pan.quark.cn/s/46a899c45618

Example of official website

Tips: For the workflow just loaded in, we don't know whether all the local models exist, so the best practice is to click Run on the right side directly after loading to see what big model files are missing locally, and then download them according to the model file names in the prompt. It is recommended to use the common ftp download tool to download the models after getting the model name and model download address, the download speed of ComfyUI Model Manager is too slow!

116cf7efj00so1tuk000wd000u000a6p

Note: For those who don't have ComfyUI, you can read my post from yesterday.

Learn ComfyUI from the ground up with the ComfyUI Getting Started Tutorial!

Workflow functionality:This workflow generates images using a text-generated graph, then scales them using an amplifier, and then saves the images after processing;

Load this workflow:You can drag this image onto the page and the workflow is loaded in.

Reading order:These workflows are read in the same order as we read a book, left to right from top to bottom.

6d891b9aj00so1tv5000rd000u0009bp

Process Description:

1. Node 1, node 2 node 3, node 5 is mainly for node 4 to provide some basic raw material data, so that node 4 can generate Latent at ease;

2. Node 4 is processed using the previous base raw material to generate Latent;

3. Node 7, node 8 and node 10, node 11 convert Latent into a viewable image before saving it;

4. node 6 is scaling the Latent of node 4 and still outputs the Latent;

5. node 9 is to process the Latent of node 6 and other underlying raw material data to finally generate a new Latent for node 10 to process;

Overall:This workflow is to generate images based on the cue words, and then zoom in on the images, similar to a restaurant where there is a chef cooking and a lot of small workers serving him, and the chef's cooking will be given to the waiter;

Functional interpretation of each node:

Node 1: Checkpoint Loader

fe1133b3j00so1tvl0004d0007r003kp

This node is used toLoading model files, the working stream contains the "v2-1_768-ema-pruned.ckpt" model file by default。

Provide other subsequent nodes withModelParameters.

VAE: This parameter is used to help the model generate images better;

Node 2, Node 3: CLIP text encoder

These are 2 identical nodes that are used to fill in the prompts, and it's common to see what positive prompts and negative prompts are set up through these nodes.

Node 4: K Sampler

The core component that receives all the input data and processes it before feeding it into the image.

1092aa41j00so1tvu000cd0008b0082p

Node 5: Empty Latent

Blank images, used to set the size and number of images, and to give the sampler an empty Latent for the K sampler to fill;

Node 6: Latent Scaling

e1bf3e60j00so1tw40005d0007p003up

This node sets the size of the scaled image, the scaling method, whether to crop or not; and passes the processed Latent to the subsequent node;

Node 7, Node 10: VAE decoding

Receive VAE, Latent and convert to real image

Node 8, Node 11: Save image

It's for saving images.

Node 9: K Sampler

52d3869bj00so1twh000cd0008y0077p

Receive the model provided by the previous Checkpoint loader, the Latent provided by the previous node, and the positive and negative cue words, and generate the scaled Latent for subsequent nodes after processing;

raise one and infer three1

Since the previous example used text to generate a Latent, then scaled the Latent, and then processed it with a K-sampler to get a new Latent, what if we want to scale an existing image? What should we do?

My thought process is as follows:

I take a similar approach by loading an existing image into the workflow, converting the image to Latent, then scaling it with Latent, then processing it with the K sampler, and it's basically the same thing later.

Steps:

1. Load image

Double-click left mouse in blank position on the desktop and enter Load Image in the popup box

8ec95b8fj00so1twy000yd000u000d8p

07e7b103j00so1tx5000ed0008v009kp

2. Next node:

If we meet and do not know what to do next, we can work with the current output and our whole idea. Here's Image, when we drag a line out of the left mouse button, ComfyUI will show us what nodes we can use。

3a3ea3bbj00so1txb000id000d4008sp

HERE WE CHOOSE THE VAE CODE

aaaf4447j00so1txi000fd000f1008up

3. VAE code

VAE encoding has an input VAE, and an output Latent, and here we get a Latent, but don't scale it.

So next we drag a line at Latent and add a node with Latent scaling.

fbdd8ef4j00so1txp000kd000jl007op

ae27b994j00so1txv000ld000nm007mp

Here, I've set the width and height to be larger than the size of the original image.

4. Next node

Referring to the previous example on the official website, after Latent scaling, the next step is the K sampler, so I followed suit and added all the subsequent nodes

b4e01ee4j00so1ty3000gd000u0004up

5. Completion of other nodes

Here we find that the VAE Encoding, K Sampler, VAE Decoding, Positive and Negative Conditioning nodes all have some input parameters that are not connected, so we still have to complete them. Refer to the previous example on the official website to add other nodes so that we can connect all these unconnected nodes.

Similarly, I press the mouse to drag a line from the VAE here, and after releasing the left mouse button ComfyUI prompts me which nodes I can use, and I can select the target node from the list.

7ee42ae6j00so1tyc000hd000u0005jp

Then we drag out of the line, connect all the unconnected parameters and eventually get the following work flow, noting that the model file in the "Checkpoint Loader (Simply)" here is consistent with the official web example。

68f9923cj00so1tyk000qd000u0007jp

6. Execute and see the effect

2731eb4bj00so1tys000sd000u0007wp

The execution turned out to be a big disappointment, so far from our original image, so what's going on here?

According to the official website, the noise reduction parameter in the K-sampler has a big influence on this, we change this noise reduction parameter to the same value as the noise reduction parameter of the K-sampler in the official website's example, and try again.

cb9f1fb1j00so1tyz000td000u00078p

Hmmmmmmmmmmm, works great, now you get a zoomed in image that resembles the original just fine.

8d7b3081j00so1tz6001jd000nk00fmp

69d85e63j00so1tzc003id000u000s4p

raise one and infer three2

Hmmmmmmmmm, by creating our own new workflow earlier in the day has given me a lot of confidence, so is there any more ways to implement this kind of image enlargement? Let's keep trying.

My thoughts:

Is there a model for zooming in on an image? I'll try it with this and see?

1. Search images, models

f499a54ej00so1tzr000vd000u000dnp

A node was found through which the image was zoomed through the model.

7ab5ea8dj00so1tzx0004d0008w003lp

2. Next node

For this node, we still use the practice of 1 in the previous example, dragging out a line for the input and output parameters, and later selecting the appropriate node.

86e7f66dj00so1u07000sd000u0007sp

"Images amplified by model" directly connects the loaded images with the left image parameters

3. Scale-up models

Next press the left mouse button and drag out a line to see what nodes can be selected.

930a5c56j00so1u0d000td000jc009up

Select a Magnifying Model Loader

de8d86d7j00so1u0o0018d000o700ebp

This loader uses the real_esrgan_x2plus.pth model file.

4. Improve all the connections

After adding the loader, basically after the transformation of the workflow we have finished developing, and then the new workflow all connected to the line are connected, as shown in the figure:

4421cf0fj00so1u42008sd000u0009rp

5. View the effect

Here we execute the workflow directly to see how the final enlarged image looks.

2f0a2a67j00so1u1b001cd000u000fbp

c356c20dj00so1u1g001ld000n000fqp

6d6d26baj00so1u1m002td000u000rwp

Note: For those of us who are just learning ComfyUI, let's put aside the effect of enlarged images for now and focus on how to build a new workflow first. After you are familiar with building the workflow, then you can improve the quality of your work.

This article uses the following workflow:

ebbcdb05j00so1u1u001ad000u000gtp

Note: The workflow is exported as an image, you can right mouse click and in the right click option you can export it as a png carrying the workflow metadata to share it with more people.

at last

Well, through the previous official website examples of learning, we have mastered the text of the map and picture enlargement. And then by way of example, we can zoom in on existing pictures, the process we mastered the process of building a new workflow.

statement:The content of the source of public various media platforms, if the inclusion of the content violates your rights and interests, please contact the mailbox, this site will be the first time to deal with.
TutorialEncyclopedia

Learn ComfyUI from the ground up with the ComfyUI Getting Started Tutorial!

2024-12-5 10:25:27

Encyclopedia

Create photorealistic images with the Flux LORA model: AWPortraitCN for fast generation of highly realistic AI images

2024-12-7 10:12:28

Zenium
Search