Nodes/comfyui_quilting/Latent Quilting
ComfyUI Node

Latent Quilting

Quilt in latent space — the same texture trick, 8× cheaper

By bmad4ever·Created 2 years ago·Updated about a year ago· 10
Latent Quilting
  • src
  • LATENT
scale4.0
block_size20
overlap0.17
tolerance0.10
parallelization_lvl1
seed0

This is the base Image Quilting node, but it runs on latents instead of pixels. Feed it a LATENT and a scale factor, and it quilts a bigger latent out of it - then you VAE-decode and get a larger image of the same texture. Why bother, when the image version exists? Three reasons.

First, cost. Latents sit at 1/8 the linear resolution of pixels. Quilting is a search-heavy CPU algorithm, and searching over an 8×-smaller space is dramatically faster. Second, it speaks the model's language. When you quilt pixels and then run the result through a VAE encoder, you're fighting the VAE's compression; quilt in latent space and you're extending the exact representation the sampler produced. Third, it composes with seamless sampling - the pack's example workflow makes a texture seamless in latent space, then samples it with seamless padding so the final output has no wrap seam. If you're producing tileable textures at any kind of volume, that's the whole game.

The one thing to remember: block size is in latent pixels

The README is explicit: block size is given in pixels for images; for latents, use the number of pixels divided by 8. So an effective ~144-pixel block is 18 on this node (the default). And unlike the image nodes, there's no auto block-size range here - latents can't run the guess heuristic (that node takes an IMAGE), so you're choosing block_size yourself. The default 18 is a reasonable starting point.

Inputs and output

src (a LATENT), scale (default 4, range 2–32 - the output latent is scale× in each dimension), block_size, overlap, tolerance, parallelization_lvl, and seed. Output is a single LATENT, which you'll typically wire into a VAE Decode and then a save node.

A workflow that clicks

Sample a small texture normally → LatentQuilting with scale 4 → VAE Decode. You've turned a 512×512 texture into a 2048×2048 sheet of the same stuff, with the repeat structure diffusion actually believes in. It's not a substitute for an upscaler - you're not adding detail, you're extending the texture pattern itself, which is exactly what bilinear upscaling can't do.

Installing & gotchas

ComfyUI Manager → search comfyui_quilting, or clone + pip install -e (the bmquilting core dependency installs itself from git). No models to download. The usual quilting caveats apply - tolerance too low copies the source verbatim, parallelization_lvl above 1 changes the output - plus one latent-specific one: batch and parallelization multiply processes, so don't stack a big batch on parallelization_lvl 2+ and expect your CPU to thank you.

CategoryBmad/CV/Misc

Inputs (7)

NameTypeDefaultDescription
srcLATENT
scaleFLOAT4.02–32
block_sizeINT203–256
overlapFLOAT0.170.1–0.9
toleranceFLOAT0.100.01–2
parallelization_lvlINT10–6
seedINT00–18446744073709550000

Outputs (1)

NameTypeDescription
LATENTLATENT