face-upscaling-and-seamless-embedding
FUSE KSampler is a face-aware KSampler node for ComfyUI that provides seamless face upscaling and embedding capabilities using YOLO face detection and SAM (Segment Anything Model) for precise masking.
Package profile
- Status
- Verified
- Publisher
- @WASasquatch
- Source
- GitHub
README
Face Upscaling and Seamless Embedding (FUSE)
FUSE is an All-in-One Face Fix KSampler for ComfyUI that provides seamless face upscaling and embedding capabilities using YOLO face detection and SAM (Segment Anything Model) for precise masking.
Before and After Examples
Installation
Navigate to your ComfyUI's custom nodes
cd custom_nodes
Clone FUSE nodes.
git clone https://github.com/WASasquatch/face-upscaling-and-seamless-embedding
Navigate to the FUSE directory
cd face-upscaling-and-seamless-embedding
Install dependencies to your Python Environment used by ComfyUI
pip install -r requirements.txt
Models
YOLO Face Models
You'll need to download some YOLO Face models. You can find some from:
- https://github.com/akanametov/yolo-face
- https://github.com/Fuyucch1/yolov8_animeface/releases/tag/v1 (Anime Face)
Models should be placed in the models/yolo-face/ directory.
YOLO Models
You'll need to download some YOLO models. You can find some from:
- https://github.com/akanametov/yolo-face
- https://github.com/Fuyucch1/yolov8_animeface/releases/tag/v1 (Anime Face)
Models should be placed in the models/yolo/ directory.
SAM Models
You'll also need to download some SAM models. You can find official models from:
Models should be placed in the models/sams/ directory.
Nodes
FUSEKSampler
Advanced face-aware sampling node that combines YOLO face detection, SAM segmentation, and seamless blending. Features include:
- Intelligent face detection and cropping with adjustable padding and size
- Optional square crop enforcement for consistent face processing
- Multiple blending modes (box/radial) with configurable strength
- SAM-based precise face masking
- Color preservation options using various transfer methods (LAB, PDF, mean-std)
- Internal caching system for faster workflow iteration
- Support for processing specific faces using face index
| Parameter | Description | Type | Default | Value Range |
|---|---|---|---|---|
| model | Base model for sampling | MODEL | Required | N/A |
| vae | VAE model for the sampler | VAE | Required | N/A |
| images | Input image batch for face detection and upscaling | IMAGE | Required | N/A |
| positive | Positive conditioning for the sampler | CONDITIONING | Required | N/A |
| negative | Negative conditioning for the sampler | CONDITIONING | Required | N/A |
| use_cache | Use internal caching to speed up workflow iteration | BOOLEAN | True | True/False |
| seed | Seed for deterministic results | INT | 0 | ≥ 0 |
| steps | Number of steps for the sampler | INT | 20 | ≥ 1 |
| cfg | Classifier-Free Guidance scale | FLOAT | 8.0 | Any float value |
| sampler_name | Name of the sampler | STRING | (from KSampler) | Available KSampler options |
| scheduler | Scheduler type | STRING | (from KSampler) | Available KSampler schedulers |
| denoise | Denoising strength (lower values adhere more to input face) | FLOAT | 0.5 | 0.0 - 1.0 |
| yolo_detector | YOLO model for face detection | STRING | Required | Available YOLO face models |
| yolo_confidence | YOLO confidence threshold (higher values detect only more confident faces) | FLOAT | 0.25 | 0.0 - 1.0 |
| yolo_nms_iou | YOLO NMS IoU threshold (lower values remove more overlapping detections) | FLOAT | 0.5 | 0.0 - 1.0 |
| sam_segmenter | SAM model for face segmentation | STRING | Required | Available SAM models |
| sam_model_type | SAM model type | STRING | "vit_b" | "vit_b", "vit_l", "vit_h" |
| face_id | Index of the face to process (0 is first face, -1 is all faces) | INT | 0 | ≥ -1 |
| face_order | Order to process detected faces | STRING | "linear" | "linear", "linear_reve |
Nodes in this pack
5 nodes
Nodes in this pack
5 nodes- FUSEGenericKSampler
- FUSEKSampler
- FUSESamplerMaskOptions
- FUSEVideoKSampler
- FUSEYOLOSettings
Sources
3 sources
Sources
3 sourcesVerified Oct 13
Verified Oct 13
Source excerpts
1 excerpt
Source excerpts
1 excerptSource context: Repo WASasquatch/face-upscaling-and-seamless-embedding
