ComfyUI Node

SJ Sweep Effect

That Glossy 'Shine Sweeps Across' GIF, Without Leaving ComfyUI

By BEIBEI-star661·Created about a year ago·Updated about a year ago· 0
SJ Sweep Effect
  • image
  • sweep_color
  • frames
sweep_speed1.0
sweep_intensity1.0
sweep_angle0
blur_radius30
sweep_width0.20
pure_color_modefalse
frames24
qualitymedium

You know that effect - a diagonal band of light slides across a logo, a product render, or a text title, like someone's sweeping a flashlight over a glossy surface. It's everywhere in ad loops and animated banners, and normally it costs you a keyframe-animation session in Photoshop or After Effects. SJ Sweep Effect does it inside your ComfyUI graph instead: feed it one static image and it spits out a full batch of frames with the sweep baked in, ready for a GIF or video encode.

Honest framing first: this is a small, single-purpose utility from a tiny pack (BEIBEI-star661/SJ_sweepEffect_Comfyui) - the README is in Chinese, the node's menu category is the author's initials ("CSJ"), and nobody on Reddit is talking about it. That's fine. It's not the next ControlNet; it's a specific tool for a specific recurring look, and it does that one job cleanly.

How it works

The mechanism is refreshingly simple, and it's all in the source - no models, no API calls, no downloads. For each of the frames you ask for, the node computes a progress value (0→1), smooths it with a curve nicer than smoothstep, and moves a diagonal line from the top-left toward the bottom-right. Around that line it builds a soft mask from three layered Gaussian falloffs (a sharp core, a mid transition, a wide faint edge), then blurs and applies it.

The part worth appreciating is the anti-aliasing. Instead of a hard-edged bar, the mask is built by supersampling - high quality does 25 sub-pixel samples per pixel - then run through a separable Gaussian blur. That's what stops the sweep from shimmering in a GIF; a hard diagonal edge crawls at 8fps.

The blend is screen mode (1 − (1−base)·(1−light)), which is the right call for light: a sweep brightens what it crosses and never darkens or tints the rest of the image. It'll run on GPU if one's available, and the input image stays untouched outside the sweep region.

The inputs that actually matter

You only really set a handful of these:

  • sweep_speed (0.1–10, default 1) - how fast the band crosses. Above ~2 the sweep finishes before the sequence ends and the last frames sit static.
  • blur_radius (0–100, default 30) - edge softness. Crank it for a diffuse glow, keep it low for a crisp specular shine.
  • sweep_width (0.01–0.5, default 0.2) - band thickness as a fraction of the shorter image dimension.
  • pure_color_mode + sweep_color - this is the trap. The sweep is white by default and the toggle defaults to off; set a color without flipping it and you'll swear the node is broken. Flip pure_color_mode on and your hex color takes over.
  • quality (low/medium/high) - anti-aliasing effort. high is 25 samples per pixel, the slow option on a 1024px image, so keep medium for iterating and high for the final encode.

The only output is frames, an IMAGE batch where the batch dimension is your frame count. Wire it straight into VHS_VideoCombine (from VideoHelperSuite) → pick GIF or MP4, set a frame rate, done.

Installing it

Either use ComfyUI Manager - search "SJ Sweep Effect" or "sweepEffect" under Install Custom Nodes - or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/BEIBEI-star661/SJ_sweepEffect_Comfyui.git
cd SJ_sweepEffect_Comfyui
pip install -r requirements.txt

Then restart ComfyUI and look for SJ Sweep Effect under the CSJ category. The requirements file lists torch, torchvision, numpy, pillow and opencv-python - you already have the first four in any working ComfyUI, and the code never actually imports opencv, so odds are there's nothing new to install. No model files, no checkpoints, nothing to fetch. It's one of those rare packs where it just works after a clone.

Gotchas

  • Frames are capped at 30 (16–30). At a typical 8–10fps GIF that's only 2–3 seconds of animation. For a longer loop, render once and set VideoCombine's loop count, or slow down sweep_speed rather than trying to squeeze out more frames.
  • Slow output at high quality isn't a bug - 25 sub-pixel samples per pixel is real work. Drop to low while tuning, bump to high for the final pass.
  • The color won't apply unless pure_color_mode is on (see above - the single most common complaint in the README's own FAQ).
  • It's one image in, one image out - a batched input gets squeezed to its first frame, so don't expect it to sweep a whole video.

Honest verdict: if you make product shots, logos, or text renders that need that glossy shine loop, this is the fastest path from static image to finished GIF you'll find in the ecosystem. If that's not your thing, you'll never touch it - and that's fine too.

CategoryCSJ

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
sweep_speedFLOAT1.00.1–10
sweep_intensityFLOAT1.00.1–2
sweep_angleFLOAT00–360
blur_radiusINT300–100
sweep_widthFLOAT0.200.01–0.5
sweep_colorCOLOR#FFFFFF
pure_color_modeBOOLEANfalse
framesINT2416–30
qualityCOMBOmedium3 options: low, medium, high

Outputs (1)

NameTypeDescription
framesIMAGE