Installation Steps
Sorting out the installation steps:
precondition:
download and install node.js from https://nodejs.org/en add "%NODE_PATH%","C:\Program Files\nodejs" & "C:\Program Files\nodejs\node_global" to system environment variable (by default)
then install pnpm:
npm install -g pnpminstallation:
clone to path: C:\Users\<your_username>:
cd C:\Users\<your_username>
git clone https://github.com/cumulo-autumn/StreamDiffusion.git
cd streamdiffusioncreate python3.10 virtual environmen and activate it:
python -m venv streamdiffusion
streamdiffusion\scripts\activate.batinstall torch for cuda 11.8:
pip3 install torch==2.1.0 torchvision==0.16.0 xformers --index-url https://download.pytorch.org/whl/cu118Install StreamDiffusion (latest version, recommended):
pip install git+https://github.com/cumulo-autumn/StreamDiffusion.git@main#egg=streamdiffusion[tensorrt]Install TensorRT extension:
python -m streamdiffusion.tools.install-tensorrtexamples:
screen function: installation: navigate to examples folder and install requirements:
cd examples
pip install -r screen/requirements.txtmeasure the performance of streamdiffusion
python benchmark/multi.pyIf everything goes well press Ctrl+C to exit the current running. run:
python screen/main.pyIf everything goes well press Ctrl+C to exit the current running.
img2img function (place source images in path" ./images/input/", current path: C:\Users<user name>\StreamDiffusion\examples): Image-to-image for a single image:
python img2img/single.py --input ../images/inputs/input.png --output ../images/outputs/output.pngIf everything goes well press Ctrl+C to exit the current running. Image-to-image for multiple images:
python img2img/multi.py --input ../images/inputs --output-dir ../images/outputsIf everything goes well press Ctrl+C to exit the current running.
txt2img (current path: C:\Users\\StreamDiffusion\examples): text-to-image for a single image:
python txt2img/single.py --output ../images/outputs/output.png --prompt "<your prompts>"If everything goes well press Ctrl+C to exit the current running. text-to-image for multiple images:
python txt2img/multi.py --output ../images/outputs --prompt "<your prompts>"If everything goes well press Ctrl+C to exit the current running.
vid2vid: install extra dependencies (current path: C:\Users\\StreamDiffusion\examples):
pip install -r vid2vid/requirements.txtrun (place source video in path" ./images/input/"):
python vid2vid/main.py --input ..images/inputs/input.mp4 --output ../images/outputs/output.mp4If everything goes well press Ctrl+C to exit the current running.
other command line options:
- --model_id_or_path: --model_id_or_path: "" #hugging face --model_id_or_path: "<model path/model name>" #local, recommend
- --lora_dict: --lora_dict "{'<lora_1 path>' : <lora_1 scale> , '<lora_2 path>' : <lora_2 scale> }"
- --prompt: --prompt ""
- --negative prompts: --negative_prompts ""
demo:
realtime-img2img: every single time to execute "realtime-img2img" function you have to run every line below from "npm i"
cd C:\Users\<user name>\StreamDiffusion\demo\realtime-img2img\frontend
npm i
npm run build
cd..
pip install -r requirements.txtrun (need long time for launch till webpage pop up automatically at "http://0.0.0.0:7860/"; there will be various errors messages just disregard it. see issues #130 for details):
python main.py --acceleration tensorrtIf everything goes well press Ctrl+C to exit the current running.
realtime-txt2img:
cd C:\Users\<user name>\StreamDiffusion\demo\realtime-txt2img
pip install -r requirements.txt
cd frontend
pnpm i
pnpm run build
cd..run:
python main.pyIf everything goes well press Ctrl+C to exit the current running.
vid2vid:
cd C:\Users\<user name>\StreamDiffusion\demo\vid2vid
pip install -r requirements.txtrun:
python app.pyIf everything goes well press Ctrl+C to exit the current running.
Source: cumulo-autumn/StreamDiffusion