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
Stable Diffusion API
  • Stable Diffusion API Documentation

    Overview

    Stable Diffusion API represents a significant advancement in the field of Artificial Intelligence, particularly in the realm of image generation. This cutting-edge tool leverages machine-learning techniques to produce photo-realistic images from textual descriptions, making it indispensable for developers and creators. One of the standout features of the Stable Diffusion API is its flexibility and ease of use. By integrating into various applications through well-defined API endpoints, developers can generate high-quality images seamlessly. The Developer Platform provides comprehensive API documentation, ensuring that both experienced developers and new users can quickly get up to speed with the API. Detailed guides and examples illustrate how to make API calls, structure the request body, and handle responses, facilitating smooth integration and operation.

    The process of generating images with the Stable Diffusion API begins with obtaining an API key, which is necessary for authentication and access to the service. Users can then make API calls to the API endpoint specified in the documentation. The request body typically includes the text prompt along with optional parameters to customize the output. This interaction highlights the robust capabilities of the underlying language models, which translate textual input into generated images that are both detailed and visually coherent. The API supports a wide range of customization options, allowing users to adjust factors such as image style, resolution, and other characteristics to suit their specific needs. The platform's ability to generate photo-realistic images from simple prompts demonstrates the advanced state of machine learning and Artificial Intelligence technologies embedded in the Stable Diffusion API.

    One of the key advantages of the Stable Diffusion API is its adaptability and scalability. The base model and SDXL models are designed to handle a variety of tasks, from creating digital art to generating scientific visualizations. This versatility makes it a valuable tool across different industries and applications. The intuitive user interface on the Developer Platform ensures that users can manage their API keys, monitor usage, and access support resources easily. Additionally, the commitment to continuous improvement and user feedback ensures that the Stable Diffusion API evolves to meet emerging needs and technological advancements. This dedication to excellence not only enhances the performance and capabilities of the API but also fosters a growing community of developers who push the boundaries of what is possible with machine learning and Artificial Intelligence.Additionally, the API can be integrated with the SD3 API, which further enhances its capabilities, allowing for even more advanced and realistic image generation.

  • API Parameters

    The API POST

    https://gateway.appypie.com/stable-diffusion-xl-base-1-0 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 Stable Diffusion 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 high-quality images based on the given text prompts.

    Request
    • URL: https://gateway.appypie.com/stable-diffusion-xl-base-1-0
    • 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 needed to be corrected or include 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 Stable Diffusion API includes robust error handling to ensure seamless functionality. Common status codes and their meanings are as follows:

    • 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.
    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.
     

    Use Cases of Stable Diffusion API

    • Social Media Image: Generation Leverage the powerful SDXL APIs to create stunning visuals for social media posts, enhancing engagement and brand presence. By utilizing the advanced image generation capabilities of the Stable Diffusion API, businesses can produce eye-catching content that resonates with their audience. The image generation technology ensures high-quality visuals that are crucial for maintaining a vibrant social media presence, thereby increasing likes, shares, and overall interaction with the brand's followers.
    • Stable Assistant Integration: Integrate the Stable Diffusion API with Stable Assistant for seamless image generation within virtual assistant interactions. This integration allows Stable Assistant to quickly generate relevant images in response to user queries or commands, enhancing the overall user experience. By incorporating the Image - Endpoint feature, the integration process becomes more streamlined, ensuring that the assistant can handle image generation tasks efficiently and accurately. This feature is particularly useful in applications that require quick and contextually appropriate visual responses.
    • AI Image Generator for Marketing: Harness the Stable Diffusion API as an AI Image Generator to automate the creation of compelling visuals for marketing campaigns. The image generation capabilities of the API enable marketers to produce high-resolution images that capture the essence of their campaign messages. With the ability to convert text descriptions into captivating visuals, the API supports the development of engaging marketing materials that can be used across various platforms, from social media to email marketing. The use of Stable Diffusion 1.5 ensures access to the latest advancements in image generation technology, offering improved performance and feature enhancements.
    • High-Resolution: Image Creation Generate images with exceptional image resolution using the Stable Diffusion API for professional AI products. The advanced SDXL APIs facilitate the creation of high-quality images that meet the demanding standards of professional designers and artists. Whether for print media, digital art, or advertising, the API's ability to produce high-resolution visuals ensures that the final product is both striking and detailed. The image generation technology embedded in the API allows for the precise rendering of complex designs, making it an invaluable tool for creative professionals.
    • Text-to-Image Conversion: Convert text descriptions into captivating visuals with the help of the Stable Diffusion API's innovative image generation technology. This capability allows users to input descriptive text and receive a corresponding image that accurately represents the given description. This feature is particularly useful in fields such as e-commerce, where product descriptions can be transformed into detailed images, or in publishing, where textual content can be visually enriched. The SDXL APIs ensure that the conversion process is smooth and the resulting images are of high quality.
    • Stable Diffusion 1.5 Implementation: Implement the latest version, Stable Diffusion 1.5, to access enhanced features and improved performance in image generation. The Stable Diffusion 1.5 version includes optimizations and new capabilities that significantly boost the API's efficiency and effectiveness. By upgrading to this version, developers can leverage the full potential of the image generation capabilities, ensuring that their applications benefit from the most recent advancements in AI-powered image creation.
    • Image Endpoint Integration: Seamlessly integrate the Image - Endpoint feature of the Stable Diffusion API into your applications for efficient image processing. This integration simplifies the process of generating, editing, and managing images within your software environment. The Image - Endpoint allows for direct interaction with the API, enabling quick and easy access to its powerful features. This is particularly beneficial for applications that require dynamic image generation, such as content management systems or custom design tools.
    • AI-Powered Image Creation: Harness the power of AI with the Stable Diffusion API as an AI Image Generator to automate image creation processes. The advanced AI algorithms used in the API ensure that the generated images are not only high-quality but also contextually relevant. This automation can significantly reduce the time and effort required to produce images, making it an ideal solution for industries that rely on rapid and large-scale image production, such as marketing, media, and entertainment.
    • Streamlined Image: Import Simplify the import Image process by using the Stable Diffusion API for quick and efficient image uploads. The API's robust architecture supports smooth and fast image importation, enabling users to integrate new visuals into their projects without hassle. This feature is particularly useful for platforms that handle a high volume of image uploads, such as social media sites or online marketplaces, ensuring that images are processed and available for use almost immediately.
    • Secure Integration: Process Ensure data security by managing access through IP address restrictions during the integration of the Stable Diffusion API into your systems. This security measure helps protect sensitive data and prevents unauthorized access, ensuring that only approved devices can interact with this enterprise-grade API. Implementing such security best practices is crucial for maintaining the integrity and confidentiality of data, especially in applications that handle personal or proprietary information.

    Advanced Features of the Stable Diffusion API

    • Output Image: The Stable Diffusion API generates images in the output_image format, which can be easily converted to various formats such as JPEG, PNG, or GIF like its previous versions. This flexibility allows developers to seamlessly integrate the generated images into their applications, regardless of the required format. The output_image format ensures that images maintain high quality and are ready for immediate use in various digital platforms, enhancing the user experience and application functionality.
    • Cloud Computing: By leveraging cloud computing, the Stable Diffusion API ensures that image generation processes are efficient and scalable, making it suitable for large-scale applications. The use of cloud infrastructure allows the API to handle a high volume of requests simultaneously, providing reliable performance and quick response times. This scalability is crucial for applications that demand robust and consistent image generation capabilities, such as social media platforms and large marketing campaigns.
    • Application Programming Interface (API): The Stable Diffusion API is built using REST API, which allows for easy integration with various applications and systems. The REST API architecture provides a straightforward method for developers to access and utilize the API's features, ensuring that it can be incorporated into a wide range of software environments. This ease of integration makes the Stable Diffusion API a versatile tool for developers looking to enhance their applications with advanced image generation capabilities.
    • Instruct Pix2Pix: This feature enables users to fine-tune the model for specific tasks, such as image-to-image translation or text-to-image generation. Instruct Pix2Pix offers a high degree of customization, allowing developers to adjust the model's behavior to suit their unique needs. Whether transforming existing images or creating new ones from text prompts, this feature ensures that the generated images meet the desired specifications and quality standards.
    • Started with Stable Diffusion 3: The Stable Diffusion API is built upon the Stable Diffusion 3 model, which is known for its advanced natural language processing capabilities. Stable Diffusion 3 serves as the foundation for the API's sophisticated image generation processes, leveraging its powerful NLP algorithms to accurately interpret and respond to text prompts. This ensures that the images produced are not only visually appealing but also contextually relevant and precise.
    • Natural Language Processing (NLP): The Stable Diffusion API utilizes NLP to generate images from text prompts, ensuring that the output images accurately reflect the input text. The API's advanced NLP capabilities enable it to understand complex language structures and nuances, resulting in images that truly capture the essence of the described scenes. This integration of natural language processing with image generation technology represents a significant advancement in the field of artificial intelligence.

    Technical Specifications of the Stable Diffusion API

    • Cutting-Edge Image Generation Technology: The Stable Diffusion API stands at the forefront of image generation technology, offering unparalleled capabilities for creating photo-realistic images from text prompts. At the core of this innovation is the Stable Diffusion XL 1.0 model, a cutting-edge neural network architecture specifically engineered to produce high-quality visuals with remarkable fidelity. With its advanced algorithms and state-of-the-art training techniques, the Stable Diffusion XL 1.0 model sets new standards for image synthesis, enabling users to generate stunning visuals that rival real-world photographs.
    • Enterprise-Grade Solutions: For organizations seeking enterprise-grade image generation solutions, the Stable Diffusion API offers the Enterprise Plan, providing access to enhanced features and dedicated support tailored to the needs of large-scale deployments. This plan is ideal for businesses looking to leverage the power of AI to enhance their products and services with visually compelling content. Whether it's generating images for marketing campaigns, product catalogs, or virtual environments, the Stable Diffusion API delivers exceptional results that captivate audiences and drive engagement.
    • Advanced Capabilities and Seamless Integration: In addition to static image generation, the Stable Diffusion API also supports video generation through its Video Generation APIs. This capability allows users to create dynamic visual content, such as animated scenes, video advertisements, and immersive experiences. By harnessing the power of AI-driven video generation, businesses can unlock new possibilities for storytelling and brand communication, delivering compelling narratives that resonate with their target audience.
    • Advanced Integration Options with Stable Diffusion API: For developers looking to integrate the Stable Diffusion API into their applications, there are various advanced options available. The Stable Diffusion Web UI provides a user-friendly interface for interacting with the API, allowing developers to experiment with different parameters and settings. Additionally, developers can utilize import requests to make HTTP requests to the API endpoints directly from their code. With this flexibility, developers can seamlessly incorporate image generation capabilities into their applications, opening up new possibilities for creative expression and user engagement.
    • Enhanced Performance with Stable Diffusion 3 Turbo: With the introduction of Stable Diffusion 3 Turbo, users can expect enhanced performance and capabilities from the Stable Diffusion API for generating photo-realistic images . This latest version builds upon the strengths of its predecessors, incorporating advanced algorithms and optimizations to deliver faster and more efficient image generation. By harnessing the power of cutting-edge technology, Stable Diffusion 3 Turbo empowers users to create stunning visuals with greater speed and precision, enabling them to bring their creative visions to life in record time.
    • Access to Model Weights and Test Key: As part of the Stable Diffusion API offering, developers have access to essential resources such as model weights and a Test Key. These resources provide valuable insights into the inner workings of the API and allow developers to test their implementations before deploying them in production environments. By leveraging model weights, developers can fine-tune their applications for optimal performance, while the Test Key enables them to validate their integration with the API seamlessly. With these resources at their disposal, developers can ensure a smooth and efficient development process, leading to high-quality results and enhanced user experiences.
     

    What are the Benefits of Using Stable Diffusion API

    • Cutting-Edge Image Generation Technology: The Stable Diffusion API embodies cutting-edge image generation technology, offering advanced capabilities to produce photo-realistic images from text prompts. Powered by the innovative Stable Diffusion XL 1.0 model, this API utilizes state-of-the-art neural network architecture to generate visuals with unparalleled fidelity and realism. By leveraging sophisticated algorithms and advanced training techniques, Stable Diffusion sets new standards in image synthesis, enabling users to create stunning visuals that rival real-world photographs. Whether it's for digital art, marketing materials, or virtual environments, Stable Diffusion ensures exceptional image quality and detail.
    • Enterprise-Grade Solutions for Large-Scale Deploymentsa: For organizations requiring enterprise-grade image generation solutions, the Stable Diffusion API offers the Enterprise Plan. Tailored to meet the needs of large-scale deployments, this plan provides access to enhanced features and dedicated support. With the Enterprise Plan, businesses can leverage the power of AI to enhance their products and services with visually compelling content. From generating images for marketing campaigns to creating product catalogs, Stable Diffusion delivers exceptional results that captivate audiences and drive engagement. With stability and reliability at its core, Stable Diffusion is the ideal solution for businesses seeking to scale their image generation capabilities.
    • User-Friendly Interface and Developer Platform: Stable Diffusion API provides a user-friendly interface and robust developer platform, making it easy for users to integrate image generation capabilities into their applications. With features such as code snippets and seamless integration, developers can quickly incorporate Stable Diffusion into their workflows. The Stable Diffusion Web UI offers a intuitive interface for managing image generation requests, allowing users to easily configure and customize their settings. Additionally, the Stability AI Developer Platform provides access to training resources, documentation, and support, empowering developers to train models and deploy AI-powered applications with ease.
    • Advanced Text Understanding and Multimodal Diffusion Transformation: Stable Diffusion API excels in text understanding and multimodal diffusion transformation, enabling users to generate images from complex textual descriptions. By harnessing the power of AI-driven text understanding, Stable Diffusion translates text prompts into captivating visuals with remarkable accuracy and detail. The Multimodal Diffusion Transformer architecture ensures that the generated images accurately reflect the semantics and context of the input text, resulting in highly realistic and contextually relevant visuals. With Stable Diffusion, users can bring their ideas to life with unparalleled precision and creativity.
    • Free Credits and Seamless Integration with Code Snippets: To facilitate experimentation and exploration, Stable Diffusion API offers free credits to new users, allowing them to test the capabilities of the platform without financial commitment. Additionally, Stable Diffusion provides seamless integration with code snippets and train thousands of web apps, enabling developers to quickly incorporate image generation functionality into their applications. With easy-to-use code snippets and comprehensive documentation, developers can accelerate their development process and unlock the full potential of Stable Diffusion API.
    • 24x7 Support Team and Robust API Services: Stable Diffusion API is backed by a dedicated 24x7 support team, ensuring that users receive timely assistance and support whenever needed. Whether it's troubleshooting technical issues or providing guidance on best practices, the support team is committed to ensuring a seamless experience for users. Furthermore, Stable Diffusion offers robust API services, including image generation requests and model training, enabling users to access advanced AI capabilities with ease. With Stable Diffusion, users can rely on stable and reliable API services to meet their image generation needs effectively and efficiently.

Top APIs for Generative AI Models

 

Unlock the full potential of your projects with our Generative AI APIs. from video generation APIs to image creation, text generation, animation, 3D models, prompt generation, image restoration, and code generation, we offer advanced APIs for all your generative AI needs.