Nodes/Image Block Glitch/图像块错位故障 / Image Block Glitch
ComfyUI Node

图像块错位故障 / Image Block Glitch

The no-model node that breaks your pixels on purpose

By YudachiL·Created 2 months ago·Updated 2 months ago· 4
图像块错位故障 / Image Block Glitch
  • image
  • selection_mask
  • image
  • affected_mask
region_modecoordinates
region_x0
region_y0
region_width512
region_height512
block_count24
block_width_min48
block_width_max240
block_height_min4
block_height_max24
shift_min12
shift_max160
vertical_jitter0
block_probability1.00
allow_overlaptrue
hue_shift_enabledtrue
hue_shift_probability0.65
hue_shift_min-25
hue_shift_max25
opacity1.00
edge_modeclip
seed0

Most of the ComfyUI ecosystem is obsessed with making images cleaner - more detail, fewer artifacts, a face detailer to fix the fifth finger. Image Block Glitch is the opposite energy: it takes a finished image and deliberately slides horizontal strips of it sideways until it looks like a corrupted VHS tape or a dying monitor. It's the "let the pixels break a little" aesthetic that anime key visuals, poster art, and music covers have been leaning on for years, and it does the whole thing with zero model downloads and zero VRAM.

The name is also the mechanism. The node picks horizontal rectangular blocks inside a region you define, copies them, and pastes them back shifted left or right. That's the entire trick - the classic "block displacement" glitch, not a filter approximation of it. It ships from YudachiL/comfyui-image-block-glitch, and it sits firmly in ComfyUI's post-processing layer: a deterministic pixel operation, exactly the kind of thing the post-processing doc argues you should reach for instead of burning a diffusion pass. It even prints its intent on the tin - the README pitches it at 二次元 illustration, character art, posters, and covers.

The few inputs that actually matter

The node has a lot of knobs, but you'll set a handful and touch the rest rarely:

  • region_mode - coordinates (a plain x/y/width/height rectangle) or mask, where the optional selection_mask input defines an any-shape region. This is the selling point: draw a mask in the Load Image node's mask editor and the node only places blocks that fit fully inside the white area, preserving holes and avoiding odd shapes.
  • block_count - how many glitch blocks it tries to place. Read that carefully: it's attempts, not guarantees. block_probability rolls for each candidate, and a crowded mask can skip blocks, so expect fewer than the number you type.
  • block_width_min/max and block_height_min/max - block size in pixels. The defaults (48–240 wide, 4–24 tall) give you those thin horizontal slivers that read as "data tear."
  • shift_min/max - how far each block slides sideways in pixels. Keep vertical_jitter at 0 for a pure horizontal glitch.
  • seed - same image, same params, same seed, same result. It's deterministic per batch frame, so you can lock a look and iterate on other knobs.

The two outputs are image (your glitched frame) and affected_mask (a BHW mask marking exactly where blocks landed). Wire that mask into a compositing step to restrict a second effect to the glitched areas, or just drop image straight into a Save node.

The options worth knowing

hue_shift_enabled plus hue_shift_min/max rotate each block's hue by a random angle in that range - negatives work, so -120..120 with a probability of 0.7+ gives you the neon RGB-split look. allow_overlap decides whether blocks can stack on each other (the README's "neon" preset wants overlap on). opacity blends rather than hard-pastes, which is how you get subtle, partial corruption instead of a demolition. edge_mode is clip (trim blocks at the region edge) or wrap (wrap them around to the other side) - wrap is really a coordinates-mode feature, since mask mode always respects the mask's active area.

Install and gotchas

No models, no heavy deps - the node runs on PyTorch alone, which ComfyUI already has. requirements.txt lists only Pillow, and that's only used by the included standalone.py CLI, not the node itself. Install via ComfyUI Manager (search "Image Block Glitch") or:

cd ComfyUI/custom_nodes
git clone https://github.com/YudachiL/comfyui-image-block-glitch.git

Then restart ComfyUI and look for Image Block Glitch under image/effects. If you're feeling adventurous, the repo ships a standalone.py that runs the same effect from the command line without ComfyUI at all.

Where people trip: if you set region_mode to mask but leave selection_mask unplugged, the node hard-errors - it doesn't silently fall back to coordinates. And if a mask is too narrow or ragged, blocks silently stop appearing; drop block_width_min/block_height_min until they fit. For a classic horizontal glitch keep vertical_jitter = 0 and hue_shift_probability around 0.2–0.4; for full neon chaos go 30–60 blocks, overlap on, hue range -120..120. One caveat: this is a young, single-release pack (v1.0.0, mid-2026) with no community footprint yet, so don't expect forum wisdom if it misbehaves - but the source is clean, MIT-licensed, and the code does exactly what the README claims.

Categoryimage/effects

Inputs (24)

NameTypeDefaultDescription
imageIMAGE
region_modeCOMBOcoordinates2 options: coordinates, mask
region_xINT00–16384
region_yINT00–16384
region_widthINT5121–16384
region_heightINT5121–16384
block_countINT240–500
block_width_minINT481–16384
block_width_maxINT2401–16384
block_height_minINT41–4096
block_height_maxINT241–4096
shift_minINT120–16384
shift_maxINT1600–16384
vertical_jitterINT00–1024
block_probabilityFLOAT1.000–1
allow_overlapBOOLEANtrue
hue_shift_enabledBOOLEANtrue
hue_shift_probabilityFLOAT0.650–1
hue_shift_minFLOAT-25-180–180
hue_shift_maxFLOAT25-180–180
opacityFLOAT1.000–1
edge_modeCOMBOclip2 options: clip, wrap
seedINT00–18446744073709550000
selection_maskoptMASK

Outputs (2)

NameTypeDescription
imageIMAGE
affected_maskMASK