ComfyUI  >  Nodes  >  ComfyUI Impact Pack >  TwoAdvancedSamplersForMask

ComfyUI Node: TwoAdvancedSamplersForMask

Class Name

TwoAdvancedSamplersForMask

Category
ImpactPack/Sampler
Author
Dr.Lt.Data (Account age: 458 days)
Extension
ComfyUI Impact Pack
Latest Updated
6/19/2024
Github Stars
1.4K

How to Install ComfyUI Impact Pack

Install this extension via the ComfyUI Manager by searching for  ComfyUI Impact Pack
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Impact Pack in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Cloud for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

TwoAdvancedSamplersForMask Description

Enhances sampling with two advanced samplers and a mask for refined image processing.

TwoAdvancedSamplersForMask:

The TwoAdvancedSamplersForMask node is designed to enhance the sampling process by utilizing two advanced samplers in conjunction with a mask. This node allows for more refined and controlled sampling, particularly useful in scenarios where different regions of the latent image require distinct sampling strategies. By leveraging a base sampler and a mask sampler, this node ensures that the masked and unmasked areas of the image are processed differently, leading to more precise and high-quality results. The node's primary function is to apply these samplers iteratively, taking into account the mask's influence, to produce a final latent image that meets the desired artistic or technical specifications.

TwoAdvancedSamplersForMask Input Parameters:

seed

The seed parameter is an integer that initializes the random number generator used in the sampling process. This ensures reproducibility of results. The default value is 0, with a minimum of 0 and a maximum of 0xffffffffffffffff. Changing the seed will result in different sampling outcomes, providing variability in the generated images.

steps

The steps parameter defines the number of sampling steps to be performed. It is an integer with a default value of 20, a minimum of 1, and a maximum of 10000. More steps generally lead to higher quality results but will increase computation time.

denoise

The denoise parameter is a float that controls the denoising strength during the sampling process. It ranges from 0.0 to 1.0, with a default value of 1.0 and a step size of 0.01. Lower values will retain more noise, while higher values will produce cleaner images.

samples

The samples parameter represents the latent image data that will be processed by the samplers. It is of type LATENT and serves as the input image on which the sampling operations will be performed.

base_sampler

The base_sampler parameter is of type KSAMPLER_ADVANCED and is used to sample the unmasked regions of the latent image. This sampler applies the primary sampling strategy to the areas not affected by the mask.

mask_sampler

The mask_sampler parameter is also of type KSAMPLER_ADVANCED and is used to sample the masked regions of the latent image. This allows for a different sampling strategy to be applied to the areas defined by the mask.

mask

The mask parameter is of type MASK and defines the regions of the latent image that will be processed by the mask_sampler. The mask is a binary image where the masked areas are typically represented by 1s and the unmasked areas by 0s.

overlap_factor

The overlap_factor parameter is an integer that determines the extent to which the mask is eroded or expanded during the sampling process. It has a default value of 10, with a minimum of 0 and a maximum of 10000. Adjusting this factor can influence the blending of the masked and unmasked regions.

TwoAdvancedSamplersForMask Output Parameters:

LATENT

The output parameter LATENT represents the final latent image after the sampling process has been completed. This image has been processed by both the base and mask samplers, taking into account the mask's influence, and is ready for further use or final rendering.

TwoAdvancedSamplersForMask Usage Tips:

  • To achieve more detailed and high-quality results, increase the steps parameter, but be mindful of the increased computation time.
  • Experiment with different seed values to generate a variety of sampling outcomes and find the one that best suits your artistic vision.
  • Adjust the denoise parameter to balance between retaining some noise for texture and achieving a cleaner image.
  • Use the overlap_factor to fine-tune the transition between masked and unmasked regions, ensuring a smooth blend.

TwoAdvancedSamplersForMask Common Errors and Solutions:

"Invalid mask dimensions"

  • Explanation: The dimensions of the mask do not match the dimensions of the latent image.
  • Solution: Ensure that the mask has the same width and height as the latent image before inputting it into the node.

"Sampler type mismatch"

  • Explanation: The provided samplers are not of type KSAMPLER_ADVANCED.
  • Solution: Verify that both the base_sampler and mask_sampler are of the correct type and compatible with the node.

"Denoise value out of range"

  • Explanation: The denoise parameter is set outside the allowed range of 0.0 to 1.0.
  • Solution: Adjust the denoise value to be within the specified range to avoid this error.

TwoAdvancedSamplersForMask Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Impact Pack
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.