Giter VIP home page Giter VIP logo

mounta11n / bananaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bananaml/demo-sd-hf-safetensors

0.0 0.0 0.0 6 KB

This is a Stable Diffusion starter template from Banana.dev that allows on-demand serverless GPU inference of a custom safetensors model from Hugging Face. Basically your own Stable Diffusion API.

Home Page: https://www.banana.dev

Python 80.85% Dockerfile 19.15%

bananaml's Introduction

Banana.dev Stable Diffusion Safetensors starter template

This is a Stable Diffusion starter template from Banana.dev that allows on-demand serverless GPU inference.

It uses a custom safetensors model from Hugging Face.

It supports prompting with and without seeds.

You can fork this repository and deploy it on Banana as is, or customize it based on your own needs.

Running this app

Deploying on Banana.dev

  1. Fork this repository to your own Github account.
  2. Connect your Github account on Banana.
  3. Create a new model on Banana from the forked Github repository.

Running after deploying

  1. Wait for the model to build after creating it.
  2. Make an API request to it using one of the provided snippets in your Banana dashboard.

For more info, check out the Banana.dev docs.

Testing locally

Using Docker

Build the model as a Docker image. You can change the banana-sd-hf-safetensors part to anything.

docker build -t banana-sd-hf-safetensors .

Run the Potassium server

docker run --publish 8000:8000 -it banana-sd-hf-safetensors

In another terminal, run inference after the above is built and running.

curl -X POST -H 'Content-Type: application/json' -d '{"prompt": "colorful, 1girl, high angle, software developer protagonist, hacker, ((computer screen)), matrix, ((keyboard)), glow, light particles, wallpaper, chromatic aberration"}' http://localhost:8000

Without Docker

You could also install and run it without Docker.

Just make sure that the pip dependencies in the Docker file (and torch) are installed in your Python virtual environment.

Run the Potassium app in one terminal window.

python3 app.py

Call the model in another terminal window with the Potassium app still running from the previous step.

curl -X POST -H 'Content-Type: application/json' -d '{"prompt": "colorful, 1girl, high angle, software developer protagonist, hacker, ((computer screen)), matrix, ((keyboard)), glow, light particles, wallpaper, chromatic aberration"}' http://localhost:8000

bananaml's People

Contributors

nik-418 avatar erikkaum 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.