Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI_SamplingUtils > Image Iterative Stretch Fill

ComfyUI Node: Image Iterative Stretch Fill

Class Name

ImageIterativeStretchFill

Category
advanced/image
Author
silveroxides (Account age: 2211days)
Extension
ComfyUI_SamplingUtils
Latest Updated
2026-06-03
Github Stars
0.02K

How to Install ComfyUI_SamplingUtils

Install this extension via the ComfyUI Manager by searching for ComfyUI_SamplingUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_SamplingUtils 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 Online for ready-to-use ComfyUI environment

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

Run ComfyUI Online

Image Iterative Stretch Fill Description

Intelligently fills image gaps with iterative stretching for seamless blending and natural results.

Image Iterative Stretch Fill:

The Image Iterative Stretch Fill node is designed to intelligently fill masked areas of an image by iteratively stretching surrounding pixels into the masked region. This technique is particularly useful for seamlessly filling large gaps or holes in images where traditional inpainting methods might struggle. By stretching pixels from the edges of the masked area, this node ensures that the fill blends naturally with the existing image content, maintaining the overall aesthetic and continuity. The iterative approach allows for gradual refinement of the fill, enhancing the quality and realism of the result. This node is ideal for artists looking to repair or modify images without leaving noticeable artifacts or seams.

Image Iterative Stretch Fill Input Parameters:

image

This parameter accepts the input image that you want to process. The image should be in a format compatible with the node's processing capabilities, typically a tensor format. The image serves as the base on which the iterative stretch fill operation will be performed.

mask

The mask parameter defines the areas of the image that need to be filled. It is a binary mask where the regions marked for filling are indicated. The mask guides the node to identify which parts of the image require the stretch fill operation.

stretch_axis

This parameter determines the direction in which the stretching will occur. It can be set to auto, horizontal, or vertical. The auto option automatically selects the narrowest dimension of the mask for stretching, while the other options allow you to manually specify the direction. This choice affects how the fill operation is applied and can influence the final appearance of the filled area.

sample_thickness

This parameter specifies the number of pixels to sample from the unmasked edges of the image for stretching. The default value is 32, with a range from 1 to 512. A higher value means more pixels are used for the stretch, which can result in a more seamless fill but may also increase processing time.

edge_blend_blur

This parameter controls the amount of Gaussian blur applied to the mask boundary to soften the transition between the filled area and the original image. The default value is 9, with a range from 0 to 101. A higher value results in a smoother blend, reducing visible seams.

iterations

This parameter defines how many times the stretch and fill process is repeated. The default is 5, with a range from 1 to 50. More iterations can lead to a more refined fill, but may also increase processing time.

mask_decay_pixels

This parameter determines how many pixels of the mask are eroded after each iteration. This helps in gradually reducing the mask size, allowing for a more controlled and progressive fill. The value should be set based on the desired level of mask reduction per iteration.

Image Iterative Stretch Fill Output Parameters:

image

The output image is the result of the iterative stretch fill process. It is the original image with the masked areas filled using the surrounding pixel data. The output maintains the original image's aesthetic while seamlessly integrating the filled regions, providing a visually coherent result.

Image Iterative Stretch Fill Usage Tips:

  • For large holes, increase the sample_thickness to ensure enough surrounding pixels are used for a seamless fill.
  • Use edge_blend_blur to soften transitions and avoid visible seams, especially when working with complex textures.
  • Experiment with the iterations parameter to find the right balance between processing time and fill quality.

Image Iterative Stretch Fill Common Errors and Solutions:

Mask and Image Dimension Mismatch

  • Explanation: The dimensions of the mask do not match the dimensions of the image.
  • Solution: Ensure that the mask and image have the same dimensions before processing.

Invalid Stretch Axis

  • Explanation: An invalid value is provided for the stretch_axis parameter.
  • Solution: Use only the allowed options: auto, horizontal, or vertical.

Excessive Iterations

  • Explanation: Setting too many iterations can lead to excessive processing time without significant quality improvement.
  • Solution: Start with a lower number of iterations and gradually increase to find the optimal setting for your specific image.

Image Iterative Stretch Fill Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_SamplingUtils
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Image Iterative Stretch Fill