Team Ai
Apppublic

shailex/stable-diffusion-api

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Stable Diffusion Image Generator

A web application that uses Stable Diffusion to generate images from text prompts.

Live Demo

The application is deployed and accessible at:

Features

  • —Generate images from text descriptions using Stable Diffusion
  • —Control number of images, inference steps, and guidance scale
  • —Easy to use web interface
  • —Download generated images

Architecture

This application consists of two parts:

  1. 1.Frontend: Static HTML/JS/CSS hosted on GitHub Pages
  2. 2.Backend: Flask API hosted on Hugging Face Spaces that runs the Stable Diffusion model

Setup and Deployment

Frontend Setup

  1. 1.Fork or clone this repository
  2. 2.Update the API_URL in the index.html file to point to your deployed backend
  3. 3.Enable GitHub Pages in your repository settings

Backend Setup

The backend can be deployed to Hugging Face Spaces:

  1. 1.Create a new Space on Hugging Face
  2. 2.Choose the Docker template
  3. 3.Upload the app.py, requirements.txt, and Dockerfile files
  4. 4.Your API will be available at the URL provided by Hugging Face

Local Development

To run the application locally:

  1. 1.Clone the repository
  2. 2.Install the requirements: pip install -r requirements.txt
  3. 3.Run the Flask app: python app.py
  4. 4.Open index.html in your browser (make sure to update the API URL)

Credits