Nodes/comfyui_quilting/Guess Quilting Block Size
ComfyUI Node

Guess Quilting Block Size

Let the texture pick its own quilting block size

By bmad4ever·Created 2 years ago·Updated about a year ago· 10
Guess Quilting Block Size
  • src
  • INT
simple_and_fastfalse

block_size is the knob that decides whether Image Quilting comes out seamless or a mess of visible repeats, and nobody enjoys hunting for it by trial and error. This node does the hunting for you: feed it an image, it analyzes the texture's structure, and it returns an INT you can wire straight into a quilting node's block_size input.

How the guess works

The heuristic is laid out in the pack's README, and it's a two-part affair. First it runs a frequency-spectrum analysis of the texture to find the dominant repeating scales - essentially "how far apart do the important pattern elements sit?" That's the fast part and usually enough on its own. If you turn off simple_and_fast, it also runs a slower SIFT descriptor analysis (aimed at small textures) that clusters features and estimates their typical size and spacing. Both analyses produce candidate block sizes weighted by how well they line up with the texture's structure, and the node returns the largest decent candidate.

For medium and large textures, the author's advice is blunt: just leave simple_and_fast on. The SIFT pass costs time and rarely improves a big texture.

Inputs and output

Just two inputs: src (an IMAGE) and simple_and_fast (default false). Output is a single INT - wire it into block_size on ImageQuilting_Bmad or either of the seamless image nodes and you're set.

Three caveats worth knowing

  • It only inspects the first image of a batch. If your batch holds different textures and you want per-image sizing, that's the job of the auto block_size range (-1/0) on the image quilting nodes, which guesses a separate size per image.
  • The guess isn't cached. It's recomputed every run. This node is deterministic and repeatable if you want a stable number to bake in, but if you're iterating on a workflow, expect a few extra seconds per execution.
  • Latent quilting nodes can't use it. They take a LATENT, not an IMAGE, and they don't offer auto block sizing at all. For latents you're on your own - and remember their block_size is in latent pixels, i.e. real pixels divided by 8.

Installing

Same as the rest of the pack - ComfyUI Manager, search comfyui_quilting, or:

cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_quilting
python -m pip install -e /path/to/ComfyUI/custom_nodes/comfyui_quilting

Restart and you're done. No extra models, no dependencies beyond what the pack already pulls in.

CategoryBmad/CV/Quilting

Inputs (2)

NameTypeDefaultDescription
srcIMAGE
simple_and_fastBOOLEANfalse

Outputs (1)

NameTypeDescription
INTINT