Nodes/MKRShift_Nodes/Texture Offset
ComfyUI Node

Texture Offset

The honest way to spot a texture seam — shift it and look

By criskb·Created 7 months ago·Updated 5 months ago· 0
Texture Offset
  • image
  • image
  • mask
  • offset_info
settings_json{"mode":"half_tile","offset_x":0.5,"offset_y":0.5,"seam_width":6.0,"seam_softness":3.0}

The classic texture trick that nobody tells you: to see whether an image actually tiles, roll it by half a tile and look at the new seam. Texture Offset is that trick as a node. It shifts an image by a chosen offset, and by default it does the half-tile roll that maximizes the visibility of any seam - because whatever was at the center before is now at the edges, where a mismatch shows up instantly. It also gives you a seam mask marking exactly where the wrap happened, which pairs with the pack's Seamless node if you need to actually fix what you find.

How it works

The core operation is a plain image roll - pixels wrap around, top-to-bottom and left-to-right, nothing is cropped or resized. The mode chooses how the offset is interpreted: half_tile rolls by exactly half the image in each direction (the diagnostic default), fraction interprets offset_x/offset_y as fractions of the image, and pixels treats them as literal pixel counts. In parallel it computes a cross_seam_mask - a feathered band along the seam lines - driven by seam_width and seam_softness. The mask is the output you can feed straight into a blending or seaming node.

It's batch-safe, works on RGBA (alpha rolls too), and it's deterministic numpy with no model. A millisecond operation, which is the whole point: this is the cheap diagnostic you run before you commit to a texture.

The inputs that matter

Inputs are an image plus one settings_json text box. The knobs:

  • mode - half_tile / fraction / pixels
  • offset_x / offset_y - the shift (0.5/0.5 default = half tile)
  • seam_width / seam_softness - how fat and soft the seam mask is

Outputs: image (the rolled result), mask (the seam mask - bright where the wrap is), and offset_info logging the resolved pixel shift.

Installing it

Ships in MKRShift Nodes from criskb. ComfyUI Manager → "MKRShift Nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart ComfyUI; it's under MKRShift Nodes → Surface → Texture. No models or extra deps - numpy/Pillow/torch.

Common gotchas

The pack is new with no community lore, so trust the source. Standard MKRShift traps apply: broken JSON silently falls back to defaults, out-of-range values clamp. One thing worth knowing from how the mode logic works: in fraction and pixels modes, the offset is resolved against the image size at run time, so the same JSON gives different pixel shifts on different resolutions - that's expected. And there's a subtlety people miss: the rolled image's old edges are now inside the frame, so if you see a soft line across the middle of the result, that's your texture telling you it's not seamless. That's the diagnostic working - go fix the texture, not the offset.

CategoryMKRShift Nodes/Surface/Texture

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
settings_jsonSTRING{"mode":"half_tile","offset_x":0.5,"offset_y":0.5,"seam_width":6.0,"seam_softness":3.0}

Outputs (3)

NameTypeDescription
imageIMAGE
maskMASK
offset_infoSTRING