Skip to content

bentoml/diffusers-examples

Repository files navigation

bentoml.diffusers examples

This repository hosts supplementary materials of the article Creating Stable Diffusion 2.0 Service With BentoML And Diffusers.

image

Prompt: Kawaii low poly grey American shorthair cat character, 3D isometric render, ambient occlusion, unity engine, lively color Negative prompt: low-res, blurry, mutation, deformed

Currently we have three examples:

Prepare environment

We recommend running these services on a machine equipped with a Nvidia graphic card and CUDA Toolkit installed.

First let's prepare a virtual environment and install requried depedencies

python3 -m venv venv/ && source venv/bin/activate
pip install -U -r requirements.txt

Import models

You may need to authorize your huggingface account to download models, to do that, run:

pip install -U huggingface_hub
huggingface-cli login

then:

Start the service and go on

After the model is imported, you can go into sd2/, sd2_mega or anything_v3 and follow the readme inside the folder to start the service and make a docker image for each service