ComfyUI_Swwan Introduction
ComfyUI_Swwan is a collection of image, mask, transparency, and workflow tools for ComfyUI. It helps you handle practical tasks around AI image-making: resizing an image before editing, preparing a mask, combining images, placing an edited area back into its original image, or saving a transparent result.
The extension offers recommended nodes for new workflows while retaining legacy interfaces for older ones. This makes it easier to choose a starting point without losing access to more specialized controls. Search for Swwan in ComfyUI’s node menu; recommended node names include (Swwan). For the full list of recommended, advanced, legacy, and experimental nodes, see the node catalog.
You can try many of the image tools without downloading an AI model. Some example workflows involving Qwen, detection, segmentation, or hardware-specific features do require separate models, components, or suitable hardware.
How ComfyUI_Swwan Works
A ComfyUI workflow passes an image, mask, or other piece of information from one node to the next. Think of ComfyUI_Swwan as a set of workbench tools: one node measures or resizes an image, another prepares the mask, and another saves the finished result. You choose the tools and connect them in the order your artwork needs.
For example, a local edit might follow this path:
- Choose the area to edit. Supply an image and mask to Mask Crop.
- Work on the cropped area. Pass its image and mask outputs through your editing workflow.
- Put the result back. Connect the edited result and the crop information to Restore Crop.
The crop information matters: it tells the restore node where the edited piece belongs. Different information outputs—such as BOX, BBOX, IMAGE_BOUNDS, SEAM, and STITCH3—use different conventions and cannot simply be swapped.
Many recommended nodes also offer modes. A mode changes how a node performs a task without making you search for a different starting node. For instance, Image Concat Multi can arrange images in a strip or a grid.
To explore the basics without a model, open the CPU image-tools example. It creates a solid-color image, resizes it, places images in a grid, converts the result to RGB, and saves it. The quick start guide shows more connection patterns.
ComfyUI_Swwan Features
Resize and compose images
| What you want to do | Recommended node | Choices that matter |
|---|---|---|
| Resize to a size or proportion | Resize Image | Use standard for ordinary size rules or aspect_ratio for proportion presets. edit_size and essentials provide migrated sizing algorithms. |
| Set a total image-area budget | Image Resize By Megapixels | Resize according to a megapixel limit rather than choosing both dimensions yourself. |
| Keep dimensions within limits | Image Resize Range | Set minimum or maximum size constraints. It can also accept only a mask. |
| Blend layers or combine with a mask | Image Blend | Use its default mode for layer blending; mask_composite adds size matching, mask expansion or contraction, and blur. |
| Arrange multiple images | Image Concat Multi | strip creates a row or column-style strip, grid arranges multiple inputs, and batch_grid arranges images from the first input’s batch. |
Image Pad For Outpaint Masked (Swwan) prepares an image and mask for outpainting—extending a scene beyond its current edges. In directional mode, you can specify padding in pixels or percentages. Left and right percentages use the original image width; top and bottom percentages use its height. alignment controls size alignment, and feathering softens the mask edge with Gaussian blur. Directional mode handles a single RGB image. The default legacy mode preserves the earlier pixel-padding and batch behavior. If all four padding values are zero while alignment is enabled, the original outpainting algorithm may crop dimensions down to meet that alignment.
Prepare masks and local edits
- Mask Crop and Restore Crop help you edit a selected area and return it to the original image. Use
boundsfor a conventional boundary crop. Useedit_regionfor a local-edit workflow: connect the cropped image and the final native mask output to your editing chain, then connectSEAMto Restore Crop. Restore Crop also needs the original image andBOX.edit_regionprocesses only the first image in a batch;boundsretains its existing batch rules. - Mask Process cleans masks, fills holes, applies thresholds, grows or shrinks areas, and blurs edges. Its modes retain their respective algorithms, so changing modes can change the shape or softness of a selection.
- Mask Combine performs mask operations and helps with framing and alignment.
- Mask Analyze reports an area’s size, position, and coverage.
- Mask Segments converts between
MASKandSEGSand can sort or filter regions. - Blockify Mask turns a mask into blocks.
- Image Matte uses a mask you already have to produce transparent RGBA, color-filled RGB, and a mask output.
These mask-specific tools do not run detection or segmentation models. They work with masks or regions already available in your workflow.
Color, transparency, batches, and saving
ColorImage generates a solid-color image; Color Converter converts color representations and can output COLORCODE; Images to RGB produces RGB images. Additional color tasks, including Color Match and Color Shift Fix, are available among the specialized nodes under Swwan/Advanced/<task>.
Image List to Image Batch, Image Batch to Image List, and Get Image Range From Batch help organize several images. A list can contain images of different sizes, but images in a tensor batch must have matching dimensions. If a list-to-batch conversion fails, resize the images to a common size or keep them as a list.
For transparency, RGBA Safe Pre and RGBA Safe Post work together to handle actual alpha—the value that describes how opaque each pixel is. RGBA Save provides a dedicated PNG-saving path. Be careful when connecting a mask from ComfyUI’s Load Image: that mask is 1 - alpha, not actual alpha. Choosing the wrong interpretation can make your transparent and opaque areas appear reversed. The RGBA guide explains straight versus premultiplied RGB and the relevant saving choices. The CPU transparency example demonstrates saving with actual alpha without a model.
Save Image supports multiple formats, paths, metadata, subtitles, and workflow JSON. Relative paths are based on ComfyUI’s output directory; absolute paths are used as provided. Each directory is numbered independently to avoid overwriting existing images or same-named subtitle and JSON files. The node outputs a list of absolute paths, and files saved inside ComfyUI’s output directory can appear in the UI preview. PNG, WebP, and TIFF can preserve alpha; JPEG and BMP flatten transparency against a background color.
Workflow controls and specialized tools
Math Expression performs safe expression-based calculations, Any Boolean Switch selects an input based on a condition, and Seed offers random, increasing, decreasing, and previous-seed behavior. These can help you vary or repeat parts of a creative workflow.
More focused tools for bounding boxes, image bounds, video, and model patches live under Swwan/Advanced/<task>. Swwan/Legacy preserves historical interfaces; Swwan/Experimental includes experimental device features. Consult the node catalog before substituting an advanced or older node into an existing workflow.
ComfyUI_Swwan Models and Example Workflows
The core image and mask tools do not come with a set of AI models. ComfyUI_Swwan does not automatically download models. Model-dependent examples need their own documented models and, in some cases, other ComfyUI components. The device and model features guide covers hardware-specific features such as RTX VSR and SageAttention.
These examples show how the tools can fit into larger art workflows:
| Example | What it demonstrates | What to know before using it |
|---|---|---|
| CPU image tools | Solid-color image, resizing, grid assembly, RGB conversion, and saving | No AI model required. |
| CPU transparent image | Working with and saving actual alpha | No AI model required. |
| Qwen 2.1 Pruna v5 expanded guide and overview workflow | A node-by-node view of a multitask workflow, with nine separate task UI/API workflows | Static and CPU checks are documented; browser and L20 acceptance remain outstanding. Do not treat it as verified GPU output. |
| Qwen 2.1 Pruna v4 guide, UI workflow, and API workflow | Historical multitask workflow covering editing, outpainting, cutouts, watermark or object removal, BFS, photorealistic work, and multiple angles | Task-specific encoding, color correction, BFS detection, and other functions still require the external dependencies and models listed in its guide. |
| Qwen2511 removal workflow | A removal workflow with image-processing nodes migrated to Swwan | Still requires its corresponding model, QwenEditUtils, and inference environment. |
| Qwen face/head workflow | A face/head workflow with image and mask nodes migrated to Swwan | Other components and models—including segmentation, pose, alignment, loop-control, and color tools—remain necessary; see the integration notes. |
The Qwen 2.1 Turbo unified workflow guide describes cropping and alignment, shared LoRA and prompt handling, and a workflow for up to six face swaps. For removal and color restoration, see the expanded Turbo removal guide and workflow and the normal/enhanced removal modes. Their documented behavior and requirements are specific to those workflows, not a promise that every Swwan image tool needs a model.
What’s New with ComfyUI_Swwan
A complete version-by-version history is available in the changelog. The provided documentation highlights these changes:
- Version 1.0.0 assigned distinct IDs to nodes with overlapping names. This avoids registering aliases that conflict with the original plugins. For you, the important consequence is that a similar-looking node name does not mean an old saved node ID will work unchanged. See the migration guide.
- Recommended entry nodes and mode choices simplify new workflows. Rather than choosing among several similar historical nodes, you can start with the recommended node and select the behavior suited to your task. Historical interfaces remain available for compatibility.
- Qwen 2.1 Pruna v5 provides an expanded workflow for inspection. Its guide and overview expose the steps for review and include nine separate task UI/API workflows, without Pruna task wrappers, hidden subgraphs, or Set/Get. v4 remains available for historical comparison. The documented validation is limited to static and CPU checks so far.
- Dedicated removal workflows document further choices. The Turbo removal guide describes a dynamic budget of 512–1920 based on native crop area and displays native dimensions and the applied budget; older node defaults retain fixed-budget behavior. The normal/enhanced modes guide describes a default normal mode using 40% green and an enhanced mode using 100% green blockification and an expanded restore region.
Troubleshooting ComfyUI_Swwan
Start by checking the installation checklist and project review when you need to distinguish a setup issue from a feature that has not been fully validated. CPU image and mask checks do not, by themselves, verify CUDA, RTX, detection models, or Qwen generation results.
| Problem | What to do |
|---|---|
You cannot find (Swwan) nodes. | 1. Search for Swwan in the node menu. 2. Confirm the extension is in ComfyUI/custom_nodes/ComfyUI_Swwan. 3. Check ComfyUI’s startup log for errors and confirm it uses the expected Python environment. 4. Restart ComfyUI and refresh your browser. |
| Controls look outdated or display incorrectly after an update. | 1. Refresh the browser. 2. If needed, force-refresh it to clear cached scripts. 3. Check whether the /extensions/ComfyUI_Swwan/ scripts loaded successfully in your browser’s network tools. |
| An old workflow reports missing nodes. | 1. Identify the old node ID and which plugin supplied it. 2. Review the node catalog and migration guide. 3. Use the migration tool’s dry-run to inspect proposed changes before saving anything. 4. Keep the original plugin for unrelated model or control nodes that Swwan does not replace. |
| A node reports a missing library. | 1. Read the error to identify the library and feature. 2. Add it to the same Python environment that starts ComfyUI. 3. Restart ComfyUI. Some modes need optional libraries: Color Match’s color_matcher mode needs color-matcher; modes such as mean_std use kornia. Hardware-specific features have further requirements in the advanced guide. |
| A mask or transparent result is reversed. | 1. Check whether the input is an editing mask, Load Image’s 1 - alpha mask, or actual alpha from RGBA Safe Pre. 2. Adjust inversion or the saving choice accordingly. 3. Compare your connections with the RGBA guide and transparency example. |
| Converting a list to a batch fails. | 1. Make sure the list is not empty. 2. Check that all images have the same dimensions. 3. Resize them consistently before conversion, or continue using a list. |
| A local edit affects only the first batch image. | This is expected in Mask Crop’s edit_region mode. Process images one at a time if each needs its own local edit, or use bounds where its batch behavior suits your task. |
Frequently asked questions
Do I need another image-tool plugin for the features provided here?
The corresponding image-processing capabilities in this extension do not require installing KJNodes, LayerStyle, rgthree, or 孤海 as original plugins. A larger example workflow may still depend on other third-party model or control nodes; check its own guide.
Why did replacing a missing node with a similarly named Swwan node not fix my workflow?
Saved workflows refer to node IDs, not just the names you see in search. In version 1.0.0, overlapping names were given distinct IDs. Check the migration guide rather than assuming the ports or saved IDs match.
Will a PNG always retain transparency?
PNG can retain alpha, but the result also depends on whether your workflow supplies the correct transparency information and RGB interpretation. Start with the CPU transparency example and consult the RGBA guide.
Does a working CPU example confirm that a Qwen or RTX workflow will work?
No. CPU examples are useful checks for the image and mask tools. Model-dependent and hardware-specific workflows have additional requirements and separate validation status; see the hardware validation notes.
Learn More about ComfyUI_Swwan
- Choose and connect nodes: Quick start · Node catalog
- Understand transparent images: RGBA guide · CPU transparency example
- Adapt an older workflow: Migration guide · Face/head integration notes
- Explore model-dependent art workflows: Qwen 2.1 Pruna v5 expanded guide · Qwen 2.1 Pruna v4 guide · Qwen 2.1 Turbo unified guide
- Check feature requirements and validation: Device and model features · Project review · Hardware validation
- See recorded changes: Changelog
