ComfyUI

How to Do Soft Inpainting in ComfyUI

Better inpainting results with differential diffusion

Shawn @ Prompting Pixels

What You'll Learn

Learn how to implement soft inpainting (differential diffusion) in ComfyUI for seamless, natural-looking image edits that blend changes smoothly without harsh boundaries.

Video Walkthrough

Prefer watching to reading? Follow along with a step-by-step video guide.

How to Do Soft Inpainting in ComfyUI

Differential diffusion, also known as soft inpainting, is a much-improved way to approach image editing. This technique offers a significant improvement over traditional inpainting methods by applying changes on a per-pixel basis, resulting in seamless and natural-looking edits.

In addition to making for better final results and fewer retries to get the image to look "right," soft inpainting works well with standard generational checkpoints – while still being compatible with inpainting checkpoints.

Getting this to work in ComfyUI is straightforward:

  1. Load your image and create a mask using the Mask Editor.
  2. Add these nodes:
    • Gaussian Blur Mask
    • Inpaint Model Conditioning
    • Differential Diffusion
  3. Connect the nodes:
    • Pass the mask through the Gaussian Blur Mask
    • Route your model through Differential Diffusion
    • Feed prompts, mask, and other parameters into Inpaint Model Conditioning
  4. Adjust the Gaussian Blur Mask settings:
    • Kernel size: Controls the brush size
    • Sigma: Determines the softness of the gradient
  5. Fine-tune your KSampler:
    • Experiment with denoise values between 0.6 and 0.8 for optimal results. A denoise value of 1 will provide the most creative results.

Pro Tip: Be mindful of the mask's softness; excessive blurring may affect surrounding areas unintentionally.

Differential diffusion opens up new possibilities for subtle yet powerful image manipulations. Whether you're adding objects, changing features, or blending elements, this technique provides a level of control and naturalism previously unattainable with standard inpainting methods.

Experiment with different mask shapes, blur intensities, and prompts for more creative results.

Want More AI Image Tutorials?

Get the best AI image tutorials and tool reviews—no spam, just 1 or 2 helpful emails a month.

Continue Learning

More ComfyUI Tutorials

Explore additional tutorials in the ComfyUI category.

View All Tutorials
ComfyUI Workflows

Ready-to-use workflow files