Workflow:AUTOMATIC1111 Stable diffusion webui Image postprocessing and upscaling
| Knowledge Sources | |
|---|---|
| Domains | Image_Enhancement, Upscaling, Face_Restoration, Post_Processing |
| Last Updated | 2026-02-08 08:00 GMT |
Overview
End-to-end process for enhancing generated or existing images through upscaling, face restoration, and other post-processing operations via the Extras tab.
Description
This workflow handles image post-processing outside of the generation pipeline. Users submit one or more images to the Extras tab, where a configurable chain of post-processing scripts is applied. The primary operations are image upscaling (using neural network upscalers such as ESRGAN, Real-ESRGAN, SwinIR, ScuNET, DAT, HAT, or LDSR) and face restoration (using CodeFormer or GFPGAN). Two upscalers can be blended together with a configurable ratio. The pipeline supports single image, batch upload, and batch directory modes.
Usage
Execute this workflow when you have generated images that need quality improvement, particularly upscaling to higher resolution or face detail enhancement. Use this instead of regenerating at higher resolution when you want to preserve the exact composition of an existing image.
Execution Steps
Step 1: Input selection
Select the processing mode: single image (from gallery or upload), batch of uploaded files, or batch from a directory path. For directory batch mode, specify the input and output directories. The system loads each image along with any existing PNG metadata for preservation in the output.
Key considerations:
- Single image mode accepts images from the generation gallery or direct upload
- Directory batch mode processes all supported image files in the specified folder
- PNG metadata from the original image is preserved and passed through to the output
- Batch upload mode has a configurable limit on the number of displayed results
Step 2: Upscaler configuration
Select the primary upscaler model and scale factor. Available upscalers include: None (pass-through), Lanczos (classical), ESRGAN (4x), Real-ESRGAN (multiple variants for photos and anime), SwinIR, ScuNET, DAT, HAT, and LDSR. Optionally configure a second upscaler with a visibility blend ratio to combine the strengths of two different models. Set the target scale factor (1x to 8x) or specify exact output dimensions.
Key considerations:
- Different upscalers excel at different content types (photos vs anime vs general)
- Blending two upscalers can reduce artifacts specific to either model
- LDSR produces high-quality results but is significantly slower than other options
- Scale factor applies to both width and height of the input image
Step 3: Face restoration configuration
Optionally enable face restoration using CodeFormer or GFPGAN. Both models detect faces in the image, process them through a dedicated restoration network, and composite the restored face back into the image. CodeFormer supports a fidelity weight parameter that balances between quality and faithfulness to the original face. GFPGAN uses a visibility parameter to blend between the original and restored face.
Key considerations:
- CodeFormer generally produces higher quality results than GFPGAN
- Lower CodeFormer fidelity weight produces sharper faces but may alter identity
- Face restoration is applied after upscaling
- Both models use face detection (dlib-based) to locate faces before processing
Step 4: Post-processing execution
Execute the configured post-processing pipeline. The system processes each image through the chain of selected operations: first upscaling (applying primary upscaler, then blending with secondary upscaler if configured), then face restoration. Each postprocessing script in the pipeline receives the image and applies its transformation sequentially. Progress is reported through the UI progress bar.
Key considerations:
- Processing is sequential per image but the pipeline handles one image at a time
- GPU memory is shared between upscaler models and the main Stable Diffusion model
- Large images may require tiled processing to avoid out-of-memory errors
- Upscaler models are loaded on demand and cached for subsequent uses
Step 5: Output saving
Save the processed images with metadata. Original PNG generation parameters are preserved and augmented with post-processing information. For directory batch mode, manage caption files (prepend, append, copy, or ignore existing captions). Output images are saved to the configured output directory or displayed in the gallery for single-image mode.
Key considerations:
- Original generation metadata is preserved in the output PNG
- Caption handling is configurable for training dataset preparation workflows
- Output filenames can follow the original naming or auto-naming patterns
- Processed images appear in the Extras output gallery