zsxkib/diffbir
✨DiffBIR: Towards Blind Image Restoration with Generative Diffusion Prior
Capabilities
Cost
Community model (estimated from hardware time)
Input Parameters
| Name | Type | Description | Default | Constraints |
|---|---|---|---|---|
input* | string(uri) | Path to the input image you want to enhance. | — | — |
background_upsampler | string | For 'faces' mode: Model used to upscale the background in images where the primary subject is a face. | "RealESRGAN" | DiffBIRRealESRGAN |
background_upsampler_tile | integer | For 'faces' mode: Size of each tile used by the background upsampler when dividing the image into patches. | 400 | — |
background_upsampler_tile_stride | integer | For 'faces' mode: Distance between the start of each tile when the background is divided for upscaling. A smaller stride means more overlap between tiles. | 400 | — |
color_fix_type | string | Method used for color correction post enhancement. 'wavelet' and 'adain' offer different styles of color correction, while 'none' skips this step. | "wavelet" | waveletadainnone |
disable_preprocess_model | boolean | Disables the initial preprocessing step using SwinIR. Turn this off if your input image is already of high quality and doesn't require restoration. | false | — |
face_detection_model | string | For 'faces' mode: Model used for detecting faces in the image. Choose based on accuracy and speed preferences. | "retinaface_resnet50" | retinaface_resnet50retinaface_mobile0.25YOLOv5lYOLOv5ndlib |
guidance_repeat | integer | For 'general_scenes': Number of times the guidance process is repeated during enhancement. | 5 | — |
guidance_scale | number | For 'general_scenes': Scale factor for the guidance mechanism. Adjusts the influence of guidance on the enhancement process. | 0 | — |
guidance_space | string | For 'general_scenes': Determines in which space (RGB or latent) the guidance operates. 'latent' can often provide more subtle and context-aware enhancements. | "latent" | rgblatent |
guidance_time_start | integer | For 'general_scenes': Specifies when (at which step) the guidance mechanism starts influencing the enhancement. | 1001 | — |
guidance_time_stop | integer | For 'general_scenes': Specifies when (at which step) the guidance mechanism stops influencing the enhancement. | -1 | — |
has_aligned | boolean | For 'faces' mode: Indicates if the input images are already cropped and aligned to faces. If not, the model will attempt to do this. | false | — |
only_center_face | boolean | For 'faces' mode: If multiple faces are detected, only enhance the center-most face in the image. | false | — |
reload_restoration_model | boolean | Reload the image restoration model (SwinIR) if set to True. This can be useful if you've updated or changed the underlying SwinIR model. | false | — |
repeat_times | integer | Number of times the enhancement process is repeated by feeding the output back as input. This can refine the result but might also introduce over-enhancement issues. | 1 | min: 1, max: 10 |
restoration_model_type | string | Select the restoration model that aligns with the content of your image. This model is responsible for image restoration which removes degradations. | "general_scenes" | facesgeneral_scenes |
seed | integer | Random seed to ensure reproducibility. Setting this ensures that multiple runs with the same input produce the same output. | 231 | — |
steps | integer | The number of enhancement iterations to perform. More steps might result in a clearer image but can also introduce artifacts. | 50 | min: 1, max: 100 |
super_resolution_factor | integer | Factor by which the input image resolution should be increased. For instance, a factor of 4 will make the resolution 4 times greater in both height and width. | 4 | min: 1, max: 4 |
tile_size | integer | Size of each tile (or patch) when 'tiled' option is enabled. Determines how the image is divided during patch-based enhancement. | 512 | — |
tile_stride | integer | Distance between the start of each tile when the image is divided for patch-based enhancement. A smaller stride means more overlap between tiles. | 256 | — |
tiled | boolean | Whether to use patch-based sampling. This can be useful for very large images to enhance them in smaller chunks rather than all at once. | false | — |
upscaling_model_type | string | Choose the type of model best suited for the primary content of the image: 'faces' for portraits and 'general_scenes' for everything else. | "general_scenes" | facesgeneral_scenes |
use_guidance | boolean | Use latent image guidance for enhancement. This can help in achieving more accurate and contextually relevant enhancements. | false | — |
inputrequiredstringPath to the input image you want to enhance.
background_upsamplerstringFor 'faces' mode: Model used to upscale the background in images where the primary subject is a face.
"RealESRGAN"background_upsampler_tileintegerFor 'faces' mode: Size of each tile used by the background upsampler when dividing the image into patches.
400background_upsampler_tile_strideintegerFor 'faces' mode: Distance between the start of each tile when the background is divided for upscaling. A smaller stride means more overlap between tiles.
400color_fix_typestringMethod used for color correction post enhancement. 'wavelet' and 'adain' offer different styles of color correction, while 'none' skips this step.
"wavelet"disable_preprocess_modelbooleanDisables the initial preprocessing step using SwinIR. Turn this off if your input image is already of high quality and doesn't require restoration.
falseface_detection_modelstringFor 'faces' mode: Model used for detecting faces in the image. Choose based on accuracy and speed preferences.
"retinaface_resnet50"guidance_repeatintegerFor 'general_scenes': Number of times the guidance process is repeated during enhancement.
5guidance_scalenumberFor 'general_scenes': Scale factor for the guidance mechanism. Adjusts the influence of guidance on the enhancement process.
0guidance_spacestringFor 'general_scenes': Determines in which space (RGB or latent) the guidance operates. 'latent' can often provide more subtle and context-aware enhancements.
"latent"guidance_time_startintegerFor 'general_scenes': Specifies when (at which step) the guidance mechanism starts influencing the enhancement.
1001guidance_time_stopintegerFor 'general_scenes': Specifies when (at which step) the guidance mechanism stops influencing the enhancement.
-1has_alignedbooleanFor 'faces' mode: Indicates if the input images are already cropped and aligned to faces. If not, the model will attempt to do this.
falseonly_center_facebooleanFor 'faces' mode: If multiple faces are detected, only enhance the center-most face in the image.
falsereload_restoration_modelbooleanReload the image restoration model (SwinIR) if set to True. This can be useful if you've updated or changed the underlying SwinIR model.
falserepeat_timesintegerNumber of times the enhancement process is repeated by feeding the output back as input. This can refine the result but might also introduce over-enhancement issues.
1min: 1, max: 10restoration_model_typestringSelect the restoration model that aligns with the content of your image. This model is responsible for image restoration which removes degradations.
"general_scenes"seedintegerRandom seed to ensure reproducibility. Setting this ensures that multiple runs with the same input produce the same output.
231stepsintegerThe number of enhancement iterations to perform. More steps might result in a clearer image but can also introduce artifacts.
50min: 1, max: 100super_resolution_factorintegerFactor by which the input image resolution should be increased. For instance, a factor of 4 will make the resolution 4 times greater in both height and width.
4min: 1, max: 4tile_sizeintegerSize of each tile (or patch) when 'tiled' option is enabled. Determines how the image is divided during patch-based enhancement.
512tile_strideintegerDistance between the start of each tile when the image is divided for patch-based enhancement. A smaller stride means more overlap between tiles.
256tiledbooleanWhether to use patch-based sampling. This can be useful for very large images to enhance them in smaller chunks rather than all at once.
falseupscaling_model_typestringChoose the type of model best suited for the primary content of the image: 'faces' for portraits and 'general_scenes' for everything else.
"general_scenes"use_guidancebooleanUse latent image guidance for enhancement. This can help in achieving more accurate and contextually relevant enhancements.
false51ed1464d8bbUpdated: 7/25/2026138.3K runs
cinemasetfree.com