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
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/sdxl1.0-dyanvis-lightning"
# Request payload
data = {
"prompt": "a very close up, beautiful woman dressed in a velure dress, very happy",
"negative_prompt": "(worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth",
"samples": 1,
"scheduler": "DPM++ SDE",
"num_inference_steps": 8,
"guidance_scale": 1,
"seed": 84865431,
"img_width": 1024,
"img_height": 1024,
"base64": False
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
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.
The Dynavis Lightning SDXL model represents a groundbreaking advancement in the realm of image generation, specializing in producing stylized 3D model outputs reminiscent of the captivating computer graphics animations seen in renowned studios like Pixar, Dreamworks, Disney Studios, and Nickelodeon. This innovative model is engineered to deliver exceptional quality and creativity in its visual representations.
Distinguished by its focus on stylized 3D model outputs, the Dynavis Lightning SDXL is geared towards creating visually striking and artistically stylized images, this model sets a new standard for excellence in the realm of computer-generated animations. A standout feature of the Dyanvis Lightning SDXL is its ability to swiftly and efficiently generate high-quality 3D model outputs, catering to applications that demand rapid and stylized image production. With the capability to produce intricate and detailed 3D models akin to those seen in top animation studios, this model offers a unique blend of speed and artistic flair.
To optimize the performance of the Dynavis Lightning SDXL, it is essential to ensure compatibility with the DPM++ SDE Karras / DPM++ SDE sampler. Leveraging 4-6 sampling steps and a CFG Scale ranging from 1 to 2 is recommended to achieve peak performance and efficiency in the image generation process. These tailored settings are crucial for unlocking the full creative potential of this cutting-edge model.