Skip to content

Latest commit

 

History

History

realtime-img2img

Img2Img Example

English | 日本語

This example, based on this MPJEG server, runs image-to-image with a live webcam feed or screen capture on a web browser.

Usage

You need Node.js 18+ and Python 3.10 to run this example. Please make sure you've installed all dependencies according to the installation instructions.

cd frontend
npm i
npm run build
cd ..
pip install -r requirements.txt
python main.py  --acceleration tensorrt   

or

chmod +x start.sh
./start.sh

then open http://0.0.0.0:7860 in your browser. (*If http://0.0.0:7860 does not work well, try http://localhost:7860)

Running with Docker

docker build -t img2img .
docker run -ti -e ENGINE_DIR=/data -e HF_HOME=/data -v ~/.cache/huggingface:/data  -p 7860:7860 --gpus all img2img

Where ENGINE_DIR and HF_HOME set a local cache directory, making it faster to restart the docker container.