Description
This is a massive ComfyUI workflow that helps to improve and simplify detailing and upscaling of stable diffusion images by enabling easy and automatic masking along with prompt refinement for multiple characters at once, allowing users to do highly selective inpainting/detailing/upscaling without need for any manual masking, and minimal prompting.
Features:
- Automatic segmentation and masking for SFW content using natural language with SAM3.
- Automatic detection and bounding of NSFW anatomy using YOLO models.
- Supports detailing up to four characters simultaneously.
- Supports up to 3 LORAs per character/detailer pass combination.
- Universal LORA and Upscaler LORA.
- Centralized control of key functions across all characters and/or body parts: Sampler, Steps, CFG, Denoise Levels and more.
- Automatic prompt enhancement based on characteristics of the subject. (Generated with Gemma4)
- Previews for every step of refinement, allowing for easy pinpointing if something goes wrong.
- Up to 6 refinement passes per character: full body, face and hair, clothing, breasts, genitals, and feet.
Uses
The workflow primarily enhances the fine details and overall quality of stable diffusion images. It does not do full face swap or clothing swap workflows very well - it tends to perform quite poorly at high denoise levels.
Bias, Risks, and Limitations
Currently, the prompt enhancement logic is pretty cisnormative and heteronormative. This may be improved on in a future release by adding more subject characteristic flags, but the prompt enhancment logic is already kinda complicated. For the time being, for generating trans or gender nonconforming characters, consider disabling the prompt enhancement block and prompt for those manually.
Also, the prompt enhancement assumes a photographic style.
How to Get Started with the Model
Simply drag and drop the JSON file into ComfyUI! Download the detection models, and place SAM3 in models\sam3, and the YOLO models in models\ultralytics\bbox.
Read the notes in the workflow for an explanation of what everything does. SAM3 understands "far left", "middle left", "middle right", and "far right", in combination with some description of the person's clothing or hair. So combine that with "the person on", "the face and hair of the person on", "the clothing worn by the person on", and so on.
The workflow takes about 4-6 minutes to run for four characters on an RTX4080, so you'll want to use it to improve base gens that you're already otherwise happy with.
Credits:
Big thanks to catlover1937. This workflow is a massive expansion and adaptation of the "Face Detailer" and "SD Upscale" sections of their excellent (and much more reasonable in scale) ZIB + ZIT Simple Workflow. This workflow would not have come into existence without that essential DNA to work from.
Description
Minor but helpful changes to this version:
The operation order has been changed so the workflow does the full body and clothing passes first, then upscales, then does the remaining detail passes on all the characters. This significantly improves the smaller detail areas and helps to prevent visible square-shaped seams on the BBOX detailers.
The upscale prompt had its "optional" title removed. You should really add the main prompt there, it helps to keep it from screwing up the lighting and color grading.
Rewired a few image transmission links to account for the new workflow order.

