Differential Diffusion - Inpainting on Steroids!

Olivio Sarikas
3 Apr 202406:32

TLDRThe video introduces differential diffusion, a powerful image inpainting technique that offers two main advantages: better understanding of image content for more natural inpainting, and the ability to use gray values to define the extent of changes on a pixel-by-pixel basis. It also demonstrates how to apply this method in a software called comi, showing the process from loading a model to generating a mask and the impact of differential diffusion on the final result. The comparison between differential diffusion and classic inpainting highlights the former's superior performance in rendering details, especially with complex structures like facial features.


  • 🎨 Differential diffusion is a powerful technique in image editing that offers a more natural inpainting process.
  • 🚀 It allows for greater control over the image by using different gray values to define the areas and intensity of changes.
  • 🌟 The darker the gray value in the mask, the more the image in that area will be replaced or altered.
  • 🛠️ Currently, differential diffusion is not natively supported in Automatic 1111 but can be utilized within other software like Blood and Comi.
  • 🔄 With the new update in the software, users can enable differential diffusion, adjust mask settings, and select models for rendering.
  • 🖌️ In Comi, the workflow involves a classic process of loading a model, using positive and negative prompts, and applying a mask for detailed adjustments.
  • 👓 The use of differential diffusion results in better understanding of facial structures, as demonstrated by the successful addition of sunglasses that fit naturally onto the face.
  • 🔍 A comparison between classic inpainting and differential diffusion shows the latter's advantage in creating more coherent and realistic image edits.
  • 💻 Users may need to install additional components or update the software to the latest version to access and use differential diffusion features.
  • 📸 Tweaking the mask size and D noise value can help improve the inpainting results, although there may be a learning curve to achieve perfect results.

Q & A

  • What is differential diffusion in the context of image editing?

    -Differential diffusion is a method used in image editing that allows for a more natural inpainting of images by understanding the content of the image better and replacing the targeted areas with greater accuracy.

  • What are the two main benefits of using differential diffusion?

    -The two main benefits are: 1) It provides a better understanding of the image content, leading to more natural inpainting, and 2) It enables the user to define the extent of inpainting on a pixel-by-pixel level using different gray values.

  • Is differential diffusion available in automatic 1111?

    -No, differential diffusion is not yet available in automatic 1111. However, it can be used inside blood diffusion, although the speaker mentions having trouble running it.

  • How can one access differential diffusion in a fresh install of flut diffusion?

    -In a fresh install of flut diffusion, one can find differential diffusion under the scripts section, where it is one of the choices after a new update.

  • What are the steps to enable differential diffusion in flut diffusion?

    -To enable differential diffusion, go to the scripts section, select differential diffusion, apply a mask, invert if needed, set the mask strength, and choose a model which will be downloaded during the first rendering process.

  • How can a mask be used in differential diffusion?

    -A mask can be loaded or generated within the software, and the user can paint onto the image on the areas they want to replace or change. The darker the value in the mask, the more the image will be replaced.

  • What is the role of the preview bridge in the workflow?

    -The preview bridge, from the impact pack, is useful as it allows the user to see the image they can paint the mask on and then process it further in the workflow.

  • How does the mask blending process work with a Gaussian blur?

    -Applying a Gaussian blur to the mask makes its edges soft and blends it better with the rest of the image, improving the overall inpainting result.

  • What are the differences observed between differential diffusion and classic inpainting in the example provided?

    -The differential diffusion method better understands the structure of the face, creating a more accurate and natural inpainting result, such as properly fitting sunglasses and smoothly blending into the hair, whereas the classic inpainting method resulted in less satisfactory details.

  • What adjustments were made to the mask and D noise to improve the inpainting result?

    -The mask was made bigger, and the value of the D noise was lowered, while also turning off the mask blurring, to achieve a more accurate and satisfactory inpainting result.

  • What is the recommended process for installing new custom nodes in flut diffusion?

    -To install new custom nodes, go to the manager window, click on update all for the newest version, and if there are any red notes in the workflow, click on install missing custom nodes and then install the suggested items before restarting flut diffusion.



🎨 Introducing Differential Diffusion in Image Editing

This paragraph introduces the concept of differential diffusion in image editing, highlighting its two main benefits. The first benefit is the method's enhanced understanding of image content, allowing for more natural inpainting of selected areas. The second benefit is the ability to use varying gray values to precisely define the extent of inpainting on a pixel-by-pixel basis. The script also mentions that this technique is not yet integrated into Automatic 1111 but can be utilized within Blood Diffusion, although it notes difficulties in getting it to run. The speaker shares their experience with a fresh installation of Flut Diffusion and guides the user through the process of enabling differential diffusion, adjusting mask strength, and selecting models for rendering. The paragraph concludes with a brief mention of the availability of this workflow for Patron supporters.


🖌️ Applying Differential Diffusion in a Practical Workflow

The second paragraph delves into the practical application of differential diffusion within a workflow, specifically in the context of Comi. It begins by outlining a basic process involving model loading, positive and negative prompts, and VAE decoding for image generation. The paragraph then introduces the concept of a 'preview bridge' from the Impact Pack, which aids in visualizing the image and mask for further processing. The speaker provides a step-by-step guide on painting the mask and saving the changes, emphasizing the importance of mask softness for seamless integration with the rest of the image. A comparison is made between the results of differential diffusion and classic inpainting methods, demonstrating the superior performance of the former in maintaining the structural integrity of the image, particularly in generating sunglasses and fitting them naturally onto the face. The paragraph concludes with instructions on installing necessary components for the workflow and invites user feedback on this new method.



💡differential diffusion

Differential diffusion is a technique used in image processing that allows for a more natural inpainting of images by understanding the structure and content of the image more effectively. It is a method that can replace traditional inpainting methods, offering the ability to define the areas and intensity of the image to be altered on a pixel-by-pixel basis using different gray values. In the context of the video, this technique is used to enhance the quality of image generation, particularly in the inpainting process where it demonstrates a better understanding of facial structures, such as creating sunglasses on a face and fitting them naturally into the image.


Inpainting is a process in digital image processing that involves filling in missing or damaged parts of an image with new content that matches the surrounding area. It is a form of image restoration that aims to create a seamless integration of the new content with the existing image. In the video, inpainting is discussed in the context of using differential diffusion to replace or change certain elements within an image, such as adding sunglasses or altering facial features, in a way that looks natural and cohesive with the rest of the image.


A mask in image editing refers to a tool that allows users to define specific areas of an image that should be affected by certain adjustments or effects. It is a selection tool that can be adjusted to target particular regions of the image, and it can be inverted or modified to control the intensity of the effect applied. In the video, the use of a mask is crucial for the inpainting process, as it determines where the image will be altered or where new content will be added.

💡gray values

Gray values, also known as intensity values, are numerical representations of the brightness or darkness of a pixel in a grayscale image. They range from black (low values) to white (high values), with various shades of gray in between. In the context of the video, gray values are used to define the mask for inpainting, where darker values indicate areas of the image that will be more significantly altered or replaced.

💡automatic 1111

Automatic 1111 is mentioned in the script as a software or tool that currently does not support the differential diffusion technique. It suggests that while the technique is powerful, it may not be compatible with all image editing or processing platforms. The reference to automatic 1111 implies that there are limitations to the integration of new methods in existing systems, and users may need to explore alternative software or wait for updates to utilize such features.

💡blood diffusion

Blood diffusion is not explicitly defined in the script, but based on the context, it could be a reference to a specific software or feature that can be used in conjunction with differential diffusion. It suggests that there are different tools and methods available for image processing and inpainting, each with its unique capabilities and compatibility with various techniques.

💡flut diffusion

Flut diffusion appears to be a software or tool mentioned in the script that has been reinstalled and is used with the new update to enable differential diffusion. It indicates that the tool has been updated to include this advanced inpainting technique, allowing users to take advantage of its features for more precise and natural image editing.


In the context of the video, scripts refer to the set of instructions or programs that users can utilize within a software to automate certain tasks or processes. The mention of scripts in the video suggests that users can choose from a variety of pre-written scripts, including differential diffusion, to perform specific image processing tasks.

💡mask strength

Mask strength is a term used to describe the intensity or opacity of the mask applied to an image. A higher mask strength means a more pronounced effect on the image, while a lower strength results in a more subtle change. In the video, adjusting mask strength allows the user to control the degree to which the inpainting process alters the image.


In the context of the video, a model refers to a set of algorithms or data used in image processing and inpainting to generate new content or predict how an image should look. The selection of a model in the software influences the quality and accuracy of the inpainting results, as it determines how well the software understands and replicates the image's structure and content.


COMI, as mentioned in the script, seems to be a software or platform used for image processing and editing. The video discusses using COMI in conjunction with differential diffusion to achieve powerful results in inpainting. It suggests that COMI is a flexible and capable tool that can be enhanced with various techniques, including the differential diffusion method discussed in the video.

💡preview bridge

The preview bridge is a feature from the impact pack mentioned in the video, which is used to display the image and mask during the inpainting process. It allows users to visualize and paint onto the image, providing real-time feedback and enabling precise adjustments to the mask. The preview bridge is an essential tool for fine-tuning the inpainting process and achieving a natural and seamless result.


Differential diffusion is a groundbreaking method in image inpainting, akin to working on steroids.

This technique offers two major benefits: better understanding of the image content and more natural inpainting.

Differential diffusion allows for the use of different gray values to define the extent of inpainting on a pixel-by-pixel level.

The darker the gray value in the mask, the more the image will be replaced, offering precise control.

Though not yet integrated into Automatic 1111, differential diffusion can be utilized within blood diffusion, albeit with some effort.

A fresh install of flut diffusion reveals differential diffusion as one of the choices in the script list with the new update.

Users can enable differential diffusion, invert masks, and set mask strength and model preferences within the software.

Loading a mask is possible, and the software can generate one if the user doesn't provide one, although there might be some issues.

The workflow is more powerful in comi, where users can experience the benefits of differential diffusion firsthand.

A simple classic process is demonstrated, including loading a model, using positive and negative prompts, and generating an image through the K sampler and VAE decode.

The introduction of a preview bridge from the impact pack allows users to paint the mask and further process the image.

The mask can be edited to paint onto the image, specifying areas for replacement or modification.

A Gaussian blur can be applied to the mask to soften its edges and blend it better with the rest of the image.

A comparison demonstrates that differential diffusion better understands and retains the structure of the face, producing more satisfactory results.

The differential diffusion node, placed between the model and the CAS sampler, plays a crucial role in the process despite its simplicity.

Adjustments such as increasing the mask size and tweaking the D noise value and mask blurring can lead to improved inpainting results.

Even with a larger mask and optimized settings, some imperfections persist in the classic inpainting method, unlike the differential diffusion.

The video invites viewers to share their thoughts on this innovative method and appreciates the viewership.