File size: 898 Bytes
c0b464a 7dc6a72 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
---
title: StreamDiffusion Realtime Txt2img
emoji: 👁
colorFrom: red
colorTo: yellow
sdk: docker
app_port: 9090
pinned: false
---
# Txt2Img Example
<p align="center">
<img src="./assets/example.gif" width=80%>
</p>
This example provides a simple implementation of the use of StreamDiffusion to generate images from text.
## Usage
```bash
chmod +x ./start.sh && ./start.sh
```
or
```bash
cd server
python3 main.py &
cd ../view
npm start
```
## Docker
Build
`GITHUB_TOKEN` is temp until project is public
```bash
docker build --secret id=GITHUB_TOKEN,src=./github_token.txt -t realtime-txt2img .
```
Run
```bash
docker run -ti -p 9090:9090 -e HF_HOME=/data -v ~/.cache/huggingface:/data --gpus all realtime-txt2img
```
`-e HF_HOME=/data -v ~/.cache/huggingface:/data` is used to mount your local huggingface cache to the container, so that you don't need to download the model again.
|