Preface:
Learning ComfyUI is a long battle, and ComfyUI Impact is a huge module node library, built-in many very useful and powerful nodes, such as Detector, Detail Enhancer, Preview Bridge, Wildcard, Hook, Picture Sender, Picture Receiver and so on. Through the combination of these nodes, we can achieve a lot of work, such as automatic face detection and optimization repair, area enhancement, local repainting, crowd control, hairstyling, changing the model's clothes and so on. ComfyUI Impact is a big river that everyone can't bypass on the way of ComfyUI advancement, so this post will lead you to understand and learn to use these nodes. I wish you all good luck in your studies and become a master of ComfyUI soon!
catalogs
I. Installation
II. NoiselnjectionDetailerHookProvider node
surname San、DenoiseSchedulerDetailerHookProvidernodal
IV. UnsamplerDetailerHookProvider node
V. Switch (Any) / Inversed Switch (Any) nodes
VI. DetailerHookCombine nodes
VII. MaskDetailer (pipe) node
VIII. Sample workflow
I. Installation
Method 1: Installation via ComfyUI Manager (recommended)
Open the Manager interface
Method 2: Install using the git clone command
Enter cmd in the ComfyUI/custom_nodes directory and press Enter to enter the computer terminal.
Enter the following line of code in the terminal to start the download
git clone /ltdrdata/ComfyUI-Impact-Pack
II. NoiselnjectionDetailerHookProvider node
This node focuses on injecting noise during image processing to help improve detailing results. This approach can improve the quality and realism of an image in some cases, especially in applications that process low-quality images or require enhanced detail.
Parameters:
schedule_for_cycle → control the timing of the start of the injection, from_start means to start injecting noise from the first cycle, skip_start means to skip the noise injection of the first cycle
source → source of noise, optionally GPU and CPU
seed → seed random numbers to generate noise
control_after_generate → control how the random number seed is changed
start_strength → initial noise injection amount
end_strength → end_noise_injection
Note: As the noise injection proceeds, the intensity of the noise gradually increases or decreases from start_strength to end_strength. this allows for a smooth transition of noise intensity over time or steps.
Output:
DETAILER_HOOK → Sample data after noise injection processing
Note: ComfyUI_Noise is required to be installed when the NoiselnjectionDetailerHookProvider node is used, because the node uses BNK_InjectionBoise internally. when prompted with a screen similar to the one below (which may be different depending on your browser), click OK to automatically install and restart ComfyUI can be.
Example:
caveat
- Noise type and intensity: Select the appropriate noise type and intensity according to the specific needs to avoid excessive injection of noise resulting in image quality degradation.
- Processing performance: Noise injection and refinement processing may require high computational resources, ensuring that system performance is sufficient to support processing requirements.
- Image Quality: Monitor the quality of the processed image to ensure that the detail enhancement from noise injection is as expected.
By using the NoiselnjectionDetailerHookProvider node, it is possible to achieve effective noise injection and refinement in the image processing workflow, improving the detail performance and overall quality of the image.
surname San、DenoiseSchedulerDetailerHookProvidernodal
This node focuses on scheduling noise removal operations during image processing to help improve the detailing of images. This approach effectively reduces the noise in an image while preserving and enhancing the details of the image.
Parameters:
schedule_for_cycle → control the timing of the start of injection
target_denoise → target denoise value, i.e., the denoise value that the model is expected to reach gradually during the diffusion process
Output:
DETAILER_HOOK → processed sample data
Note: The node will not work when the number of loops is equal to 1!
Example:
caveat
- Denoising strength and strategy: choose appropriate denoising strength and scheduling strategy according to specific needs to avoid excessive denoising resulting in loss of details.
- Processing performance: Denoising and refinement processing may require high computational resources, ensuring that system performance is sufficient to support processing requirements.
- Image quality monitoring: Monitor the quality of the processed image to ensure that the detail enhancement brought about by denoising meets expectations.
By using the DenoiseSchedulerDetailerHookProvider node, it is possible to achieve effective noise removal and refinement in image processing workflows, improving the detailed performance and overall quality of images.
IV. UnsamplerDetailerHookProvider node
This node focuses on performing backsampling operations during image processing to recover image details and optimize the processing. This approach enhances image quality in applications such as image enlargement, super resolution, and deblurring.
Input:
model → input large model
positive → positive cue word
negative → reverse cue word
Note: The forward and reverse cue word here is to enter the element that needs to be removed, for example, if I want to highlight the element "clean", then I should enter the cue word "dirty" in the forward cue word, and the reverse cue word is similar in principle.
Parameters:
steps → total number of steps
start_end_at_step → the number of steps to start i.e. the number of steps from the total number of steps to start the sample reduction
end_end_at_step → number of steps to end i.e. from the first step of the total number of steps to end using restore
cfg → cue-word guidance coefficients, i.e., the magnitude of the effect that the cue word has on the resultExcessive levels can have a negative impact
sampler_name → select sampler (recommended to use the node's default sampler)
scheduler → Select scheduler
normalize → whether to normalize or not schedule_for_cycle → control the start time of the sample restore operation
Output:
DETAILER_HOOK → processed sample data
Example:
caveat
- Backsampling multiplier: Select the appropriate backsampling multiplier according to specific needs to get the best detail recovery effect.
- Refinement Intensity: Adjusts the intensity of the refinement process to avoid image artifacts or distortion caused by excessive refinement.
- Processing performance: Backsampling and refinement processing may require high computational resources, ensuring that system performance is sufficient to support processing requirements.
- Image quality monitoring: Monitor the quality of the processed images to ensure that the results from the backsampling and refinement process are as expected.
By using the UnsamplerDetailerHookProvider node, users can achieve effective backsampling and refinement in the image processing workflow to improve the detail performance and overall quality of the image.
V. Switch (Any) / Inversed Switch (Any) nodes
These two nodes are used to control the routing of data flow in a workflow. They allow users to dynamically switch data paths based on conditions, and are suitable for scenarios that require flexible control of data flow.
Input:
input1 → Input data
Note: This two node can convert any type of data, the data type is determined by connecting the first line of the input.
Parameters:
select → selectable input parameterMinimum value is 1, maximum value is 999999
sel_mode → the moment when the select parameter is determined, select_on_prompt means it is determined when the queue is prompted, select_on_execution means it is determined when the workflow is executed
Note: When using select_on_prompt, select can only be used with the widget or raw node identified in the queue prompt.
Output:
selected_value → input parameter value based on the selected input parameter
selected_label → label based on selected input parametersIf a label is not found, the parameter name is used as the label
selected_index → the index of the selection, i.e. the value of the passed-in select parameter
output1 → Outputs the converted value according to the selected input parameter.
Example:
caveat
- Conditional Configuration: Ensure that conditions are configured correctly so that Switch (Any) and Inversed Switch (Any) nodes are able to select and assign data paths based on expected logic.
- Data consistency: Ensure that input and output data are formatted consistently so that nodes can process and transfer data correctly.
- Processing performance: Adjust the configuration of processing nodes according to specific needs to ensure that the system performance is sufficient to support dynamic data selection and distribution needs.
By using Switch (Any) and Inversed Switch (Any) nodes, you can realize flexible and dynamic data flow control in image processing workflows, enhancing workflow flexibility and efficiency.
VI. DetailerHookCombine nodes
This node focuses on merging results from multiple refinement processing nodes. By merging the results of different refinement processes, it is possible to integrate multiple refinement effects in a single node and improve the overall quality of the image.
Input:
hook1 → first Detailer_Hook data to be integrated
hook2 → second Detailer_Hook data to be integrated
Output:
DETAILER_HOOK → integrated Detailer_Hook data
Note: The integration here is to combine the functionality implemented in each of these two Detailer_Hook data together, not to generate a Detailer_Hook data with new functionality.
caveat
- Input data quality: Ensure that the input refinements are of good quality for optimal consolidation.
- Merge parameter configuration: Configure merge parameters according to specific needs to achieve the best integrated refinement.
- Processing performance: Combining the results of multiple refinements may require high computational resources, ensuring that system performance is sufficient to support processing requirements.
By using the DetailerHookCombine node, you can achieve effective integration of multiple refinement results in your image processing workflow, improving the overall quality and detail of your images.
VII. MaskDetailer (pipe) node
This node focuses on refining parts of the image based on masks. By using masks, specific regions of the image can be precisely selected for optimization without affecting other parts.
Input:
image → input image
mask → mask area
basic_pipe → basic pipe with info on model, clip, vae, positive, negative, etc.
refiner_basic_pipe_opt → basic pipe for refiner model, contains information about refiner's model, clip, vae, positive, negative, etc.
detailer_hook → detailing parameter
Parameters:
guide_size → reference sizeTarget images smaller than are zoomed in to match, while images larger than will be skipped because they don't require detail processing
guide_size_for → set what guide_size is based onWhen set to bbox, it uses the bounding box of the bbox detected by the detector as a reference; when set to crop_region, it uses the cropping region recognized based on the detected bbox as a reference
max_size → maximum sizeLimits the longest edge of the target image to a safety measure less than max_size, which solves the problem that the bbox can become too large, especially if it has a slender shape
mask_mode → the way masks are applied in refinement processing
seed → seed with built-in KSampler
control_after_generate → mask mode, used to indicate whether only the inside of the mask or the entire image is to be processed during detail enhancement.
steps → the number of denoising steps (which can also be interpreted as the number of steps to generate the image)
cfg → cue-word guidance coefficients, i.e., the magnitude of the effect that the cue word has on the resultExcessive levels can have a negative impact
sampler_name → select sampler
scheduler → Select scheduler
denoise → denoise amplitudeThe larger the value, the greater the impact and change it produces in the picture
feather → feather size
crop_factor → crop_factor, used to crop the image
drop_size → drop_size, used to control the size of the image drop size during the detail enhancement process
refiner_ratio → When using SDXL, sets the percentage of the total process that the function to be refiner modeled is a part of.
batch_size → set the number of latent spaces
cycle → number of iterations for sampling **When used with Detailer_hook, this option allows for the addition of intermittent noise, and can also be used to gradually reduce the denoising size, initially building the basic structure and then refining it.
inpaint_model → patch model, control whether to enable the image paint model.
noise_mask_feather → noise_mask_feather, used to control the degree of feathering of the noise mask
Note: noise_mask_feather does not guarantee a more natural image, while it may create artifacts at the edges, people set it as needed!
Output:
image → redrawn image
cropped_refined → cropped image after using the refiner model
ropped_enhanced_alpha → Alpha channel of the redrawn image after the cropping process
basic_pipe → basic pipe with info on model, clip, vae, positive, negative, etc.Facilitates node connectivity when multiple MaskDetailer (pipe) nodes are used consecutively.
refiner_basic_pipe_opt → basic pipe for refiner model, contains information about refiner's model, clip, vae, positive, negative, etc.Facilitates node connectivity when multiple MaskDetailer (pipe) nodes are used consecutively.
caveat
- Mask Quality: Ensure that the input mask data is accurate for optimal refinement processing.
- Configuration of refinement parameters: Configure the parameters of refinement processing according to specific needs to achieve the best image optimization results.
- Processing performance: Refinement processing may require high computational resources, ensuring that system performance is sufficient to support processing requirements.
- Input data format: ensure that the data format of the image and mask is consistent so that the MaskDetailer (pipe) node can process and pass the data correctly.
By using the MaskDetailer (pipe) node, you can achieve effective refinement of specific areas in your image processing workflow, improving the overall quality and detail of your images.
VIII. Sample workflows
With the above nodes, you can build a simple "face repair" workflow.
This workflow encompasses all of the nodes studied in this article, and studying this workflow through will provide a deeper understanding of the nodes studied above. This workflow implements a detail enhancement of the Iron Man chest armor. The main idea is to load the picture, and in the picture painted on the chest armor mask, the picture and the mask together into the MaskDetailer (pipe) node for chest armor repainting, while adding a series of control noise Detailer Hook node for repainting the noise of the fine control, to achieve a better picture results. The first one is the loaded original image, the second one is the image with only MaskDetailer (pipe) node, and the third one is the image with noise-controlling Detailer Hook node. We can see that the quality of the image is increasing from left to right, so when we do the local repair, we can improve the quality of the image by adding the noise-controlling Detailer Hook node. So in our local repair, adding the Detailer Hook node to control the noise can enhance the quality of the output image. The original images of the above three images are as follows (from left to right):
We can surpass ourselves only if we are diligent in our endeavors. Perseverance is the key to success.