API
If you're looking for an API, you can choose from your desired programming language.
1import requests
2import base64
3
4# Use this function to convert an image file from the filesystem to base64
5def image_file_to_base64(image_path):
6 with open(image_path, 'rb') as f:
7 image_data = f.read()
8 return base64.b64encode(image_data).decode('utf-8')
9
10# Use this function to fetch an image from a URL and convert it to base64
11def image_url_to_base64(image_url):
12 response = requests.get(image_url)
13 image_data = response.content
14 return base64.b64encode(image_data).decode('utf-8')
15
16# Use this function to convert a list of image URLs to base64
17def image_urls_to_base64(image_urls):
18 return [image_url_to_base64(url) for url in image_urls]
19
20api_key = "YOUR_API_KEY"
21url = "https://api.segmind.com/v1/sdxl1.0-juggernaut-lightning"
22
23# Request payload
24data = {
25 "prompt": "Medium shot, Adorable creature with big reflective eyes, moody lighting, best quality, full body portrait, real picture, intricate details, depth of field, in a forest, fujifilm xt3, outdoors, bright day, beautiful lighting, raw photo, 8k uhd, film grain, unreal engine 5, ray tracing",
26 "negative_prompt": "((close up)),(octane render, render, drawing, bad photo, bad photography:1.3), (worst quality, low quality, blurry:1.2), (bad teeth, deformed teeth, deformed lips), (bad anatomy, bad proportions:1.1), (deformed iris, deformed pupils), (deformed eyes, bad eyes), (deformed face, ugly face, bad face), (deformed hands, bad hands, fused fingers), morbid, mutilated, mutation, disfigured",
27 "samples": 1,
28 "scheduler": "DPM++ SDE",
29 "num_inference_steps": 5,
30 "guidance_scale": 1,
31 "seed": 2360370499,
32 "img_width": 1024,
33 "img_height": 1024,
34 "base64": False
35}
36
37headers = {'x-api-key': api_key}
38
39response = requests.post(url, json=data, headers=headers)
40print(response.content) # The response is the generated image
Attributes
Prompt to render
blur, noisy, disfigured
Number of samples to generate.
min : 1,
max : 4
Type of scheduler.
Allowed values:
Number of denoising steps.
min : 1,
max : 100
Scale for classifier-free guidance
min : 1,
max : 25
Seed for image generation.
min : -1,
max : 999999999999999
Can only be 1024 for SDXL
Allowed values:
Can only be 1024 for SDXL
Allowed values:
Base64 encoding of the output image.
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.
Juggernaut Lightning SDXL
The Juggernaut Lightning SDXL model is designed to generate high-quality, photorealistic images from textual descriptions. The Juggernaut Lightning SDXL is fine-tuned on photorealistic images. As an accelerated version of the Juggernaut XL, this model is aimed at creating images of exceptional quality that closely mimic reality. The images produced by this model are not just visually appealing but also incredibly detailed, making them almost indistinguishable from real-life photographs. One of the key features of the Juggernaut Lightning SDXL is its ability to generate images quickly and efficiently, this model can generate high-quality 1024px images in just a few steps.
Using the Juggernaut Lightning SDXL model is straightforward. It’s compatible with the DPM++ SDE Karras / DPM++ SDE sampler, and it’s recommended to use 4-6 sampling steps and a CFG Scale of 1-2. These settings allow for optimal image generation performance.
Other Popular Models
sadtalker
Audio-based Lip Synchronization for Talking Head Video

illusion-diffusion-hq
Monster Labs QrCode ControlNet on top of SD Realistic Vision v5.1

insta-depth
InstantID aims to generate customized images with various poses or styles from only a single reference ID image while ensuring high fidelity

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.
