Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pythops/jetfusion
Diffusion models on Nvidia Jetson boards
https://github.com/pythops/jetfusion
diffusion-models jetson nvidia
Last synced: 29 days ago
JSON representation
Diffusion models on Nvidia Jetson boards
- Host: GitHub
- URL: https://github.com/pythops/jetfusion
- Owner: pythops
- Created: 2023-12-16T17:05:15.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-28T15:25:58.000Z (about 1 year ago)
- Last Synced: 2025-01-04T20:47:03.022Z (about 1 month ago)
- Topics: diffusion-models, jetson, nvidia
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Diffusion models on Jetson boards
Easy deploy of diffusion models on Nvidia jetson boards.
## π§° Requirement
- Nvidia Jetson board with at least 8GB of Memory.
- At least 25GB free space on the disk.## π οΈ Setup
1. Download and install the minamilist image for your board [hereπ](https://github.com/pythops/jetson-image)
2. Install the necessary dependencies
```
sudo apt update && \
sudo apt install -y \
cuda-toolkit-11-4 \
libcudnn8-dev \
libnuma-dev \
libopenblas-dev \
autoconf \
build-essential \
g++-8 \
gcc-8 \
clang-8 \
lld-8 \
gettext-base \
gfortran-8 \
libbz2-dev \
libc++-dev \
libcgal-dev \
libffi-dev \
libfreetype6-dev \
libhdf5-dev \
libjpeg-dev \
liblzma-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libssl-dev \
libxslt-dev \
openssl \
python-openssl \
scons \
python3-pip \
python-is-python3 \
libopenblas-dev \
git-lfs && \
pip install --user poetry
```3. Add `$USER` (by default `jetson`) user to the video group
```
sudo usermod -aG video $USER
```> You need to re-login for the changes to take effect.
4. Clone `sd-turbo` diffusion model
```
mkdir -p ~/diffusion/sd-turbo && \
git lfs install --skip-repo && \
git clone https://huggingface.co/stabilityai/sd-turbo ~/diffusion/sd-turbo```
4. Clone the jetfusion repository
```
git clone https://github.com/pythops/jetfusion && cd jetfusion
```4. Install the python dependencies
```
poetry install --no-root
```5. Run the api server
```
DIFFUSION_MODEL_DIR="$HOME/diffusion/sd-turbo" poetry run uvicorn --host 0.0.0.0 api:api
```## πͺ Usage
To display images in your terminal, you'll need to install [img2sixel](https://github.com/saitoha/libsixel)
Your terminal should support the sixel graphics format, check here for more infos https://www.arewesixelyet.com/
### Using curl
```
curl -s https://localhost:8000/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "Colorful fish in the coral reef"}' | img2sixel
```### Using httpie
```
http https://localhost:8000/generate \
prompt="Colorful fish in the coral reef" | img2sixel
```## βοΈ License
AGPLv3