API
If you're looking for an API, you can choose from your desired programming language.
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
Attributes
Sets the random seed for reproducibility. Use any integer for consistent results or leave blank to randomize.
Input a low-quality image for enhancement. Provide a direct image URL for best results.
Adjusts guidance scale for prompts. Default is 7.5; increase for strong guidance, reduce for subtler effects.
min : 1,
max : 20
Original churn hyperparameter of EDM. Default is 5; modify to experiment with stabilization effects.
Regulates noise level within EDM. Start at 1.003; adjust for noise reduction or amplification.
Controls upsampling ratio. Use default 1 for no change or increase for higher resolution.
Positive prompt to enhance image detail. Suggested: 'Cinematic, High Contrast, ultra HD, detailed.'
Sets minimum output image resolution. Default is 1024; increase for larger outputs.
Negative prompt to avoid artifacts. Use 'worst quality, low quality' for better outcomes.
Sets Stage1 control strength. Default is -1; use positive for activation.
Sets Stage2 control strength. Default is 1; adjust for different intensities.
Determines number of EDM sampling steps. Default is 50; adjust for finer control.
min : 1,
max : 500
Utilizes LLaVA model for captions. Default is true; enable as needed.
Increases CFG linearly with sigma. Default is false; use for advanced control.
Choose between models: SUPIR-v0Q and SUPIR-v0F. Default is SUPIR-v0Q.
Allowed values:
Select color fix: None, AdaIn, or Wavelet. Default is Wavelet for optimal balance.
Allowed values:
Start point for increasing CFG linearly. Default is 1; adjust as required.
Increases s_stage2 linearly with sigma. Default is false; enable for gradual adjustment.
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
- Provide a high-quality URL or local path for the
image
input. - Choose your
model_name
:- SUPIR-v0Q (default): Balanced quality vs. speed
- SUPIR-v0F: Highest fidelity at the cost of extra compute
- Adjust general parameters (see below).
- 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
-
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”
-
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”
-
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)
-
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
orlinear_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.
Other Popular Models
sdxl-img2img
SDXL Img2Img is used for text-guided image-to-image translation. This model uses the weights from Stable Diffusion to generate new images from an input image using StableDiffusionImg2ImgPipeline from diffusers

fooocus
Fooocus enables high-quality image generation effortlessly, combining the best of Stable Diffusion and Midjourney.

sdxl1.0-txt2img
The SDXL model is the official upgrade to the v1.5 model. The model is released as open-source software

sd1.5-epicrealism
This model corresponds to the Stable Diffusion Epic Realism checkpoint for detailed images at the cost of a super detailed prompt
