effect shatter (1.0)
Shatter an image into flying shards, frame by frame, without leaving ComfyUI
- input_image_path
- shard_mask_image
- shards_area_mask
- output_folder
- filepaths
- images
- masks
If you've ever wanted a "glass shatters and the pieces fly off" transition for an image-to-video workflow, this node is the whole effect in one box. No external service, no model download, no ffmpeg step required - you feed it an image, it renders every frame of the image breaking apart and drifting away, and hands you back PNG files (or tensors) you can turn into a GIF or feed straight into a video pipeline. It's a tiny personal pack from a solo author (ymc-github), MIT-licensed, and it does exactly one thing well.
What it actually does
The node slices your image into a grid of shards - shard_size controls how coarse the break-up is. Every shard gets its own random direction, speed, rotation, and a moment where it starts fading out, then the node composites all of them frame by frame onto a transparent background. The result is a frame_count-long sequence of the image coming apart: some pieces spin away fast, others drift, everything fades to nothing. Because each shard's parameters are random, no two runs ever shatter the same way.
You can also constrain where the shattering happens. Feed a shards_area_mask (any image or mask tensor) and only shards whose grid cell lands on a non-black pixel get created - so you can have the center of the image explode while the edges stay intact. shard_mask_image instead masks each individual shard's shape, and shard_shape lets you pick a built-in silhouette: square, triangle, circle, heart, star, or diamond. Heart-shaped debris is not something I'd have guessed I wanted, yet here we are.
The inputs that matter
input_image_path (required) is cleverly flexible - it accepts a file path string, an IMAGE tensor, or a MASK. The one other required field, output_folder, is a plain string defaulting to output_frames.
The few you'll actually touch:
frame_count- number of frames rendered (default 30). More frames = slower, smoother break.shard_size- grid cell size in pixels (default 40). Smaller = more, tinier pieces.speedandrotation- how fast shards fly and spin. Each shard gets a random multiplier on these, so they're more "intensity" than exact values.fade_start- 0 means shards start fading around the halfway point; set it higher to hold the break together longer before pieces vanish.
Everything numeric is a STRING field, by the way - you type numbers as text. That's the one thing that will throw you off first.
Outputs
Four outputs: output_folder (the folder used), filepaths (a newline-joined list of saved frame files), plus images and masks tensors. Wire filepaths into a video node or load the PNGs however you like.
Install
The easiest route is ComfyUI Manager: search for comfyui_node_ymc_effect_shatter. Manual install is the standard two-liner:
cd ComfyUI/custom_nodes
git clone https://github.com/YMC-GitHub/comfyui_node_ymc_effect_shatter
Then restart ComfyUI. Dependencies (just two tiny pypi helpers from the same author - yors_comfyui_node_setup and yors_pano_zero_field) are auto-installed on startup, so there's no heavy lifting. You'll find the node in the right-click menu under ymc/image/effect/shatter.
Gotchas
show_imagedefaults to"False"- and it's a string, not a checkbox. With it false, theimages/masksoutputs come back as empty tensors; frames only exist on disk. Setshow_imagetoTrueif you want to preview them in the graph.output_folderis relative. It resolves against ComfyUI's working directory (where you launched it from), so the default dumps frames intoComfyUI/output_frames. Use an absolute path if you want them elsewhere.save_imagedefaults toTrue, so the node writes files even if you never look at the outputs. Booleans accepttrue/false,1/0,enable/disable.
One honest caveat: this is a 1.0 solo project with a README that's mostly example images. If a field misbehaves, there's no big community to ask - but the source is short and readable, and the effect is predictable enough to dial in by trial.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| input_image_path | * | — | |
| output_folder | STRING | output_frames | — |
| frame_countopt | STRING | 30 | — |
| shard_sizeopt | STRING | 40 | — |
| speedopt | STRING | 10 | — |
| rotationopt | STRING | 5 | — |
| fade_startopt | STRING | 0 | — |
| name_prefixopt | STRING | frame_ | — |
| name_id_lengthopt | STRING | 3 | — |
| frame_start_indexopt | STRING | 1 | — |
| shard_shapeopt | STRING | square | — |
| shard_mask_imageopt | * | — | |
| shards_area_maskopt | * | — | |
| show_imageopt | STRING | False | — |
| save_imageopt | STRING | True | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| output_folder | STRING | — |
| filepaths | STRING | — |
| images | IMAGE | — |
| masks | MASK | — |