Nodes/Content Aware Tiles/KSampler (Rolling)
ComfyUI Node

KSampler (Rolling)

Make self-tiles seamless by rolling the noise

By samsartor·Created 2 years ago·Updated about a year ago· 23
KSampler (Rolling)
  • model
  • positive
  • negative
  • latent_image
  • LATENT
seed0
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
double_outputtrue

The classic way to make a tileable image is to flip on circular padding so the model's convolutions wrap around the edges - the "Tiling" checkbox that's been around since A1111. It works, but it's a blunt instrument: every tile looks like a crop of the same repeating field. RollingKSampler is the smarter alternative from this pack. It's a drop-in replacement for ComfyUI's KSampler that rolls the latent around before every denoising step and rolls it back after, so the output is tileable at the sampling level rather than the convolution level. Different result, same seamless guarantee - and for self-tiling textures, usually a better one.

What it does

Subclassing the stock KSampler, it wraps the UNet's apply function: before each step it circularly shifts the latent (and any conditioning tensors the same size) by a random offset, runs the denoise, then shifts back. Because the noise field never lines up with the image boundaries, the model can't "cheat" by memorizing a seam - it has to actually generate features that continue across the wrap. That's the mechanism behind the pack's rolled_self tiles, and it's why this sampler pairs naturally with the boundary-inpainting nodes: sample your self-tiles through it and the edges come out far cleaner.

It also has double_output (default true), which takes the result and tiles it 2×2 in the latent - so you immediately see the repeating field in the preview. That's a preview convenience, not the final product: keep it on while iterating, turn it off for the real export.

Inputs and outputs

Identical to stock KSampler - model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise - plus double_output (BOOLEAN, default true). One output: LATENT.

Installing and the fine print

Standard pack install: git clone https://github.com/samsartor/content_aware_tiles into ComfyUI/custom_nodes (or ComfyUI Manager → "content_aware_tiles") and restart. No model downloads.

The cost to watch is double_output: tiling the latent 2×2 quadruples the area you're decoding, and that's a real VRAM spike on big tiles. If you're OOMing, turn it off and preview a single tile or use SubBatchVAE on the decode. Also note the rolling introduces a random offset per run (seeded off the sampler's seed), so you get run-to-run variation even at the same seed - expected, not a bug. For Wang/Dual sets the boundary nodes already guarantee edge matching, so rolling matters most for the self kind. This is a research pack with effectively no forum presence - the source is short and readable, and the included workflow shows it wired with SubBatchModel and SubBatchVAE for the full memory-friendly path.

Categorytiles

Inputs (11)

NameTypeDefaultDescription
modelMODELThe model used for denoising the input latent.
seedINT00–18446744073709550000The random seed used for creating the noise.
stepsINT201–10000The number of steps used in the denoising process.
cfgFLOAT8.00–100The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality.
sampler_nameCOMBOThe algorithm used when sampling, this can affect the quality, speed, and style of the generated output.
schedulerCOMBOThe scheduler controls how noise is gradually removed to form the image.
positiveCONDITIONINGThe conditioning describing the attributes you want to include in the image.
negativeCONDITIONINGThe conditioning describing the attributes you want to exclude from the image.
latent_imageLATENTThe latent image to denoise.
denoiseFLOAT1.000–1The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling.
double_outputBOOLEANtrue

Outputs (1)

NameTypeDescription
LATENTLATENTThe denoised latent.