ComfyUI Node

SeamlessVae

The smallest node in the pack, for when your VAE is the one breaking the seam

By moyi7712·Created 2 years ago·Updated about a year ago· 20
SeamlessVae
  • vae
  • vae

SeamlessVae is the quiet one in the moyi7712/ComfyUI_Seamless_Patten pack: one input, one output, no settings. It does for the VAE exactly what SeamlessApply does for both halves - flips every Conv2d layer's padding to circular, so the VAE encodes and decodes as if the image were wrapped around a torus. Left edge meets right edge, top meets bottom, and the decode doesn't introduce a visible seam it wasn't already given.

When you'd actually use it

Honestly, on its own it's a niche node. Most people generating tileable textures reach for SeamlessApply, which patches the UNet and the VAE together in one go. You want SeamlessVae when the diffusion half of your pipeline is already handled elsewhere - say you're running a custom sampler that does its own seamless patching, or you're decoding a latent that was made seamless some other way, and the last thing standing between you and a clean tile is a VAE that's happily re-zero-padding its way across the edge. Feed it the VAE, and encode/decode stops breaking the wrap.

It also doubles as a debugging tool: if your tiles are seamless but the decoded image still has a faint seam at the very edges, the VAE is a suspect. Drop this node in front of the decoder and see if it disappears.

How it works

The node clones your VAE's patcher and walks its layers, registering two hooks on each Conv2d: a pre-hook that sets padding_mode = 'circular' before the forward pass, and a post-hook that snaps padding back to 'zeros' and removes both hooks. One-shot. The very next encode or decode runs wrapped, then the VAE is back to normal. In a normal graph this is invisible to you - nodes re-execute on every queue run, so the patched VAE is fresh each time - but it's worth knowing the effect isn't sticky.

Inputs, outputs, wiring

  • vae (VAE) - in.
  • vae (VAE) - out, the patched clone.

That's it. Load VAE → SeamlessVae → VAEDecode. If you want the generation side wrapped too, that's what SeamlessApply is for - this node only touches the VAE and won't make the denoise itself tile.

Install

Same as the rest of the pack - no dependencies, no models:

# ComfyUI Manager: search "Seamless" → Install → Restart
cd ComfyUI/custom_nodes
git clone https://github.com/moyi7712/ComfyUI_Seamless_Patten
# restart ComfyUI

There's no requirements.txt and nothing to download.

Gotchas

  • Because the hook is one-shot, reusing the same SeamlessVae output for two separate decodes in one graph relies on the node re-executing per run - which it does, but if you cache nodes or bypass it mid-run, expect the second decode to use the stock VAE.
  • Circular VAE padding can very slightly shift color or reconstruction quality at the borders on some models. If your tile looks perfect but the edges feel "different," this is the knob - test with the node bypassed.
  • This is a VAE-only patch. It never made a non-seamless latent seamless - it just stops the VAE from adding a seam. Keep expectations calibrated.
CategorySeamless

Inputs (1)

NameTypeDefaultDescription
vaeVAE

Outputs (1)

NameTypeDescription
vaeVAE