Supir Photo-Realistic Image Restoration

SUPIR restores and enhances images to stunning, photo-realistic quality with advanced AI techniques.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 import requests api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/supir" # Prepare data and files data = {} files = {} data['seed'] = None # For parameter "image", you can send a raw file or a URI: # files['image'] = open('IMAGE_PATH', 'rb') # To send a file data['image'] = 'https://segmind-resources.s3.amazonaws.com/input/557ae4e3-8057-4668-bf41-ff836d0f73b0-test_upscale_1234142.jpg' # To send a URI data['s_cfg'] = 7.5 data['s_churn'] = 5 data['s_noise'] = 1.003 data['upscale'] = 1 data['a_prompt'] = "Cinematic, High Contrast, ultra HD, hyper detailed." data['min_size'] = 1024 data['n_prompt'] = "worst quality, low quality, frames, watermark." data['s_stage1'] = -1 data['s_stage2'] = 1 data['edm_steps'] = 50 data['use_llava'] = True data['linear_CFG'] = False data['model_name'] = "SUPIR-v0Q" data['color_fix_type'] = "Wavelet" data['spt_linear_CFG'] = 1 data['linear_s_stage2'] = False data['spt_linear_s_stage2'] = 0 headers = {'x-api-key': api_key} # If no files, send as JSON if files: response = requests.post(url, data=data, files=files, headers=headers) else: response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


seedint ( default: 1 )

Sets the random seed for reproducibility. Use any integer for consistent results or leave blank to randomize.


imagestr *

Input a low-quality image for enhancement. Provide a direct image URL for best results.


s_cfgfloat ( default: 7.5 )

Adjusts guidance scale for prompts. Default is 7.5; increase for strong guidance, reduce for subtler effects.

min : 1,

max : 20


s_churnfloat ( default: 5 )

Original churn hyperparameter of EDM. Default is 5; modify to experiment with stabilization effects.


s_noisefloat ( default: 1.003 )

Regulates noise level within EDM. Start at 1.003; adjust for noise reduction or amplification.


upscaleint ( default: 1 )

Controls upsampling ratio. Use default 1 for no change or increase for higher resolution.


a_promptstr ( default: Cinematic, High Contrast, ultra HD, hyper detailed. )

Positive prompt to enhance image detail. Suggested: 'Cinematic, High Contrast, ultra HD, detailed.'


min_sizefloat ( default: 1024 )

Sets minimum output image resolution. Default is 1024; increase for larger outputs.


n_promptstr ( default: worst quality, low quality, frames, watermark. )

Negative prompt to avoid artifacts. Use 'worst quality, low quality' for better outcomes.


s_stage1int ( default: -1 )

Sets Stage1 control strength. Default is -1; use positive for activation.


s_stage2float ( default: 1 )

Sets Stage2 control strength. Default is 1; adjust for different intensities.


edm_stepsint ( default: 50 )

Determines number of EDM sampling steps. Default is 50; adjust for finer control.

min : 1,

max : 500


use_llavabool ( default: true )

Utilizes LLaVA model for captions. Default is true; enable as needed.


linear_CFGbool ( default: 1 )

Increases CFG linearly with sigma. Default is false; use for advanced control.


model_nameenum:str ( default: SUPIR-v0Q )

Choose between models: SUPIR-v0Q and SUPIR-v0F. Default is SUPIR-v0Q.

Allowed values:


color_fix_typeenum:str ( default: Wavelet )

Select color fix: None, AdaIn, or Wavelet. Default is Wavelet for optimal balance.

Allowed values:


spt_linear_CFGfloat ( default: 1 )

Start point for increasing CFG linearly. Default is 1; adjust as required.


linear_s_stage2bool ( default: 1 )

Increases s_stage2 linearly with sigma. Default is false; enable for gradual adjustment.


spt_linear_s_stage2float ( default: 1 )

Start point for linear increase of s_stage2. Default is 0; increase for gradual transition.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Utilizing SUPIR for Superior Image Restoration and Enhancement

SUPIR (SUPer Image Restoration) is a state-of-the-art AI model designed to tackle complex image restoration and enhancement tasks with remarkable precision. By integrating Segmind's advanced AI solutions, you're well-equipped to elevate your visual content to new heights.

Key Features

SUPIR excels in photo-realistic image restoration by employing cutting-edge scaling techniques and multi-modal methodologies. The model offers several standout features that set it apart:

  • Image Enhancement and Restoration: SUPIR transforms degraded images into high-quality, photo-realistic visuals.
  • Text-Guided Restoration: This feature leverages textual prompts for versatile and specific image enhancements.
  • Super-Resolution Capabilities: SUPIR upscales low-resolution images while enhancing visual detail.
  • Noise and Artifact Reduction: It effectively cleans up images taken under poor conditions.
  • Black and White Image Enhancement: Proficient in breathing new life into historical monochrome imagery.

Practical Applications

For developers, SUPIR provides comprehensive integration options via platforms like Hugging Face and GitHub. Implement batch processing workflows for large-scale projects and maintain redundancy by preserving originals alongside enhanced images.

Creators can leverage SUPIR in workflows to restore and enhance visuals efficiently, crucial for digital art restoration or improving frames in video content. Experimentation with text prompts and context consideration is encouraged to achieve optimal results.

Executives will appreciate SUPIR's impact on ROI by offering a cost-effective, open-source alternative to proprietary solutions. The model outshines similar tools in the market, making SUPIR an excellent choice for any organization seeking superior image quality.

By effectively implementing SUPIR, you can transform the ordinary into the extraordinary, ensuring high-quality visual output for challenging image sources.

SUPIR Quickstart Guide: Effective Image Restoration & Enhancement

SUPIR (SUPer Image Restoration) is a versatile AI model designed for photo-realistic restoration, super-resolution, noise reduction, and historical B&W enhancement. This guide walks you through key parameters and recommended settings for popular use cases.

1. Core Workflow

  1. Provide a high-quality URL or local path for the image input.
  2. Choose your model_name:
    • SUPIR-v0Q (default): Balanced quality vs. speed
    • SUPIR-v0F: Highest fidelity at the cost of extra compute
  3. Adjust general parameters (see below).
  4. Launch batch jobs or single-shot runs via the Segmind API, Hugging Face, or GitHub integration.

2. Essential Parameters

  • upscale (int): Output multiplier. 1 = no change, 2 = 2Ă— resolution, etc.
  • edm_steps (int, default 50): Number of diffusion steps. Increase to 100–150 for extra detail (at longer runtime).
  • s_cfg (float, default 7.5): Guidance strength for text prompts. Higher values enforce prompts more strictly.
  • a_prompt / n_prompt: Positive and negative text hints.
    – Example a_prompt: “Cinematic, ultra HD, high contrast, extremely detailed.”
    – Example n_prompt: “low quality, artifacts, watermark, blurry.”

3. Use Case Presets

  1. General Photo Restoration

    • model_name: SUPIR-v0Q
    • upscale: 1
    • edm_steps: 50
    • s_cfg: 7.5
    • color_fix_type: Wavelet
    • a_prompt: “photo realistic, vibrant color, super detailed”
    • n_prompt: “noise, blur, artifacts”
  2. Low-Light / Noisy Shots

    • edm_steps: 75
    • s_noise: 1.005 (slightly higher for robust denoising)
    • s_churn: 4 (stabilizes heavy noise removal)
    • a_prompt: “clean, sharp, high fidelity”
    • n_prompt: “grain, excessive noise, blur”
  3. Super-Resolution (Upscaling)

    • upscale: 2 or 4 (based on target)
    • edm_steps: 100
    • s_cfg: 9–12 (stronger guidance for fine detail)
    • color_fix_type: AdaIn (for color fidelity on large scaling)
  4. Historical B&W Restoration

    • use_llava: true (auto-generates context captions)
    • color_fix_type: Wavelet
    • a_prompt: “vivid colorization, realistic skin tones, natural lighting”
    • n_prompt: “over saturation, unnatural hues”
    • edm_steps: 60

4. Advanced Tips

  • Seed control: Set seed for reproducible batches; leave blank for random diversity.
  • Linear CFG & Staged Control: Enable linear_CFG or linear_s_stage2 for gradual adjustments across diffusion sigma. Great for extreme restoration.
  • Keep originals: Always archive the source files for comparison and audit.
  • Batch scripting: Use CLI or Python SDK to iterate parameters programmatically and identify optimal configurations.

By following these presets and best practices, you can maximize SUPIR’s capabilities and achieve consistent, high-quality results across diverse image restoration challenges.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.