From e58e586c295e44c607732da1a3b33c70ee624403 Mon Sep 17 00:00:00 2001 From: patientx Date: Fri, 16 Aug 2024 00:51:30 +0300 Subject: [PATCH] Add files via upload --- deepcache-sample.json | 449 ++++++++++++++++++++++++++++++++++++++++++ fixforrx580.bat | 23 +++ install.bat | 72 +++++++ patchzluda.bat | 10 + start.bat | 11 ++ 5 files changed, 565 insertions(+) create mode 100644 deepcache-sample.json create mode 100644 fixforrx580.bat create mode 100644 install.bat create mode 100644 patchzluda.bat create mode 100644 start.bat diff --git a/deepcache-sample.json b/deepcache-sample.json new file mode 100644 index 000000000..7685d78c3 --- /dev/null +++ b/deepcache-sample.json @@ -0,0 +1,449 @@ +{ + "last_node_id": 11, + "last_link_id": 11, + "nodes": [ + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 413, + 389 + ], + "size": { + "0": 425.27801513671875, + "1": 180.6060791015625 + }, + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 6 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark" + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 415, + 186 + ], + "size": { + "0": 422.84503173828125, + "1": 164.31304931640625 + }, + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 4 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "beautiful scenery nature glass bottle landscape, , purple galaxy bottle," + ] + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 473, + 609 + ], + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 2 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 863, + 186 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 11 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 7 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 156680208700286, + "fixed", + 20, + 8, + "euler", + "normal", + 1 + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 1209, + 188 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 9 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 9, + "type": "SaveImage", + "pos": [ + 1451, + 189 + ], + "size": { + "0": 210, + "1": 58 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 9 + } + ], + "properties": { + "Node name for S&R": "SaveImage" + }, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 10, + "type": "DeepCache", + "pos": [ + 37, + 187 + ], + "size": { + "0": 315, + "1": 130 + }, + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 10 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 11 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "DeepCache" + }, + "widgets_values": [ + 5, + 3, + 350, + 1000 + ] + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + -377, + 220 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 10 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 3, + 5 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "(pony)autismmixConfetti.safetensors" + ] + }, + { + "id": 11, + "type": "Note", + "pos": [ + -127, + 382 + ], + "size": [ + 481.58000000000004, + 286.7700000000001 + ], + "flags": {}, + "order": 2, + "mode": 0, + "properties": { + "text": "" + }, + "widgets_values": [ + "Deepcache starts doing its stuff at \"start_step\", if it 0 it works on all steps but that lowers the output quality and derives from the original output. 350 aka one third of the steps as starting point, produces almost the same output and significantly makes the generation faster. " + ], + "color": "#432", + "bgcolor": "#653" + } + ], + "links": [ + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 9, + 8, + 0, + 9, + 0, + "IMAGE" + ], + [ + 10, + 4, + 0, + 10, + 0, + "MODEL" + ], + [ + 11, + 10, + 0, + 3, + 0, + "MODEL" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.8264462809917354, + "offset": [ + 522.3200000000006, + 234.36999999999998 + ] + } + }, + "version": 0.4 +} \ No newline at end of file diff --git a/fixforrx580.bat b/fixforrx580.bat new file mode 100644 index 000000000..109acc1d8 --- /dev/null +++ b/fixforrx580.bat @@ -0,0 +1,23 @@ +@echo off +title Fix for RX480 - 580 and variants +cls +venv\scripts\activate +pip uninstall torch torchvision torchaudio -y +pip install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu118 +echo ..................................................... +echo *** "Patching ZLUDA Again" +echo. +rmdir /S /q zluda +curl -s -L https://github.com/lshqqytiger/ZLUDA/releases/download/rel.11cc5844514f93161e0e74387f04e2c537705a82/ZLUDA-windows-amd64.zip > zluda.zip +tar -xf zluda.zip +del zluda.zip +copy zluda\cublas.dll venv\Lib\site-packages\torch\lib\cublas64_11.dll /y +copy zluda\cusparse.dll venv\Lib\site-packages\torch\lib\cusparse64_11.dll /y +copy zluda\nvrtc.dll venv\Lib\site-packages\torch\lib\nvrtc64_112_0.dll /y +echo. +@echo *ZLUDA is patched. * +echo. +echo ..................................................... +echo *** Installation is done. -- +echo ..................................................... +echo. diff --git a/install.bat b/install.bat new file mode 100644 index 000000000..30fa420cc --- /dev/null +++ b/install.bat @@ -0,0 +1,72 @@ +@echo off +title ComfyUI-Zluda Installer + +setlocal EnableDelayedExpansion +set "startTime=%time: =0%" + +cls +echo ------------------------------------------------------------- +Echo ******************* COMFYUI-ZLUDA INSTALL ******************* +echo ------------------------------------------------------------- +echo. +echo :: %time:~0,8% :: - Setting up the virtual enviroment +Set "VIRTUAL_ENV=venv" +If Not Exist "%VIRTUAL_ENV%\Scripts\activate.bat" ( + python.exe -m venv %VIRTUAL_ENV% +) + +If Not Exist "%VIRTUAL_ENV%\Scripts\activate.bat" Exit /B 1 + +echo :: %time:~0,8% :: - Virtual enviroment activation +Call "%VIRTUAL_ENV%\Scripts\activate.bat" +echo :: %time:~0,8% :: - Updating the pip package +python.exe -m pip install --upgrade pip --quiet +echo. +echo :: %time:~0,8% :: Beginning installation ... +echo. +echo :: %time:~0,8% :: - Installing required packages +pip install -r requirements.txt --quiet +echo :: %time:~0,8% :: - Installing torch for AMD GPUs (First file is 2.7 GB, please be patient) +pip uninstall torch torchvision torchaudio -y --quiet +pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https://download.pytorch.org/whl/cu118 --quiet +echo :: %time:~0,8% :: - Installing onnxruntime (required by some nodes) +pip install onnxruntime --quiet +echo :: %time:~0,8% :: - (temporary numpy fix) +pip uninstall numpy -y --quiet +pip install numpy==1.26.0 --quiet +echo. +echo :: %time:~0,8% :: Custom node(s) installation ... +echo. +echo :: %time:~0,8% :: - Installing Comfyui Manager +cd custom_nodes +git clone https://github.com/ltdrdata/ComfyUI-Manager.git --quiet +echo :: %time:~0,8% :: - Installing ComfyUI-deepcache +git clone https://github.com/styler00dollar/ComfyUI-deepcache.git --quiet +echo :: %time:~0,8% :: - Installing ComfyUI-Impact-Pack +git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack.git --quiet +cd ComfyUI-Impact-Pack +git clone https://github.com/ltdrdata/ComfyUI-Impact-Subpack impact_subpack --quiet +cd .. +cd .. +echo. +echo :: %time:~0,8% :: - Patching ZLUDA +curl -s -L https://github.com/lshqqytiger/ZLUDA/releases/download/rel.11cc5844514f93161e0e74387f04e2c537705a82/ZLUDA-windows-amd64.zip > zluda.zip +tar -xf zluda.zip +del zluda.zip +copy zluda\cublas.dll venv\Lib\site-packages\torch\lib\cublas64_11.dll /y >NUL +copy zluda\cusparse.dll venv\Lib\site-packages\torch\lib\cusparse64_11.dll /y >NUL +copy zluda\nvrtc.dll venv\Lib\site-packages\torch\lib\nvrtc64_112_0.dll /y >NUL +@echo :: %time:~0,8% :: - ZLUDA is patched. +echo. +set "endTime=%time: =0%" +set "end=!endTime:%time:~8,1%=%%100)*100+1!" & set "start=!startTime:%time:~8,1%=%%100)*100+1!" +set /A "elap=((((10!end:%time:~2,1%=%%100)*60+1!%%100)-((((10!start:%time:~2,1%=%%100)*60+1!%%100), elap-=(elap>>31)*24*60*60*100" +set /A "cc=elap%%100+100,elap/=100,ss=elap%%60+100,elap/=60,mm=elap%%60+100,hh=elap/60+100" +echo ..................................................... +echo *** Installation is completed in %hh:~1%%time:~2,1%%mm:~1%%time:~2,1%%ss:~1%%time:~8,1%%cc:~1% . +echo *** You can use "start.bat" to start the app later. +echo ..................................................... +echo. +echo *** Starting the Comfyui-ZLUDA for the first time, please be patient... +echo. +.\zluda\zluda.exe -- python main.py --auto-launch diff --git a/patchzluda.bat b/patchzluda.bat new file mode 100644 index 000000000..4ea543981 --- /dev/null +++ b/patchzluda.bat @@ -0,0 +1,10 @@ +@Echo off +rmdir /S /q zluda +curl -s -L https://github.com/lshqqytiger/ZLUDA/releases/download/rel.11cc5844514f93161e0e74387f04e2c537705a82/ZLUDA-windows-amd64.zip > zluda.zip +tar -xf zluda.zip +del zluda.zip +copy zluda\cublas.dll venv\Lib\site-packages\torch\lib\cublas64_11.dll /y +copy zluda\cusparse.dll venv\Lib\site-packages\torch\lib\cusparse64_11.dll /y +copy zluda\nvrtc.dll venv\Lib\site-packages\torch\lib\nvrtc64_112_0.dll /y +echo. +@echo * ZLUDA is patched. diff --git a/start.bat b/start.bat new file mode 100644 index 000000000..d8a80ca43 --- /dev/null +++ b/start.bat @@ -0,0 +1,11 @@ +@echo off + +set PYTHON=%~dp0/venv/Scripts/python.exe +set GIT= +set VENV_DIR=./venv +set COMMANDLINE_ARGS=--auto-launch + +echo *** Checking and updating to new version if possible +git pull +echo. +.\zluda\zluda.exe -- %PYTHON% main.py %COMMANDLINE_ARGS%