ComfyUI - Make Every One a Masterpiece in Stable Diffusion with Model Merging by Blocks

7 Dec 202307:53

TLDRThe video script introduces Pixel's advanced generative AI courses, focusing on model merging within Comfy UI. It explains the complex workflow of checkpoint merges, showcasing how to combine different model blocks at varying ratios. The video guides viewers through the process, from selecting checkpoints to adjusting ratios for output, and emphasizes the importance of testing and saving checkpoints for interesting results. It also mentions the addition of a Lura file for more nuanced image creation, catering to both beginners and advanced users looking for control over their AI-generated images.


  • 🌟 Pixel now offers courses in generative AI, including a beginner's guide to stable diffusion and other advanced topics.
  • 🎓 The video discusses model merging within Comfy UI, a platform with features tailored for complex AI workflows.
  • 📊 Model merging involves combining different AI models, or 'checkpoints', at various stages of the process.
  • 🔧 Comfy UI has designated areas for testing, merging, and selection of checkpoints and VAEs.
  • 🔄 Model block merge is a technique for advanced users, allowing the combination of different blocks in varying ratios.
  • 📈 The main checkpoints (R1a, R1b, R2) are used in a sequential manner for input and output.
  • 🎨 The output's visual elements, such as color, architecture, and realism, can be tested and adjusted through model merging.
  • 📸 The video demonstrates how changing ratios can affect the output, aiming for better color separation and realism.
  • 💾 Checkpoints can be saved when a desirable result is achieved, using a large hard drive for storage.
  • 🔄 The process of model merging can be iterated, with different ratios and checkpoints, to achieve consistent and desired outcomes.
  • 🚀 Advanced users can explore more complex model merging techniques and incorporate additional elements like Lura files for enhanced results.

Q & A

  • What type of courses does Pixel now offer in generative AI?

    -Pixel now offers a range of courses in generative AI, including a beginner's guide to Stable Diffusion and other courses with specific focuses such as SDXL and Comfy UI.

  • How can one enroll in the generative AI courses mentioned?

    -To enroll in the generative AI courses, interested individuals should use the link provided in the description of the video.

  • What is Comfy UI and what are its capabilities?

    -Comfy UI is a platform with numerous features that allow users to perform model merging, a complex workflow involving testing areas, merge areas, and selection areas for checkpoints and VAEs.

  • What is model merging and how does it work in Comfy UI?

    -Model merging in Comfy UI involves combining different blocks of models in specific ratios. It's a more advanced technique suitable for users with some experience in generative AI, not recommended for complete beginners.

  • How are checkpoints selected and utilized in the model merging process?

    -Checkpoints are selected from a list, with the main checkpoints named R1, R1b, and R2. These are used in sequence, where the output from one model serves as the input for the next in the merging process.

  • What is the purpose of the K sampler in the model merging workflow?

    -The K sampler is used for testing the models. It allows users to work with a batch size, typically set to four, and view the outputs to adjust settings and ratios for the merge blocks.

  • How does changing the ratios in model merging affect the output?

    -Altering the ratios can significantly change the output, affecting color separation, realism, and other visual aspects of the generated images. It allows for fine-tuning the results to achieve desired effects.

  • What is the significance of saving checkpoints in the model merging process?

    -Saving checkpoints is important for preserving the results of successful merges. It allows users to revisit and test these configurations in the future without having to redo the entire process each time.

  • How can a Lura file be incorporated into the model merging workflow?

    -A Lura file can be added to the workflow to embed a specific style or characteristic into the generated images. It is attached at the bottom of the merge process and outputs to a checkpoint and the K sampler.

  • What are the main aspects to test when refining model merging ratios?

    -When refining model merging ratios, the main aspects to test include color contrast, realism, architectural details, and overall visual appeal to ensure consistent and desirable outcomes.

  • What is the recommended approach for users new to model merging?

    -For users new to model merging, it is recommended to start with simpler workflows that do not involve complex techniques like model block merging. As they gain experience, they can explore more advanced methods.



🎓 Introduction to Generative AI and Model Merging

This paragraph introduces the range of courses offered by Pixel on Generative AI, including a beginner's guide to Stable Diffusion and other related courses. It mentions the use of Comfy UI for model merging, a complex workflow that involves a testing area, merge area, and selection area for checkpoints and VAE. The video focuses on checkpoint merges, a technique suitable for advanced users, and provides a brief overview of the process, including the selection of checkpoints (R1, R1b, R2) and the use of different ratios for merging blocks. The goal is to achieve a balance in color, realism, and architectural detail in the output models.


🔧 Advanced Model Merging Techniques and Results

This paragraph delves into the advanced aspects of model merging, emphasizing the importance of consistent results across different ratios and checkpoints. It discusses the process of testing and refining the model to achieve desired outcomes in color contrast, realism, and architecture. The speaker shares their dissatisfaction with the architecture in the current results and explains how changing ratios can lead to improvements. The paragraph also introduces the use of a Lura file to embed within a checkpoint, offering an additional layer of complexity and control over the final output of the generative AI models.



💡Generative AI

Generative AI refers to the use of artificial intelligence to create or generate new content, such as images, music, or text. In the context of the video, it is the main focus of the courses offered by Pixel, which include topics like stable diffusion and other generative AI techniques.

💡Stable Diffusion

Stable Diffusion is a specific algorithm within the field of generative AI that is used to generate high-quality images from textual descriptions. It is one of the courses offered by Pixel, indicating that the video is discussing advanced techniques in AI-generated image creation.

💡Comfy UI

Comfy UI appears to be a user interface within the generative AI software that allows users to perform complex tasks such as model merging. It is designed to be feature-rich and user-friendly, enabling even those who are new to generative AI to navigate and utilize the software effectively.

💡Model Merging

Model merging is a process within AI where different models or parts of models are combined to create a new, hybrid model. This technique is used to achieve specific outcomes, such as improved color separation or enhanced realism in the generated images.


Checkpoints in the context of generative AI refer to saved states or versions of a model during the training or merging process. These checkpoints can be selected and used to produce different outputs, allowing users to experiment with various stages of model development.


VAE stands for Variational Autoencoder, which is a type of generative model used for unsupervised learning of latent variable models. In the video, it is one of the elements that users can choose during the model merging process, affecting the final output.

💡Color Separation

Color separation refers to the ability of an image to distinguish between different colors clearly and distinctly. In the context of the video, it is one of the outcomes that the user is trying to optimize through model merging, aiming for more realistic and visually appealing images.


Photorealism is the quality of an image or artwork that closely resembles a photograph in terms of detail and realism. In the video, the user is testing the generative AI models to produce images with high photorealism, particularly focusing on the appearance of the female models and architectural settings.

💡K Sampler

The K Sampler is a tool within the generative AI software that allows users to work with a specific number of samples or outputs (in this case, set to a batch size of four). It helps in testing and refining the models by providing a set of outputs to evaluate and compare.

💡Lura File

A Lura File is a specific type of file used in the generative AI process, which can be attached to a model to influence its output. In the video, it is used to create a modern, dark, and interesting aesthetic in the generated images.


Pixel now offers a range of courses in generative AI, including a beginner's guide to stable diffusion and other courses in generative AI such as sdxl and comfy UI.

The video discusses checkpoint merges, a model merging technique within comfy UI, which is particularly useful for advanced users.

Comfy UI has a testing area, a merge area, and a selection area for checkpoints and the VAE.

Model merging involves dealing with complex workflows, including testing and merging different blocks at various ratios.

The main checkpoints are referred to as R1, R1b, and R2, with R1 being the primary checkpoint.

The process involves selecting checkpoints for outputs and merging them through a series of models (R1, R1b, R2).

The output from the merge block is directed to a save checkpoint and a K sampler for testing.

The K sampler allows for working with testing in batches, with the batch size set to four.

The video demonstrates the use of three checkpoints with ratios of 0.5, aiming for outputs with a lot of color and architectural detail.

The results show a focus on the architecture, colors, realism, and the appearance of female models.

The video highlights the importance of adjusting ratios to achieve better color separation and more realistic-looking models.

Changing ratios can lead to different outcomes, allowing users to fine-tune their generative AI models for specific desired results.

Users can save interesting results by unmuting the save checkpoint and running the prompt again.

The saved checkpoints are stored on a large hard drive designated for diffusions created by the user.

The video emphasizes the importance of consistent results when fine-tuning model ratios.

The process is recommended for those who seek more control over the generative AI output and are willing to engage in more complex workflows.

The video also mentions the possibility of adding a Lura file to the model for additional creative output.

The Lura file attachment results in a modern, dark, and interesting aesthetic in the output.