Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Content

Table of Contents

Fork and customize example

SD.Next initial customization example

fork based on dev

Code Block
# Fork and make branch with some customization
# pytorch branch
cd ~/repo; rm -Rf sdnext; git clone https://github.com/liutyi/sdnext.git; 
cd sdnext; 
git config pull.rebase true; 
git pull; 
git checkout dev; 
git push origin :pytorch; 
git push origin :ipex; 
git branch --copy dev pytorch 
git branch --copy dev ipex

git switch pytorch 
# Add scheduler
git submodule add https://github.com/liutyi/sdnext-scheduler extensions-builtin/sdnext-scheduler 

#fix ipexrun to support 2.7.10
sed -i 's/exec ipexrun.*/exec ipexrun xpu launch.py "\$@"/g' webui.sh

#long filenames
sed -i 's/"samples_filename_pattern":.*/"samples_filename_pattern": OptionInfo("[date]-[seq]-[model_name]-[width]x[height]-Seed[seed]-CFG[cfg]-AG[pag]-STEP[steps]", "Images filename pattern", component_args=hide_dirs),/g' ./modules/sharedui_definitions.py

#long UI timeout
sed -i 's/"ui_request_timeout":.*/"ui_request_timeout": OptionInfo(300000, "UI request timeout", gr.Slider, {"minimum": 1000, "maximum": 300000, "step": 10}),/g' ./modules/sharedui_definitions.py


#default to Standard theme
sed -i 's/"theme_type":.*/"theme_type": OptionInfo("Standard", "Theme type", gr.Radio, {"choices": ["Modern", "Standard", "None"]}),/g' ./modules/sharedui_definitions.py

git add .
git commit -m "Standart theme, long filenames, long UI timeout, ipexrun fix"
git push origin pytorch

git switch ipex
# Add scheduler
git submodule add https://github.com/liutyi/sdnext-scheduler extensions-builtin/sdnext-scheduler 

#fix ipexrun to support 2.7.10
sed -i 's/exec ipexrun.*/exec ipexrun xpu launch.py "\$@"/g' webui.sh

#long filenames
sed -i 's/"samples_filename_pattern":.*/"samples_filename_pattern": OptionInfo("[date]-[seq]-[model_name]-[width]x[height]-Seed[seed]-CFG[cfg]-AG[pag]-STEP[steps]", "Images filename pattern", component_args=hide_dirs),/g' ./modules/ui_definitions.py

#long UI timeout
sed -i 's/"ui_request_timeout":.*/"ui_request_timeout": OptionInfo(300000, "UI request timeout", gr.Slider, {"minimum": 1000, "maximum": 300000, "step": 10}),/g' ./modules/ui_definitions.py


#default to Standard theme
sed -i 's/"theme_type":.*/"theme_type": OptionInfo("Standard", "Theme type", gr.Radio, {"choices": ["Modern", "Standard", "None"]}),/g' ./modules/ui_definitions.py

git add .
git commit -m "Standart theme, long filenames, long UI timeout, ipexrun fix"
git push origin ipex

# for ipex branch that is also installer to be fixed (manually)

fork based on master

Code Block
collapsetrue
# Fork and make branch with some customization
# pytorch branch
cd ~/repo; rm -Rf sdnext; git clone https://github.com/liutyi/sdnext.git; 
cd sdnext; 
git config pull.rebase true; 
git pull; 
git checkout master; 
git push origin :pytorch; 
git push origin :ipex; 
git branch --copy master pytorch 
git branch --copy master ipex

git switch pytorch 
# Add scheduler
git submodule add https://github.com/liutyi/sdnext-scheduler extensions-builtin/sdnext-scheduler 

#fix ipexrun to support 2.7.10
sed -i 's/exec ipexrun.*/exec ipexrun xpu launch.py "\$@"/g' webui.sh

#long filenames
sed -i 's/"samples_filename_pattern":.*/"samples_filename_pattern": OptionInfo("[date]-[seq]-[model_name]-[width]x[height]-Seed[seed]-CFG[cfg]-AG[pag]-STEP[steps]", "Images filename pattern", component_args=hide_dirs),/g' ./modules/ui_definitions.py

#long UI timeout
sed -i 's/"ui_request_timeout":.*/"ui_request_timeout": OptionInfo(300000, "UI request timeout", gr.Slider, {"minimum": 1000, "maximum": 300000, "step": 10}),/g' ./modules/ui_definitions.py


#default to Standard theme
sed -i 's/"theme_type":.*/"theme_type": OptionInfo("Standard", "Theme type", gr.Radio, {"choices": ["Modern", "Standard", "None"]}),/g' ./modules/ui_definitions.py

git add .
git commit -m "Standart theme, long filenames, long UI timeout, ipexrun fix"
git push origin pytorch

git switch ipex
# Add scheduler
git submodule add https://github.com/liutyi/sdnext-scheduler extensions-builtin/sdnext-scheduler 

#fix ipexrun to support 2.7.10
sed -i 's/exec ipexrun.*/exec ipexrun xpu launch.py "\$@"/g' webui.sh

#long filenames
sed -i 's/"samples_filename_pattern":.*/"samples_filename_pattern": OptionInfo("[date]-[seq]-[model_name]-[width]x[height]-Seed[seed]-CFG[cfg]-AG[pag]-STEP[steps]", "Images filename pattern", component_args=hide_dirs),/g' ./modules/sharedui_definitions.py

#long UI timeout
sed -i 's/"ui_request_timeout":.*/"ui_request_timeout": OptionInfo(300000, "UI request timeout", gr.Slider, {"minimum": 1000, "maximum": 300000, "step": 10}),/g' ./modules/sharedui_definitions.py


#default to Standard theme
sed -i 's/"theme_type":.*/"theme_type": OptionInfo("Standard", "Theme type", gr.Radio, {"choices": ["Modern", "Standard", "None"]}),/g' ./modules/sharedui_definitions.py

git add .
git commit -m "Standart theme, long filenames, long UI timeout, ipexrun fix"
git push origin ipex

# for ipex branch that is also installer to be fixed (manually)

...

Code Block
vi installer.py
git add installer.py
git commit -m "ipex 2.7.10+xpu instead of pytorch 2.10.0latest pytorch"
git push origin ipex
Code Block
-        torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.10.0+xpu torchvision==0.25.0+xpu --index-url https://download.pytorch.org/whl/xpu')
+        torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.7.1+xpu torchvision==0.22.1+xpu torchaudio==2.7.1+xpu --index-url https://download.pytorch.org/whl/xpu')
+        install(os.environ.get('TORCH_COMMAND', 'torch==2.7.1+xpu torchvision==0.22.1+xpu torchaudio==2.7.1+xpu --index-url https://download.pytorch.org/whl/xpu'), ignore=True)
+        install(os.environ.get('TORCH_COMMAND', 'intel-extension-for-pytorch==2.7.10+xpu oneccl_bind_pt==2.7.0+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/'), ignore=True)

...

Code Block
cd ~/repo; rm -Rf sdnext; git clone https://github.com/liutyi/sdnext.git; cd sdnext; git config pull.rebase true; git pull; git checkout dev && git pull && git checkout pytorch && git pull && git fetch && git pull origin dev && git pull origin pytorch && git push origin pytorch && cd ~/repo/sdnext && git pull && git checkout dev && git pull && git checkout ipex && git pull && git fetch && git pull origin dev && git pull origin ipex && git push origin ipex

in case of fork from master

Code Block
collapsetrue
cd ~/repo; rm -Rf sdnext; git clone https://github.com/liutyi/sdnext.git; cd sdnext; git config pull.rebase true; git pull; git checkout master && git pull && git checkout pytorch && git pull && git fetch && git pull origin master && git pull origin pytorch && git push origin pytorch && cd ~/repo/sdnext && git pull && git checkout master && git pull && git checkout ipex && git pull && git fetch && git pull origin master && git pull origin ipex && git push origin ipex


Add not yet merged upstream branch

Code Block
git remote add upstream https://github.com/vladmandic/sdnext
git fetch upstream
git checkout -b qwen upstream/feat/qwen-image-2.1

# add fork difference
git submodule add https://github.com/liutyi/sdnext-scheduler extensions-builtin/sdnext-scheduler 
sed -i 's/exec ipexrun.*/exec ipexrun xpu launch.py "\$@"/g' webui.sh
sed -i 's/"samples_filename_pattern":.*/"samples_filename_pattern": OptionInfo("[date]-[seq]-[model_name]-[width]x[height]-Seed[seed]-CFG[cfg]-AG[pag]-STEP[steps]", "Images filename pattern", component_args=hide_dirs),/g' ./modules/ui_definitions.py
sed -i 's/"ui_request_timeout":.*/"ui_request_timeout": OptionInfo(300000, "UI request timeout", gr.Slider, {"minimum": 1000, "maximum": 300000, "step": 10}),/g' ./modules/ui_definitions.py
sed -i 's/"theme_type":.*/"theme_type": OptionInfo("Standard", "Theme type", gr.Radio, {"choices": ["Modern", "Standard", "None"]}),/g' ./modules/ui_definitions.py
git add .
git commit -m "Standart theme, long filenames, long UI timeout, ipexrun fix"
# push branch
git push origin qwen