Nodes/Jags_VectorMagic/Jags-XY_tile sampler
ComfyUI Node

Jags-XY_tile sampler

A KSampler that wraps around

By jags111·Created 3 years ago·Updated about a year ago· 89
Jags-XY_tile sampler
  • model
  • positive
  • negative
  • latent_image
  • latent
  • progress_latent
seed0
steps20
cfg8.00
sampler_name
scheduler
denoise1.00
tileX1
tileY1

You want a texture that tiles. A brick wall for Blender, a floor for a game level, fabric that wraps without a visible seam. Over in A1111 you'd tick the "tiling" checkbox and move on. ComfyUI never got that checkbox, and most of the community workarounds you'll find are either ancient or stuck behind a Patreon paywall. This node is the free version of that idea: a drop-in replacement for the normal KSampler that makes whatever it generates seamless.

It's called Jags-XY_tile sampler and it ships in the Jags_VectorMagic pack - the same pack as the circular VAE decoder that's meant to pair with it.

How it works

A generated image fails to tile because of the model's padding. During sampling, every convolution pads its edges with zeros, and those padded boundaries don't line up when the image wraps around. The fix this node uses is blunt and effective: right before sampling, it walks through every Conv2d layer in your UNet and swaps the padding for circular padding - where the image wraps around its own edge instead of padding with zeros. It runs the sampler, then puts the original padding back so your model isn't permanently altered.

That's why tileX and tileY exist. Set both to 1 and everything wraps horizontally and vertically, which is what you want for a fully tileable texture. tileX = 1 alone gives you a strip that tiles side-to-side, tileY = 1 alone tiles top-to-bottom. One small trap: the code checks tileX == 1 as a boolean, so 0 turns it off and the max 2 in the widget is a red herring - anything that isn't 1 behaves like off.

The inputs that matter

Everything else is the standard KSampler family you already know, so if you can drive a KSampler you can drive this:

  • model, positive, negative, latent_image - wire them exactly like a normal sampler.
  • seed, steps, cfg, sampler_name, scheduler, denoise - same dials, same habits.
  • tileX, tileY - the two knobs that make this node worth having (see above).

Outputs are latent and progress_latent, both LATENT. Wire the first latent output into a VAE decode. The second is an auxiliary output the author started on and never finished - the pack's README says outright it's work in progress and "code will break," so don't build anything on progress_latent.

For the cleanest result, feed that latent into CircularVAEDecode (same pack) rather than a stock VAE decoder. The sampler makes the latent seamless, but a normal VAE decode can reintroduce edge artifacts at the decode stage - the circular decoder fixes that last seam.

Installing it

ComfyUI Manager, search Jags_VectorMagic, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/jags111/ComfyUI_Jags_VectorMagic

Then restart ComfyUI. The pack's requirements.txt pulls in a lot - ultralytics, librosa, clip-interrogator, opencv-python, scipy - most of which you don't need for this one node, but Manager installs the whole list anyway. It's a 2023-era pack (last touched April 2025) and the README's advice to keep ComfyUI base updated is worth taking literally; if the node ever errors after an update, that's usually the cause.

Gotchas

  • The padding hijack expects a classic UNet. SD 1.5 and SDXL work. If you're sampling a model whose architecture doesn't expose plain Conv2d layers the same way, it may just not do anything - test with a quick low-step run before committing to a big render.
  • Tiling is baked into the latent, not the prompt. Set tileX/tileY correctly and keep your prompt to motifs that actually repeat; a prompt with a centered subject will tile technically but look silly.
  • It's a one-shot trick, not a denoise ladder. Unlike Tiled Diffusion-style upscalers, this only makes the sampled latent seamless. Don't expect it to repair seams in an image you're refining at high denoise.

For the niche - tileable textures, patterns, anything that needs to wrap - this is the rare free option that actually works. Just respect the WIP warning and test before you render at scale.

CategoryJags_vector/xy_tile_sampler

Inputs (12)

NameTypeDefaultDescription
modelMODEL
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.000–100
sampler_nameCOMBO34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28
schedulerCOMBO9 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +3
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
denoiseFLOAT1.000–1
tileXINT10–2
tileYINT10–2

Outputs (2)

NameTypeDescription
latentLATENT
progress_latentLATENT