Giter Site home page Giter Site logo

inoculate23 / sdxl-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacoblincool/sdxl-api

0.0 0.0 0.0 196 KB

SDXL API provides a seamless interface for image generation and retrieval using Stable Diffusion XL integrated with Cloudflare AI Workers. This API allows users to generate and manage images in a highly efficient and scalable manner.

Home Page: https://sdxl-api.vercel.app

License: MIT License

Shell 1.02% TypeScript 98.98%

sdxl-api's Introduction

SDXL API

SDXL API provides a seamless interface for image generation and retrieval using Stable Diffusion XL integrated with Cloudflare AI Workers. This API allows users to generate and manage images in a highly efficient and scalable manner.

openapi

Features

  • Image Generation: Generate images from text prompts with customizable steps.
  • Image Retrieval: Retrieve generated images and their configurations. (opt-in with R2 binding)

Usage

I recommend to use this as an Service Binding, and use Cloudflare Zero Trust to protect the Swagger UI. By this way, your other applications and still access the service with Service Binding, while the Swagger UI (and the whole API) is protected by Cloudflare Zero Trust and only you (and the one you trust) can access it.

Service Binding

You can use the library to interact with the service binding.

# add this to downstream worker's wrangler.toml
[[services]]
binding = "sdxl"
service = "sdxl-api-worker"
import { sdxl } from "sdxl-api";

export default {
    async fetch(request, env) {
        // setup the SDXL instance, bind to the service
        sdxl.setup({ fetcher: env.sdxl });

        // generate an image
        const [image] = await sdxl.generate(
            "A colorful deep space nebula on a black background.",
            12,
        );

        // ...
    },
};

Contributions

Your contributions and suggestions are heartily welcome.

sdxl-api's People

Contributors

jacoblincool avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.