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

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

{
    "prompt": "Image of Sparrow Bird"
}

import urllib.request, json

try:
    url = "https://gateway.appypie.com/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": "Image of Sparrow Bird"
};

fetch('https://gateway.appypie.com/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/getImage/v1/getSDXLImage" -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data-raw "{
    \"prompt\": \"Image of Sparrow Bird\"
}"
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/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\": \"Image of Sparrow Bird\" }".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/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": "Image of Sparrow Bird"
}';
curl_setopt($curl, CURLOPT_POSTFIELDS, $request_body);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);

Output
  • API Documentation for Stable Diffusion XL

    Overview

    Stable Diffusion XL API, a product of Stability AI, stands at the forefront of AI image generation technology, offering exceptional capabilities in producing lifelike faces, seamlessly integrating readable text into images, and enhancing overall image composition. Its standout feature is its efficiency in interpreting concise text prompts, resulting in stunning visual outputs. Building on the strengths of its predecessors, Stable Diffusion XL 1.0 excels in generating diverse image variations through techniques like image-to-image prompting, where it intelligently reacts to input cues to create nuanced variations. Additionally, its capabilities extend to inpainting, which allows for the reconstruction of selected regions within an image, and outpainting, which extrapolates elements beyond the original image boundaries, serving as a refinement model. This model is also acknowledged as one of the premier image generators accessible today. By leveraging the robust functionalities of Stable Diffusion XL 1.0, developers can transform image manipulation, content creation, and creative expression. Utilizing this image SDXL API, a powerful model from stable diffusion, empowers applications with cutting-edge image synthesis capabilities, opening up a world of possibilities for immersive visual experiences.

    Stable Diffusion XL model ensures high-resolution image synthesis from text prompts, delivering visuals that are both visually appealing and accurate representations of the input prompts. The generation process within the Stable Diffusion XL API is designed to handle various aspect ratios, ensuring that the output images meet the specific needs of different applications. Whether you're working on a web design project, an advertising campaign, or digital art, the Stable Diffusion XL API can accommodate and enhance your creative workflow.

    Moreover, the guidance scale is a critical parameter in the SDXL API that controls the influence of the text prompt on the generated image. By adjusting the guidance scale, developers can fine-tune the balance between creativity and adherence to the prompt, allowing for a wide range of artistic and practical applications like Stable Diffusion 1.5. The generation process is streamlined to ensure that the SDXL API can handle high-resolution image outputs, making it suitable for professional-grade projects. This API Doc provides comprehensive documentation on how to effectively utilize the guidance scale parameter and maximize the potential of the SDXL API for a myriad of creative and practical endeavors.

  • API Parameters

    The API POST

    https://gateway.appypie.com/getImage/v1/getSDXLImage takes the following parameters:

    prompt

    string, required

    negative_prompt

    string, optional

    response_format

    JavaScript Object Notation (JSON)

    size

    string, optional, default: 1024x1024

     

    Integration and Implementation

    To use the SDXL API, developers need to make POST requests to the specified endpoint with the appropriate headers and request body. The request body should include the text prompt and any optional parameters such as negative prompts and image size.

     
    Base URL

    https://gateway.appypie.com/stable-diffusion-xl-base-1-0

    Endpoints
    POST /getImage

    This endpoint generates images based on the provided text prompts.

    Request
    • URL: https://gateway.appypie.com/getImage/v1/getSDXLImage
    • Method: POST
    • Headers:
      • Content-Type: application/json
      • Cache-Control: no-cache
      • Ocp-Apim-Subscription-Key: {subscription_key}
    • Body:

      JSON

      {
        "prompt": "Image of Bird"
      }
  • Responses
    • HTTP Status Codes:
      • 200 OK: The request was successful, and the generated image is included in the response body.
      • 400 Bad Request: The request was malformed or missing some arguments.
      • 401 Unauthorized: The API key provided in the header is invalid.
      • 500 Internal Server Error: An error occurred on the server while processing the request.
    • Sample Response:

      JSON

      {
        "status": 200,
        "content-type": "image/png",
        "content-length": "size_in_bytes",
        "image_data": "base64_encoded_image_data"
      }
      
    Error Handling

    The SDXL API provides comprehensive error handling to ensure smooth operation. Common status codes include:

    • Error Field Contract:
      • code: An integer that indicates the HTTP status code (e.g., 400, 401, 500).
      • message: A clear and concise description of what the error is about.
      • traceId A unique identifier that can be used to trace the request in case of issues.

    Use Cases of SDXL API

    • eCommerce: Enhance your product listings with high-quality images generated via the SDXL API, boosting user engagement and driving sales. By integrating the Stable Diffusion XL API, eCommerce platforms can automatically create professional-grade product images based on text descriptions. This not only saves time but also ensures consistency in image quality across the platform like the next-generation model, making it easier for customers to trust and engage with the products. Whether you need images in various aspect ratios or high-resolution formats, the SDXL API can cater to all your requirements, improving the overall shopping experience.
    • Content Creation: The SDXL API enables efficient content creation by providing access to a vast array of diverse visual assets. Content creators can quickly generate relevant visuals for blogs, social media, and marketing campaigns without needing extensive graphic design skills. The ability to produce images based on concise text prompts streamlines the creative process, allowing for rapid iteration and innovation. Whether you're crafting visuals for an article or developing graphics for an ad campaign, this image model ensures that your image quality meets professional standards, enhancing the overall impact of your content.
    • Social Media: Enhance your social media presence with appealing graphics generated by the SDXL API. The ability to embed readable text seamlessly into images is particularly useful for creating engaging and informative social media content. By utilizing the SDXL API, social media managers can produce visually striking posts that increase user interaction and boost brand visibility. The API's text-to-image synthesis capabilities allow for creative flexibility, enabling the production of unique visuals that stand out in crowded social media feeds.
    • Virtual Events: Enrich your virtual events with dynamic visuals created through this image-to-text SDXL API. Whether it's custom event banners, interactive backgrounds, or immersive virtual environments, the Stable Diffusion SDXL 1.0 API provides the tools needed to captivate participants and enhance the overall experience. By leveraging the API's capabilities, event organizers can create visually engaging content that keeps attendees engaged and ensures a memorable event. With features like SDXL Turbo for accelerated image generation and seamless REST API integration, the SDXL API is the ideal solution for delivering impactful visuals in virtual settings.
    • Digital Publishing: Improve our digital publications with captivating visuals sourced via the SDXL API. From articles and eBooks to online magazines, integrating the Stable Diffusion XL API enhances the visual appeal of your content and drives reader engagement. Whether you're incorporating images to illustrate key concepts or to complement your written content, the SDXL API offers unparalleled flexibility and quality. With its advanced base model and enterprise, developers can ensure that each publication stands out and leaves a lasting impression on readers.

    Advanced Features of the Stable Diffusion XL API

    • Inpainting and Outpainting: The SDXL API excels in inpainting, adeptly reconstructing selected regions within an image. This feature is particularly useful for tasks that require filling in missing parts of an image or removing unwanted elements. Additionally, outpainting extends the image beyond its original boundaries, allowing for the creation of larger scenes from smaller inputs. Whether you're enhancing existing images or creating entirely new compositions, the SDXL API provides powerful tools for manipulating and extending visual content.
    • Image-to-Image Prompting: Image-to-image prompting is a powerful feature of the SDXL API, enabling developers to input an existing image and generate nuanced variations based on the initial prompt and get Image URLs instantly. This technique offers a high degree of flexibility in image generation, allowing for creative iterations and variations. Whether you're exploring different styles, compositions, or color schemes, the SDXL API's image-to-image prompting capability empowers you to experiment and innovate with your visual creations.
    • Text Embeddings and Readable Text Integration: One of the standout capabilities of the SDXL API is its ability to embed readable text seamlessly into images. This feature is invaluable for creating posters, advertisements, and educational materials where text must be integrated naturally into the visual content. By leveraging advanced text embeddings, the SDXL API ensures that the text is not only legible but also aesthetically pleasing with film grain. Whether you're adding captions, titles, or informational text, the SDXL API provides the tools you need to enhance the communicative power of your visuals.

    Technical Specifications of the Stable Diffusion XL API

    • Latent Diffusion Model: Stable Diffusion XL API is built on a sophisticated latent diffusion model, incorporating noisy latents, which serves as the backbone for high-quality image synthesis from text prompts. This model, more advanced than previous versions, ensures that the generated images not only meet visual standards but also accurately represent the essence of the input prompts, resulting in compelling visual outputs that resonate with viewers.
    • Guidance Scale: A crucial parameter within the Stable Diffusion API, the guidance scale controls the influence of the text prompt on the generated image, incorporating the concept art and refiner model. This feature provides developers with the flexibility to fine-tune the balance between creativity and adherence to the prompt's context, ensuring legible text in the output. By adjusting the guidance scale, users can tailor the output to suit a wide range of artistic and practical applications, ensuring sharp focus for various use cases.
    • Input Image: Incorporating user-provided images as prompts, the Stable Diffusion XL Beta empowers creators to infuse their visual compositions with existing elements. This functionality enhances the creative process by offering a starting point for exploration and iteration. Leveraging the input image capability, users can seamlessly integrate their visuals, fostering a collaborative and customizable approach to content creation.
    • Batch Size and Number of Images: With support for batch processing, this AI image generation model enables developers to generate multiple images in a single request, enhancing efficiency and scalability. By adjusting the batch size parameter, users can control the number of images generated, catering to both individual projects and large-scale image generation tasks. This flexibility makes the API adaptable to a diverse range of workflows and project requirements, ensuring seamless integration into various development environments.
    Definitions
    • AI Model: Refers to the underlying machine learning model used to interpret the text prompts and generate corresponding images.
    • Changelog: Document detailing any updates, bug fixes, or improvements made to the API in each version.
     

    What are the Benefits of Using SDXL API?

    • Enhanced Scalability: SDXL API, powered by Large Language Models (LLMs), offers unparalleled scalability, enabling enterprise clients to effortlessly handle large volumes of image data. As businesses grow, the API seamlessly accommodates increasing demands, ensuring stable performance and visual fidelity even under high workloads. This scalability is crucial for enterprises managing vast repositories of images across diverse applications.
    • Robust Stability.ai Integration: Stability.ai integration fortifies the reliability of SDXL API, ensuring consistent performance and minimizing downtime. Enterprise clients can rely on a stable infrastructure backed by cutting-edge technology, safeguarding against disruptions and ensuring uninterrupted access to critical image solutions and denoising processes. This integration fosters trust and confidence among users, essential for mission-critical applications.
    • Tailored Image Solutions: The SDXL API provides customized image solutions and text encoders specifically crafted to fulfill the distinct requirements of enterprise clients spanning diverse industries. Whether it's image recognition, processing, or analysis, the API provides customizable functionalities to address specific requirements. From automated image tagging to advanced object detection, enterprises can leverage SDXL API to streamline workflows and unlock new opportunities for innovation This is made possible through the integration of Foundation Models, ensuring robust performance and versatility in handling various tasks.
    • Comprehensive Design Elements: With SDXL API, enterprise clients gain access to a comprehensive suite of design elements, empowering them to create visually stunning applications and interfaces with import requests and API calls. From pre-trained models for image manipulation to customizable templates for graphic design, the API offers a rich array of tools and resources to unleash creativity. Enterprises can deliver captivating user experiences while maintaining brand consistency and identity.
    • Efficient Mask_Image Functionality: The inclusion of the mask_image function within SDXL API enhances efficiency in image processing workflows. This feature allows enterprises to easily apply masks to images, enabling precise segmentation and manipulation for various purposes such as background removal, object isolation, or image enhancement. By simplifying complex tasks, the mask_image function accelerates time-to-market and improves overall productivity.
    • Secure IP Address Management: SDXL API prioritizes security with robust IP address management capabilities, safeguarding sensitive data and resources from unauthorized access. Enterprise clients can define access policies, restrict usage to trusted IPs, and monitor traffic patterns to detect anomalies effectively. This proactive approach to security ensures compliance with regulatory requirements and protects valuable assets, instilling confidence in the integrity of the image solutions powered by SDXL API with API reference.