• Stars
    star
    584
  • Rank 76,554 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a web ui & api for πŸ€— diffusers

diffuzers

A web ui and deployable API for πŸ€— diffusers.

< under development, request features using issues, prs not accepted atm >

Open In Colab Documentation Status

image

If something doesnt work as expected, or if you need some features which are not available, then create request using github issues

Features available in the app:

  • text to image
  • image to image
  • instruct pix2pix
  • textual inversion
  • inpainting
  • outpainting (coming soon)
  • image info
  • stable diffusion upscaler
  • gfpgan
  • clip interrogator
  • more coming soon!

Features available in the api:

  • text to image
  • image to image
  • instruct pix2pix
  • textual inversion
  • inpainting
  • outpainting (via inpainting)
  • more coming soon!

Installation

To install bleeding edge version of diffuzers, clone the repo and install it using pip.

git clone https://github.com/abhishekkrthakur/diffuzers
cd diffuzers
pip install -e .

Installation using pip:

pip install diffuzers

Usage

Web App

To run the web app, run the following command:

diffuzers app

API

To run the api, run the following command:

diffuzers api

Starting the API requires the following environment variables:

export X2IMG_MODEL=stabilityai/stable-diffusion-2-1
export DEVICE=cuda

If you want to use inpainting:

export INPAINTING_MODEL=stabilityai/stable-diffusion-2-inpainting

To use long prompt weighting, use:

export PIPELINE=lpw_stable_diffusion

If you have OUTPUT_PATH in environment variables, all generations will be saved in OUTPUT_PATH. You can also use other (or private) huggingface models. To use private models, you must login using huggingface-cli login.

API docs are available at host:port/docs. For example, with default settings, you can access docs at: 127.0.0.1:10000/docs.

All CLI Options for running the app:

❯ diffuzers app --help
usage: diffuzers <command> [<args>] app [-h] [--output OUTPUT] [--share] [--port PORT] [--host HOST]
                                        [--device DEVICE] [--ngrok_key NGROK_KEY]

✨ Run diffuzers app

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT       Output path is optional, but if provided, all generations will automatically be saved to this
                        path.
  --share               Share the app
  --port PORT           Port to run the app on
  --host HOST           Host to run the app on
  --device DEVICE       Device to use, e.g. cpu, cuda, cuda:0, mps (for m1 mac) etc.
  --ngrok_key NGROK_KEY
                        Ngrok key to use for sharing the app. Only required if you want to share the app

All CLI Options for running the api:

❯ diffuzers api --help
usage: diffuzers <command> [<args>] api [-h] [--output OUTPUT] [--port PORT] [--host HOST] [--device DEVICE]
                                        [--workers WORKERS]

✨ Run diffuzers api

optional arguments:
  -h, --help         show this help message and exit
  --output OUTPUT    Output path is optional, but if provided, all generations will automatically be saved to this
                     path.
  --port PORT        Port to run the app on
  --host HOST        Host to run the app on
  --device DEVICE    Device to use, e.g. cpu, cuda, cuda:0, mps (for m1 mac) etc.
  --workers WORKERS  Number of workers to use

Using private models from huggingface hub

If you want to use private models from huggingface hub, then you need to login using huggingface-cli login command.

Note: You can also save your generations directly to huggingface hub if your output path points to a huggingface hub dataset repo and you have access to push to that repository. Thus, you will end up saving a lot of disk space.

More Repositories

1

approachingalmost

Approaching (Almost) Any Machine Learning Problem
7,369
star
2

colabcode

Run VSCode (codeserver) on Google Colab or Kaggle Notebooks
Python
2,069
star
3

tez

Tez is a super-simple and lightweight Trainer for PyTorch. It also comes with many utils that you can use to tackle over 90% of deep learning projects in PyTorch.
Python
1,160
star
4

autoxgb

XGBoost + Optuna
Python
676
star
5

is_that_a_duplicate_quora_question

Python
441
star
6

approaching_almost_nlp

Approaching (Almost) Any Natural Language Processing Problem
341
star
7

mlspace

MLSpace: Hassle-free machine learning & deep learning development
Python
303
star
8

wtfml

WTFML: Well That's Fantastic Machine Learning
Python
295
star
9

bert-sentiment

Python
269
star
10

how-to-become-a-ds-in-30-days

How to become a data scientist in 30 days
213
star
11

mlframework

Python
200
star
12

clickbaits_revisited

Deep learning models to identify clickbaits taking content into consideration
Python
171
star
13

long-text-token-classification

Python
162
star
14

greedyFeatureSelection

greedy feature selection based on ROC AUC
Python
125
star
15

bert-entity-extraction

Python
124
star
16

StableSAM

100
star
17

pysembler

An automatic ensembler of machine learning models in python
Python
67
star
18

captcha-recognition-pytorch

Python
61
star
19

sandesh

A simple app to send messages to Slack channels / members using webhook
Python
56
star
20

ml_dev_env

Machine Learning / Deep Learning Environment. Everywhere. Anywhere.
Dockerfile
50
star
21

commonlit-pairwise-model

Pairwise model for commonlit competition
Python
46
star
22

e01

Python
37
star
23

chaii-hindi-tamil-question-answering

chaii: hindi and tamil question answering
Python
36
star
24

melanoma-deep-learning

JavaScript
35
star
25

bert-tweet-sentiment

Python
31
star
26

automl_gpu

Python
26
star
27

walmart2015

Python
26
star
28

csv_test

26
star
29

AutoML

Python
24
star
30

imet-collection

Python
23
star
31

anime_hentai

Distinguishing between anime and hentai
Python
15
star
32

autonlp

AutoNLP: AutoML for NLP (WIP)
Python
13
star
33

abhishekkrthakur

9
star
34

ApproachingAlmostNLP

8
star
35

competitions-template

8
star
36

LCE

Local Collective Embeddings. Python translation of https://github.com/msaveski/LCE
Python
7
star
37

moa-kaggle

6
star
38

movie_recommender

6
star
39

av_minihack

Python
5
star
40

naivebees

Python
5
star
41

amazon_challenge

code for amazon employee access challenge
C
4
star
42

nuSVM

implementation of nusvm using cvxopt
Python
4
star
43

aaamlp_figures

4
star
44

ultramnist

3
star
45

testing

3
star
46

NDSB

national data science bowl @ kaggle
Python
2
star
47

finetuning_googlenet

Python
2
star
48

images

2
star
49

pyCoDi

implementation of CoDi saliency in python
Python
2
star
50

illumination-compensation

C++
2
star
51

fastFibonacci

fast fibonacci in cython
C
1
star
52

xformers

1
star
53

kaggle-afsis

Beating the Benchmark in Kaggle Afsis challenge
Python
1
star
54

EMC

em clustering
Python
1
star