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 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-wildcard-lightning" # Request payload data = { "prompt": "instagram photo, upper body photo of 18 years old Annika, pouted mouth, dressed in dirndl, traditional bavarian dress, corsage, long gold blond hair, (put-up hairdo), pale skin, happy, standing on a farm, soft, beautiful eyes, hard shadows, warm, sunrise, dimm light", "negative_prompt": "(octane render, render, drawing, anime, 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", "samples": 1, "scheduler": "DPM++ SDE", "num_inference_steps": 9, "guidance_scale": 1, "seed": 3290939592, "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
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


promptstr *

Prompt to render


negative_promptstr ( default: None )

blur, noisy, disfigured


samplesint ( default: 1 ) Affects Pricing

Number of samples to generate.

min : 1,

max : 4


schedulerenum:str ( default: DPM++ SDE )

Type of scheduler.

Allowed values:


num_inference_stepsint ( default: 9 ) Affects Pricing

Number of denoising steps.

min : 1,

max : 100


guidance_scalefloat ( default: 1.4 )

Scale for classifier-free guidance

min : 1,

max : 25


seedint ( default: -1 )

Seed for image generation.

min : -1,

max : 999999999999999


img_widthenum:int ( default: 1024 ) Affects Pricing

Can only be 1024 for SDXL

Allowed values:


img_heightenum:int ( default: 1024 ) Affects Pricing

Can only be 1024 for SDXL

Allowed values:


base64boolean ( default: 1 )

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.

WildCard Lightning SDXL

The WildCard Lightning SDXL model represents a cutting-edge innovation tailored to produce top-tier, photorealistic images seamlessly from textual descriptions. A standout feature of the WildCard Lightning SDXL is its remarkable speed and efficiency in generating high-quality images swiftly. This accelerated model is adept at crafting stunning 1024px images with ease, making it a valuable asset for applications that demand rapid image production without compromising on quality.

Maximizing the performance of the WildCard Lightning SDXL entails ensuring compatibility with the DPM++ SDE Karras / DPM++ SDE sampler. To achieve optimal results, it is recommended to utilize 4-6 sampling steps along with a CFG Scale ranging from 1 to 2. These specific settings are instrumental in facilitating an effective and efficient image generation process, empowering users to fully harness the capabilities of this sophisticated model.

In essence, the WildCard Lightning SDXL stands as a powerful solution for swiftly creating high-quality, photorealistic images. Its advanced features and seamless integration with specific sampling settings make it an invaluable tool for various applications that prioritize both speed and excellence in image creation.