Preview Animation (Swwan):
SwwanPreviewAnimation creates a temporary animated WebP preview from a sequence of frames, making it useful for checking motion and timing without setting up a separate export step. It can preview image frames, grayscale mask frames, or a combination of the two. The preview is saved as a lossy WebP at quality 50 and displayed through the node’s interface; it is intended for review rather than as a final-quality animation export.
Preview Animation (Swwan) Input Parameters:
fps
Controls playback speed in frames per second. A higher value makes the animation play faster, while a lower value gives each frame more time on screen. The default is 8.0, the minimum is 0.01, the maximum is 1000.0, and the interface step is 0.01. The node calculates each frame’s duration as int(1000.0 / fps) milliseconds, so extremely high values can round the duration down to zero; moderate values are more practical for inspecting motion.
images
An optional IMAGE batch to use as the animation frames, in batch order. If you connect images without masks, each image becomes a frame. If you connect both images and masks, the node uses the masks to create white overlays on image frames. There is no default image, minimum, or maximum specified for this input.
masks
An optional MASK batch. If you connect masks without images, each grayscale mask becomes a frame. When you connect both inputs, the node applies each mask as the transparency of a white layer composited over an image: brighter mask areas produce more visible white, while darker areas reveal more of the underlying image. The code does not establish reliable one-to-one pairing for every combination of image and mask batch lengths, so use matching batch sizes and inspect the resulting preview. There is no default mask, minimum, or maximum specified for this input.
Preview Animation (Swwan) Output Parameters:
This node has no output sockets. It is an output node: rather than passing a value to another node, it saves a temporary WebP preview and returns information for the interface to display it, including whether the preview has more than one frame and a text summary of the frame count and first frame’s dimensions.
Preview Animation (Swwan) Usage Tips:
- Connect an IMAGE batch to review an image sequence, or a MASK batch to review masks as grayscale frames. Connect both when you want to see the node’s white mask overlay on images.
- Start with the default 8 fps, then lower it to inspect changes between frames or raise it to check faster motion. Avoid extremely high values because frame duration is rounded down to a whole number of milliseconds.
- Use frames with consistent dimensions. When combining images and masks, make sure their dimensions match so the mask can be applied to the image.
- Treat the temporary WebP as a quick preview, not a final export: the node saves it with lossy compression at quality 50.
Preview Animation (Swwan) Common Errors and Solutions:
PreviewAnimation: No images or masks provided
- Explanation: Neither optional frame input is connected, so the node has nothing to preview and returns an empty interface result.
- Solution: Connect an IMAGE batch, a MASK batch, or both.
ValueError: range() arg 3 must not be zero
- Explanation: A connected input contains no frames. The node uses the frame count as the step in a loop, which fails when that count is zero.
- Solution: Check that the connected batch contains at least one image or mask before running the node.
ValueError: images do not match
- Explanation: An image and mask have different dimensions, so the white mask layer cannot be composited onto that image.
- Solution: Resize or generate the images and masks at matching widths and heights before connecting them.
WebP save or file-writing error
- Explanation: The node could not save its temporary
.webppreview. The exact message depends on the image library and file system; possible causes include frames with incompatible dimensions or an unavailable or unwritable temporary folder. - Solution: Check that every frame has the same dimensions, then verify that the application can write to its temporary folder.
