A comprehensive node pack for ComfyUI that provides powerful image effects, pattern generation, and animated pattern creation capabilities. Perfect for creating dynamic textures, visual effects, and animated sequences.
- Image Crop + Video Crop β Standalone crop / resize nodes with a live preview canvas, a draggable green crop overlay, 14 aspect-ratio presets, and four fit modes (Stretch / Cover / Contain / Crop). Output: single
IMAGEor singleVIDEO. Each comes in two flavors: client-side (source file stays in the browser) and upload (persists across reloads, processed server-side). - Draggable crop overlay β Click and drag the green rectangle on any crop preview to position the crop window. Anchor + offset_x / offset_y update automatically so the workflow knows exactly where to crop.
- Playback controls on every video preview β Extractor nodes get Play / Pause that drives the scrubber and commits the current frame on pause. Trim nodes get Play Loop, which auto-rewinds inside the trim handles so you can preview the segment exactly as it'll render.
- Crop preview smoothness β Preview canvas capped at 720px (longest side) and driven by
requestVideoFrameCallbackso playback updates every frame, not every 250 ms. Server-side video resize switched to OpenCV (~10Γ faster than per-frame PIL).
- Media Extractor β Standalone "Load Video" node, scrub a local video, output a single chosen frame. Two flavors:
- Media Extractor (Purz) β pure client-side; the video file never reaches the server. Only the chosen PNG is sent on commit.
- Media Extractor Upload (Purz) β uploads to ComfyUI's
input/directory; selection persists across browser reloads.
- Video Trim β Set in / out points on a video, output the trimmed segment as a
VIDEO. Two flavors:- Video Trim (Purz) β client-side; trim segment is baked in-browser via
MediaRecorder(webm vp9/vp8 + opus) and shipped up once. Source file stays local. - Video Trim Upload (Purz) β server-side
VideoFromFile.as_trimmed()β lazy windowed read, no re-encode, instant.
- Video Trim (Purz) β client-side; trim segment is baked in-browser via
- Playback in every preview widget β Play / Pause that drives the scrubber; trim nodes get a Play-Loop that auto-rewinds inside the trim handles so you can preview the segment.
- Pixelate node rewrite β Now a full retro-pixel pipeline: area / nearest / median downsampling, posterize + named palettes (Game Boy, NES, C64, PICO-8, CGA, Endesga 32), ordered Bayer + Floyd-Steinberg dithering, grid-line overlay, separate X/Y pixel sizes, optional MASK input.
All nodes now support ComfyUI's V3 schema with slider widgets for numeric inputs - providing a much better user experience than the default number pickers with increment buttons.
V3 Features:
- Slider Controls - All numeric parameters use intuitive slider widgets
- Auto-Detection - Automatically uses V3 when available, falls back to V1 for older ComfyUI versions
- Animated Grain - New checkbox toggle for the Grain effect to enable animated film grain
- Live Animation Preview - Effects with animation capabilities preview in real-time
Apply real-time WebGL filters to entire video sequences! The Interactive Image Filter now fully supports batch processing, making it perfect for video workflows:
- Load your video - Use any video loader node (like VHS) to load frames into ComfyUI
- Connect to Interactive Filter - Pipe your image batch into the Interactive Image Filter node
- Preview & adjust - Use the built-in playback controls to scrub through your video while adjusting filters in real-time
- Run the workflow - When you execute, all frames are automatically processed through WebGL and output as a filtered batch
- Combine with video output - Connect the output to any video combiner node to export your filtered video
- Frame Playback - Built-in play/pause and frame scrubber to preview your video
- Adjustable FPS - Choose playback speed (6, 8, 12, 16, 24, 30, 48, 60 fps)
- Live Preview - See filter effects applied in real-time as you scrub through frames
- Automatic Processing - Backend waits for WebGL processing to complete before outputting
- Chunked Upload - Large batches are uploaded efficiently in chunks to handle any video length
Eight standalone media nodes that load their own files. No upstream IMAGE batch or VHS loader required β every node has its own "Load β¦" button (client-side variant) or "Upload β¦" button (server-side variant that persists across browser reloads).
All four feature pairs share the same client-side / server-side split:
- Client-side (Path A) β source file is wrapped in a blob URL and never reaches the server until you queue the workflow. Only the final result (a PNG, a webm, or a small JSON) hits the backend. Source state doesn't survive a browser refresh.
- Upload (Path B) β source file goes into ComfyUI's
input/directory the moment you pick it. Workflow serializes the filename and the resize / trim parameters so reloading the page restores everything.
Load a video, scrub or play through it, hit pause on the frame you want. The selected frame becomes the IMAGE output.
πΈ Add screenshot of Media Extractor node here
- Built-in Play / Pause that drives the scrubber via
requestVideoFrameCallback. - First / Last buttons jump to the first or last frame.
- Pausing or releasing the scrubber commits the current frame.
- Output:
IMAGE([1, H, W, 3]tensor).
Load a video, drag the dual-handle timeline to set in / out points. Hit Play Loop to preview the trim exactly as it'll render.
πΈ Add screenshot of Video Trim node here
- Dual-handle timeline with draggable start / end + click-to-seek + playhead.
- Play Loop loops playback between the handles for accurate preview.
- Auto-bake on Queue (Path A): backend signals the frontend, which encodes the trim as webm via
MediaRecorder(audio preserved) and ships it up once. Re-queues with unchanged handles short-circuit instantly. - Server-side trim (Path B):
VideoFromFile.as_trimmed(start, duration)β lazy windowed read, no re-encode, instant. - Output:
VIDEO.
Load an image, set the output dimensions, pick a fit mode, drag the green overlay to position the crop. Live preview shows the source with the crop region highlighted.
πΈ Add screenshot of Image Crop node here
- 14 aspect-ratio presets (1:1, 4:3, 3:4, 16:9, 9:16, 21:9, 9:21, 3:2, 2:3, 5:4, 4:5, 2:1, 1:2, Free).
- Aspect change anchors the output's longest side to the source's longest side (no more 1920Γ4480 surprises for 9:21 on a 1080p source).
- Four fit modes: Stretch (squish), Cover (anchor-positioned crop), Contain (letterbox with bg color), Crop (Cover plus manual zoom + offset).
- Draggable green overlay β click and drag anywhere on the preview to move the crop window. Anchor snaps to center so offsets cover the full source extent.
- Output:
IMAGE.
Same UX as Image Crop, but for video. Plays with audio so you can preview the framing in motion.
πΈ Add screenshot of Video Crop node here
- Everything Image Crop has, plus playback.
- Path A bakes the resized clip in-browser via
<canvas>+MediaRecorder(audio passthrough). Bake duration β playback duration of the clip. - Path B resizes server-side via OpenCV (
cv2.INTER_AREAfor downscale,cv2.INTER_LANCZOS4for upscale) β fast on long clips. - Output:
VIDEO.
A powerful real-time image filter system with WebGL preview:
- 120+ Filter Effects across 8 categories
- Layer-Based System - Stack multiple effects with individual opacity
- Drag & Drop Reordering - Easily rearrange effect layers
- Real-Time Preview - See changes instantly via WebGL shaders
- Effect Search + Favorites - Fuzzy search, star favorites, and recently used effects
- Undo/Redo - Full undo/redo with Ctrl+Z / Ctrl+Shift+Z
- A/B Split Preview - Draggable before/after comparison divider
- Mask Support - Optional MASK input for selective filtering
- Non-Destructive - Adjust filters without re-running the workflow
- Pipeline Output - Filtered result outputs to the workflow for further processing
- Video Batch Support - Process entire video sequences with playback preview
- 40+ Built-in Presets - Professional presets for Film, Portrait, Landscape, B&W, Mood, Creative, Cinematic, Vintage, Stylized, and Enhancement styles
- Custom Presets - Save and load your own effect combinations
Filter Categories:
- Basic (16): Desaturate, Brightness, Contrast, Exposure, Gamma, Vibrance, Saturation, Lift, Gain, Offset, Auto Contrast, Normalize, Equalize, Solarize, Fade, Cross Process
- Color (15): Hue Shift, Temperature, Tint, Colorize, Channel Mixer, Split Tone, Color Balance, Selective Color, HSL Adjust, Gradient Map, Color Lookup, Vibrance Pro, RGB Curves, CMYK Adjust, Color Harmony
- Tone (16): Highlights, Shadows, Whites, Blacks, Levels, Curves, Tone Curve, HDR Tone, Shadow Recovery, Highlight Recovery, Midtone Contrast, Luminosity Mask, Zone System, Dynamic Range, Tone Split, Local Contrast
- Detail (15): Blur, Sharpen, Unsharp Mask, Clarity, Dehaze, High Pass, Low Pass, Bilateral Filter, Surface Blur, Smart Sharpen, Micro Contrast, Texture Enhance, Noise Reduction, Detail Extract, Frequency Separation
- Effects (17): Vignette, Grain, Posterize, Threshold, Invert, Sepia, Duotone, Light Leak, Lens Flare, Bokeh, Film Burn, Scratch, Dust, Water Droplets, Frosted Glass, Heat Distortion, CRT Scanlines
- Artistic (14): Emboss, Edge Detect, Sketch, Oil Paint, Watercolor, Pencil Sketch, Charcoal, Woodcut, Linocut, Pop Art, Comic Book, Stained Glass, Mosaic, Pointillism
- Creative (14): Pixelate, Chromatic Aberration, Glitch, Halftone, Mirror, Kaleidoscope, Tunnel, Ripple, Wave Distortion, Twirl, Spherize, Pinch, Stretch, Fisheye
- Lens (13): Lens Distortion, Tilt Shift, Radial Blur, Depth of Field, Focus Stack, Miniature, Anamorphic, Barrel Distortion, Pincushion, Mustache Distortion, CA Red/Cyan, CA Blue/Yellow, Lens Vignette
Transform your images with professional-grade effects:
- Black & White Conversion - High-quality grayscale conversion using luminance weighting
- Image Rotation - Rotate images with customizable background colors and transparency support
- Blur Effects - Gaussian, box, and motion blur with adjustable intensity
- Color Adjustments - Fine-tune brightness, contrast, and saturation
- Image Flipping - Horizontal, vertical, and combined flipping options
- Pixelate Effect (v2.0.0 rewrite) - Full retro-pixel pipeline: area / nearest / median downsampling, posterize + named palettes (Game Boy, NES, C64, PICO-8, CGA, Endesga 32), Bayer + Floyd-Steinberg dithering, grid lines, non-square pixels, optional MASK input
- Edge Detection - Sobel, Canny, and Laplacian edge detection algorithms
Create stunning patterns from scratch:
- Checkerboard - Classic checkerboard patterns with customizable colors and square sizes
- Stripes - Horizontal, vertical, and diagonal stripe patterns
- Polka Dots - Circular dot patterns with staggered and regular arrangements
- Grid Patterns - Solid, dashed, and dotted grid overlays
- Noise Patterns - Random, smooth, and cloudy noise generation
- Gradients - Linear, radial, diagonal, and corner gradients
Bring your patterns to life with mathematical precision:
- Animated Checkerboards - Dynamic checkerboard patterns with wave modulation
- Animated Stripes - Moving stripe patterns with various wave effects
- Animated Polka Dots - Pulsating and morphing dot patterns
- Animated Noise - Evolving noise patterns with temporal coherence
-
Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/ -
Clone this repository:
git clone https://github.com/purzbeats/ComfyUI-Purz.git
-
Install dependencies:
cd ComfyUI-Purz pip install -r requirements.txt -
Restart ComfyUI
- Interactive Filter - Real-time layer-based image filter with 120+ effects, WebGL preview, and video batch support
- Media Extractor - Load a video locally, scrub to a frame, output that single frame (client-side)
- Media Extractor Upload - Same, but the video persists in
input/across reloads (server-side) - Video Trim - Load a video locally, set in/out points, output the trimmed
VIDEO(client-side bake) - Video Trim Upload - Same, persistent across reloads, lazy
VideoFromFile.as_trimmed()on the backend - Image Crop (v2.1.0) - Load an image locally, crop / resize with a draggable overlay, output
IMAGE - Image Crop Upload (v2.1.0) - Same, persistent; server-side resize via PIL
- Video Crop (v2.1.0) - Load a video locally, crop / resize with a draggable overlay, output
VIDEO - Video Crop Upload (v2.1.0) - Same, persistent; server-side resize via OpenCV (per-frame)
- Image to Black & White - Convert color images to grayscale
- Color Adjust - Adjust brightness, contrast, and saturation
- Rotate Image - Rotate images with background options
- Flip/Mirror Image - Flip images horizontally, vertically, or both
- Blur Image - Apply various blur effects
- Pixelate Effect - Create pixelated effects
- Edge Detection - Detect edges using multiple algorithms
- Checkerboard Pattern - Generate checkerboard patterns
- Stripes Pattern - Create stripe patterns in multiple directions
- Polka Dot Pattern - Generate polka dot patterns
- Grid Pattern - Create grid overlays
- Gradient Pattern - Generate gradient fills
- Simple Noise Pattern - Generate various noise types
- Animated Checkerboard - Dynamic checkerboard with wave modulation
- Animated Stripes - Moving stripe patterns
- Animated Polka Dots - Animated dot patterns
- Animated Noise - Temporal noise patterns
The animated pattern nodes support advanced mathematical operations for texture combination:
- Basic Operations: Add, Subtract, Multiply, Divide
- Comparison: Minimum, Maximum, Greater Than, Less Than
- Trigonometric: Sine, Cosine, Tangent
- Advanced: Power, Modulo, Smooth Min/Max
Multiple wave types and shapes for animation:
- Wave Types: Sine, Cosine, Square, Triangle, Sawtooth
- Directions: Horizontal, Vertical, Diagonal, Radial
- Shapes: Sine, Square, Triangle wave shaping
Professional color interpolation methods:
- Linear - Standard linear interpolation
- Ease - Smooth step interpolation
- B-Spline - Smooth B-spline curves
- Cardinal - Cardinal spline interpolation
- Constant - Hard transitions
- Video Workflows: Load video with VHS or similar, connect to Interactive Filter, preview with playback controls, then output to video combiner
- Batch Processing: All nodes support batch processing for multiple images and video frames
- Color Formats: Use hex color codes (e.g., #FF0000 for red) in pattern generators
- Animation: Set frame_count to create image sequences for video generation
- Performance: Lower resolution patterns render faster - upscale if needed
- Experimentation: Try different mathematical operations for unique effects
When you save custom presets in the Interactive Image Filter, they are stored as JSON files in:
ComfyUI/custom_nodes/ComfyUI-Purz/presets/
Important: If you uninstall or update this node pack, your custom presets may be deleted. Back up the presets/ folder before uninstalling to preserve your saved presets.
- ComfyUI
- PyTorch
- NumPy
- PIL (Pillow)
- OpenCV (cv2)
This project is open source. Feel free to use, modify, and distribute according to your needs.
Contributions are welcome! Please feel free to submit pull requests or open issues for bug reports and feature requests.
If you encounter any issues or have questions, please open an issue on the GitHub repository.
Future plans for ComfyUI-Purz:
- Custom WebGL Effects - Break out Interactive Image Filter effects into separate shader files, allowing users to create and share their own custom WebGL effects
- More Effects - Expanded to 120+ effects with 80 new shader effects in v1.5.0
- More Presets - Added 16 new presets (Cinematic, Vintage, Stylized, Enhancement)
- Layer Reordering - Drag and drop to re-arrange effect layers
- Effect Search + Favorites - Searchable effect picker with fuzzy search, favorites, and recently used
- Undo/Redo - Full undo/redo system with Ctrl+Z / Ctrl+Shift+Z
- A/B Split Preview - Before/after comparison with draggable divider
- Mask Support - Apply filter effects selectively using masks
- Media Extractor - Standalone video frame picker (v2.0.0)
- Video Trim - In/out point trimming with
VIDEOoutput (v2.0.0) - Pixelate Rewrite - Retro palettes, dithering, grid lines (v2.0.0)
- Image Crop + Video Crop - Standalone crop / resize nodes with live preview (v2.1.0)
- Draggable crop overlay - Position the crop window by dragging the green box (v2.1.0)
- Smooth video previews - rVFC-driven playback, capped preview canvas (v2.1.0)
- Native UI Refactor - Refactor effects layers window to use native ComfyUI elements for proper resize on V1/V2
You can create your own WebGL filter effects:
- Copy
shaders/custom/_template.glslto a new file likeshaders/custom/myeffect.glsl - Edit the shader code (WebGL 1.0 GLSL)
- Optionally create
shaders/custom/myeffect.jsonfor custom parameters:{ "name": "My Effect", "category": "Custom", "params": [ { "name": "amount", "label": "Amount", "min": 0, "max": 1, "default": 0.5, "step": 0.01 } ] } - Restart ComfyUI - your effect will appear in the dropdown
- Image Crop + Image Crop Upload + Video Crop + Video Crop Upload β Four new standalone crop / resize nodes (
Purz/Interactive). Each pair has a client-side variant (source stays in the browser, baked on Queue) and an upload variant (file lives ininput/, processed server-side). Live preview canvas shows the full source with a green overlay marking the crop region; 14 aspect-ratio presets; four fit modes (stretch / cover / contain / crop). - Draggable crop overlay β Click and drag the green rectangle on any crop preview to position the crop window. Anchor snaps to center,
offset_x/offset_ytrack the drag, the workflow stays in sync. - Playback controls on every video preview widget. Extractor nodes get Play / Pause that commits on pause. Trim nodes get Play Loop that auto-rewinds between the trim handles for accurate preview.
- Preview performance β Canvas capped at 720px on its longest side, redrawn via
requestVideoFrameCallbackfor per-frame updates during playback (was throttled to ~4 fps bytimeupdate). - Server-side video resize switched from PIL
Image.LANCZOSto OpenCV (cv2.INTER_AREA/cv2.INTER_LANCZOS4) with a single bulk uint8 conversion β roughly 10Γ faster on long clips. - Diagnostic + defensive fixes for the Path-A bake protocol:
fsyncafter writing baked PNG / webm, small post-wait sleep before reading cached files, eager PIL decode to surface partial-write errors, hardenedunique_idcheck, named print lines that pinpoint cache miss reasons.
- Media Extractor + Media Extractor Upload β Standalone frame-picker nodes. Path A keeps the video file in the browser; only the chosen frame goes to the backend. Path B uploads to
input/for cross-reload persistence. - Video Trim + Video Trim Upload β Standalone trim nodes that output a
VIDEO. Path A bakes the segment in-browser viaMediaRecorderand auto-fires on Queue (no manual bake button). Path B usesVideoFromFile.as_trimmed()for instant lazy trims. - Playback in every video preview β Play / Pause that drives the scrubber on extractor nodes; Play Loop that auto-rewinds inside the trim handles on trim nodes. Click-anywhere-on-preview also toggles play.
- Pixelate node rewrite β Full retro-pixel pipeline: area / nearest / median downsampling, posterize + 6 named palettes (Game Boy, NES, C64, PICO-8, CGA, Endesga 32), ordered Bayer + Floyd-Steinberg dithering, grid lines, separate X/Y pixel sizes, optional MASK input. Shared
_pixelate_image()used by V1 and V3.
- Effect Search + Favorites + Recently Used - Searchable effect picker with fuzzy search, star favorites, recently used section, collapsible categories, and keyboard navigation
- Undo/Redo System - Full undo/redo with Ctrl+Z / Ctrl+Shift+Z, toolbar buttons, 50-state stack
- A/B Split Preview - Draggable before/after divider on preview canvas; toggle between Split, Original, and Filtered views
- Mask Support - Optional MASK input for selective filtering (per-pixel blend, works in V1 and V3)
- Modular Frontend - Split monolithic JS into 5 ES modules for maintainability (zero behavior change)
- Code Quality Refactor - Major internal cleanup with no user-facing behavior changes
- Extracted shared
utils.pymodule consolidating 10 duplicate helper implementations - Reduced V3 Interactive Filter from 657 lines to 51 lines by eliminating duplicated code
- Replaced 400-line if/elif filter chain with clean registry-based dispatch pattern
- Correct V3 API usage (
cls.hidden.unique_id) replaces hacky fallback logic
- Extracted shared
- Performance - Vectorized HSV conversion for
hueShiftandcolorizeeffects (massive speedup on large images)
- Memory Leak Fix - Interactive Filter now properly cleans up WebGL resources when node is deleted
- DOM Widget Overflow Fix - UI controls no longer break out of node bounds in LiteGraph
- Batch Processing Timing Fix - Frames are now properly processed through filters before output (fixes race condition)
- V3 Schema Support - All nodes now use ComfyUI V3 schema with slider widgets for better UX
- Slider controls for all numeric inputs (brightness, contrast, angles, sizes, etc.)
- Auto-detects V3 API availability, falls back to V1 for older ComfyUI
- New V3 files:
image_effects_v3.py,pattern_generators_v3.py,animated_patterns_v3.py,interactive_filters_v3.py
- Animated Grain - New checkbox toggle to enable animated film grain effect
- Live Animation Preview - Effects with animation now preview continuously in real-time
- Fixed - Single image processing now works correctly
- 80 New Shader Effects - Massive expansion to 120+ total effects
- Basic: Lift, Gain, Offset, Auto Contrast, Normalize, Equalize, Solarize, Fade, Cross Process
- Color: Split Tone, Color Balance, Selective Color, HSL Adjust, Gradient Map, Color Lookup, Vibrance Pro, RGB Curves, CMYK Adjust, Color Harmony
- Tone: Tone Curve, HDR Tone, Shadow Recovery, Highlight Recovery, Midtone Contrast, Luminosity Mask, Zone System, Dynamic Range, Tone Split, Local Contrast
- Detail: High Pass, Low Pass, Bilateral Filter, Surface Blur, Smart Sharpen, Micro Contrast, Texture Enhance, Noise Reduction, Detail Extract, Frequency Separation
- Effects: Light Leak, Lens Flare, Bokeh, Film Burn, Scratch, Dust, Water Droplets, Frosted Glass, Heat Distortion, CRT Scanlines
- Artistic: Watercolor, Pencil Sketch, Charcoal, Woodcut, Linocut, Pop Art, Comic Book, Stained Glass, Mosaic, Pointillism
- Creative: Mirror, Kaleidoscope, Tunnel, Ripple, Wave Distortion, Twirl, Spherize, Pinch, Stretch, Fisheye
- Lens: Depth of Field, Focus Stack, Miniature, Anamorphic, Barrel Distortion, Pincushion, Mustache Distortion, CA Red/Cyan, CA Blue/Yellow, Lens Vignette
- 16 New Presets - Cinematic (Blockbuster, Noir, Sci-Fi, Horror), Vintage (Kodachrome, Polaroid, 70s, Daguerreotype), Stylized (Neon Nights, Anime, Watercolor Dream, Comic), Enhancement (Portrait Pro, Landscape HDR, Detail Pop, Auto Fix)
- Layer Reordering - Drag and drop layers with visual indicators
- Fixed - Custom shaders now work correctly in video batch processing
- NEW: Custom WebGL Effects - Create and share your own filter effects
- 42 built-in shaders extracted to
shaders/directory for reference - Custom shaders go in
shaders/custom/with optional .json metadata - Template provided at
shaders/custom/_template.glsl - Backend API endpoints for dynamic shader loading
- 42 built-in shaders extracted to
- NEW: Video Batch Processing - Full support for processing video sequences
- Built-in playback controls with play/pause, frame scrubber, and FPS selection
- Real-time preview of filters on video frames as you scrub through
- Automatic WebGL batch processing when workflow executes
- Backend synchronization ensures all frames are processed before output
- Chunked upload system handles large video batches efficiently
- Works seamlessly with video loader/combiner nodes (VHS, etc.)
- NEW: Preset System for Interactive Image Filter
- 25 built-in professional presets across 6 categories (Film, Portrait, Landscape, Black & White, Mood, Creative)
- Save custom presets as JSON files in the
presets/folder - Load presets instantly via dropdown menu
- Presets are portable and can be shared between installations
- NEW: Interactive Image Filter - A powerful layer-based real-time filter system
- 42 filter effects across 8 categories (Basic, Color, Tone, Detail, Effects, Artistic, Creative, Lens)
- Real-time WebGL preview - see changes instantly without re-running workflow
- Layer system with per-layer opacity control
- Stack multiple effects for complex adjustments
- Filtered output pipes directly into workflow for further processing
- Save button to export filtered images directly to output folder
- Initial release with image effects, pattern generation, and animated patterns