Input
POST https://gateway.appypie.com/sdxl_lightning/getImage/v1/getSDXLImage HTTP/1.1

Content-Type: application/json
Cache-Control: no-cache

{
    "prompt": "A mystical phoenix rising from golden flames, its fiery wings lighting up the night sky as it soars into the heavens.",
    "negativePrompt": "blurry, low quality, dull colors, unrealistic proportions, cartoonish style, dark or overcast sky, poor lighting, abstract shapes, mechanical or robotic features, unnatural textures, distorted wings, fireless flames, excessive smoke, chaotic background, overly simplistic, pixelated, low detail, unrecognizable bird, modern elements like buildings or vehicles.",
    "height": 1024,
    "width": 1024,
    "num_steps": 20,
    "guidance": 5,
    "seed": 42
}

import urllib.request, json

try:
    url = "https://gateway.appypie.com/sdxl_lightning/getImage/v1/getSDXLImage"

    hdr ={
    # Request headers
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    }

    # Request body
    data =  
    data = json.dumps(data)
    req = urllib.request.Request(url, headers=hdr, data = bytes(data.encode("utf-8")))

    req.get_method = lambda: 'POST'
    response = urllib.request.urlopen(req)
    print(response.getcode())
    print(response.read())
    except Exception as e:
    print(e)
// Request body
const body = {
    "prompt": "A mystical phoenix rising from golden flames, its fiery wings lighting up the night sky as it soars into the heavens.",
    "negativePrompt": "blurry, low quality, dull colors, unrealistic proportions, cartoonish style, dark or overcast sky, poor lighting, abstract shapes, mechanical or robotic features, unnatural textures, distorted wings, fireless flames, excessive smoke, chaotic background, overly simplistic, pixelated, low detail, unrecognizable bird, modern elements like buildings or vehicles.",
    "height": 1024,
    "width": 1024,
    "num_steps": 20,
    "guidance": 5,
    "seed": 42
};

fetch('https://gateway.appypie.com/sdxl_lightning/getImage/v1/getSDXLImage', {
        method: 'POST',
        body: JSON.stringify(body),
        // Request headers
        headers: {
            'Content-Type': 'application/json',
            'Cache-Control': 'no-cache',}
    })
    .then(response => {
        console.log(response.status);
        console.log(response.text());
    })
    .catch(err => console.error(err));
curl -v -X POST "https://gateway.appypie.com/sdxl_lightning/getImage/v1/getSDXLImage" -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data-raw "{
    \"prompt\": \"A mystical phoenix rising from golden flames, its fiery wings lighting up the night sky as it soars into the heavens.\",
    \"negativePrompt\": \"blurry, low quality, dull colors, unrealistic proportions, cartoonish style, dark or overcast sky, poor lighting, abstract shapes, mechanical or robotic features, unnatural textures, distorted wings, fireless flames, excessive smoke, chaotic background, overly simplistic, pixelated, low detail, unrecognizable bird, modern elements like buildings or vehicles.\",
    \"height\": 1024,
    \"width\": 1024,
    \"num_steps\": 20,
    \"guidance\": 5,
    \"seed\": 42
}"
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import java.io.UnsupportedEncodingException;
import java.io.DataInputStream;
import java.io.InputStream;
import java.io.FileInputStream;

public class HelloWorld {

  public static void main(String[] args) {
    try {
        String urlString = "https://gateway.appypie.com/sdxl_lightning/getImage/v1/getSDXLImage";
        URL url = new URL(urlString);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();

        //Request headers
    connection.setRequestProperty("Content-Type", "application/json");
    
    connection.setRequestProperty("Cache-Control", "no-cache");
    
        connection.setRequestMethod("POST");

        // Request body
        connection.setDoOutput(true);
        connection
            .getOutputStream()
            .write(
             "{ \"prompt\": \"A mystical phoenix rising from golden flames, its fiery wings lighting up the night sky as it soars into the heavens.\", \"negativePrompt\": \"blurry, low quality, dull colors, unrealistic proportions, cartoonish style, dark or overcast sky, poor lighting, abstract shapes, mechanical or robotic features, unnatural textures, distorted wings, fireless flames, excessive smoke, chaotic background, overly simplistic, pixelated, low detail, unrecognizable bird, modern elements like buildings or vehicles.\", \"height\": 1024, \"width\": 1024, \"num_steps\": 20, \"guidance\": 5, \"seed\": 42 }".getBytes()
             );
    
        int status = connection.getResponseCode();
        System.out.println(status);

        BufferedReader in = new BufferedReader(
            new InputStreamReader(connection.getInputStream())
        );
        String inputLine;
        StringBuffer content = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            content.append(inputLine);
        }
        in.close();
        System.out.println(content);

        connection.disconnect();
    } catch (Exception ex) {
      System.out.print("exception:" + ex.getMessage());
    }
  }
}
$url = "https://gateway.appypie.com/sdxl_lightning/getImage/v1/getSDXLImage";
$curl = curl_init($url);

curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

# Request headers
$headers = array(
    'Content-Type: application/json',
    'Cache-Control: no-cache',);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

# Request body
$request_body = '{
    "prompt": "A mystical phoenix rising from golden flames, its fiery wings lighting up the night sky as it soars into the heavens.",
    "negativePrompt": "blurry, low quality, dull colors, unrealistic proportions, cartoonish style, dark or overcast sky, poor lighting, abstract shapes, mechanical or robotic features, unnatural textures, distorted wings, fireless flames, excessive smoke, chaotic background, overly simplistic, pixelated, low detail, unrecognizable bird, modern elements like buildings or vehicles.",
    "height": 1024,
    "width": 1024,
    "num_steps": 20,
    "guidance": 5,
    "seed": 42
}';
curl_setopt($curl, CURLOPT_POSTFIELDS, $request_body);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
Output
Stable Diffusion XL Lightning API

SDXL Lightning: Lightning-fast Text-to-image Generation Model

meta

SDXL Lightning is an advanced text-to-image generation model with lightning speed speed and precision. As a powerful model for digital creativity, the SDXL Lightning text-to-image generation model excels in producing detailed and realistic visuals from textual descriptions. Developers can easily integrate the SDXL Lightning API into their applications, enhancing creative and design projects with advanced image generation capabilities. The SDXL Lightning text-to-image generation model offers unparalleled speed and efficiency, making it an ideal choice for graphic design, content creation, and artistic endeavors. With ComfyUI's user-friendly interface and SDXL Lightning's breakthrough efficiency, even resource-constrained environments can leverage advanced image generation. This powerful combination reduces computational requirements, making it accessible to a broader range of users and devices.

The SDXL Lightning API leverages an innovative architecture that combines the power of diffusion models with advanced distillation techniques, enabling high-quality image generation in just a few inference steps. This breakthrough allows for near-instantaneous image creation without sacrificing detail or coherence, making the SDXL Lightning API invaluable for real-time applications and interactive design processes. By integrating the SDXL Lightning API into their workflows, developers can unlock rapid image generation capabilities with reduced computational requirements, making it accessible to a wider range of users and devices.

How to Generate Images using SDXL Lightning API?

Generating images with the SDXL Lightning API is a quick and efficient process. Follow these steps to create your desired visuals:

generate_01

Access the SDXL Lightning API

Start by gaining access to the SDXL Lightning API via the Appy Pie platform. To authenticate, you’ll need to register and obtain an API key, which will allow you to use the API’s features.

generate_02

Set Up Environment and Configure Input Parameters

Begin by selecting your preferred programming language, such as Python or JavaScript, and ensure your development environment is ready to handle HTTP requests. Prepare your input by crafting a detailed text prompt that describes the desired image.

generate_03

Make the API Request

Create a POST request to the SDXL Lightning API endpoint, including your API key and the input parameters (text prompt, resolution, and any other settings). The API will process the request and generate the image based on the information provided.

generate_04

Retrieve and Download the Image

Once the request is successfully processed, the API will return a URL to the generated image. You can then download the image and save it locally for use in your project.

Use Cases of the SDXL Lightning API

The SDXL Lightning API offers powerful text-to-image generation capabilities, transforming textual descriptions into stunning visuals. With its versatility and high efficiency, it’s ideal for various industries, enhancing creativity, productivity, and user engagement across multiple use cases.

cases_1

Custom Artwork for Branding

Companies can leverage the SDXL Lightning API to generate custom artwork aligned with their brand identity. This allows businesses to create unique visuals for marketing campaigns, packaging designs, and digital presence. The API ensures high-quality, personalized images that enhance brand visibility and maintain consistent branding.

cases_2

Interactive User Experiences

The SDXL Lightning API enables the creation of interactive applications where users can generate high-quality images based on their text inputs in real time. Perfect for games, educational tools, and creative platforms, this API enhances user engagement by providing a dynamic, responsive experience that allows users to personalize and interact with visuals effortlessly.

cases_3

Personalized Marketing Content

With the SDXL Lightning API, marketers can create personalized, on-demand visuals tailored to specific audiences. This allows for the generation of custom social media posts, email marketing assets, and advertising banners, helping brands to deliver unique content that resonates with individual user preferences and improves engagement rates.

cases_4

E-commerce Product Customization

E-commerce platforms can integrate the SDXL Lightning API to offer real-time product customization. Shoppers can input descriptions or select options to generate personalized product designs, from apparel to home décor. This enhances the customer experience by providing tailored visual previews, increasing conversion rates.

cases_5

Training AI and Machine Learning Models

The SDXL Lightning API can be utilized to generate large datasets of images from text descriptions, which are essential for training and testing AI and machine learning models. These datasets can be used to improve the performance of vision-based AI models in various fields, including facial recognition and autonomous driving.

cases_6

Educational Content Creation

The SDXL Lightning API can be used by educators to create engaging visuals for learning materials, presentations, and online courses. By generating detailed images from text descriptions, the API enhances the ability to communicate complex ideas through visual aids, improving student engagement and learning outcomes.

Top Trending Generative AI APIs

 

Maximize the potential of your projects with our Generative AI APIs. From video generation & image creation to text generation, animation, 3D modeling, prompt generation, image restoration, and code generation, our advanced APIs cover all aspects of generative AI to meet your needs.