Commit
·
f7abfbd
1
Parent(s):
2991e86
Upload 4 files
Browse files- sd/stable-diffusion-webui/extensions/sd-webui-supermerger/.gitignore +131 -0
- sd/stable-diffusion-webui/extensions/sd-webui-supermerger/README.md +126 -0
- sd/stable-diffusion-webui/extensions/sd-webui-supermerger/README_ja.md +126 -0
- sd/stable-diffusion-webui/extensions/sd-webui-supermerger/changelog.md +29 -0
sd/stable-diffusion-webui/extensions/sd-webui-supermerger/.gitignore
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Byte-compiled / optimized / DLL files
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
|
| 6 |
+
changelog.m
|
| 7 |
+
|
| 8 |
+
# C extensions
|
| 9 |
+
*.so
|
| 10 |
+
|
| 11 |
+
# Distribution / packaging
|
| 12 |
+
.Python
|
| 13 |
+
build/
|
| 14 |
+
develop-eggs/
|
| 15 |
+
dist/
|
| 16 |
+
downloads/
|
| 17 |
+
eggs/
|
| 18 |
+
.eggs/
|
| 19 |
+
lib/
|
| 20 |
+
lib64/
|
| 21 |
+
parts/
|
| 22 |
+
sdist/
|
| 23 |
+
var/
|
| 24 |
+
wheels/
|
| 25 |
+
pip-wheel-metadata/
|
| 26 |
+
share/python-wheels/
|
| 27 |
+
*.egg-info/
|
| 28 |
+
.installed.cfg
|
| 29 |
+
*.egg
|
| 30 |
+
MANIFEST
|
| 31 |
+
|
| 32 |
+
# PyInstaller
|
| 33 |
+
# Usually these files are written by a python script from a template
|
| 34 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 35 |
+
*.manifest
|
| 36 |
+
*.spec
|
| 37 |
+
|
| 38 |
+
# Installer logs
|
| 39 |
+
pip-log.txt
|
| 40 |
+
pip-delete-this-directory.txt
|
| 41 |
+
|
| 42 |
+
# Unit test / coverage reports
|
| 43 |
+
htmlcov/
|
| 44 |
+
.tox/
|
| 45 |
+
.nox/
|
| 46 |
+
.coverage
|
| 47 |
+
.coverage.*
|
| 48 |
+
.cache
|
| 49 |
+
nosetests.xml
|
| 50 |
+
coverage.xml
|
| 51 |
+
*.cover
|
| 52 |
+
*.py,cover
|
| 53 |
+
.hypothesis/
|
| 54 |
+
.pytest_cache/
|
| 55 |
+
|
| 56 |
+
# Translations
|
| 57 |
+
*.mo
|
| 58 |
+
*.pot
|
| 59 |
+
|
| 60 |
+
# Django stuff:
|
| 61 |
+
*.log
|
| 62 |
+
local_settings.py
|
| 63 |
+
db.sqlite3
|
| 64 |
+
db.sqlite3-journal
|
| 65 |
+
|
| 66 |
+
# Flask stuff:
|
| 67 |
+
instance/
|
| 68 |
+
.webassets-cache
|
| 69 |
+
|
| 70 |
+
# Scrapy stuff:
|
| 71 |
+
.scrapy
|
| 72 |
+
|
| 73 |
+
# Sphinx documentation
|
| 74 |
+
docs/_build/
|
| 75 |
+
|
| 76 |
+
# PyBuilder
|
| 77 |
+
target/
|
| 78 |
+
|
| 79 |
+
# Jupyter Notebook
|
| 80 |
+
.ipynb_checkpoints
|
| 81 |
+
|
| 82 |
+
# IPython
|
| 83 |
+
profile_default/
|
| 84 |
+
ipython_config.py
|
| 85 |
+
|
| 86 |
+
# pyenv
|
| 87 |
+
.python-version
|
| 88 |
+
|
| 89 |
+
# pipenv
|
| 90 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 91 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 92 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 93 |
+
# install all needed dependencies.
|
| 94 |
+
#Pipfile.lock
|
| 95 |
+
|
| 96 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
| 97 |
+
__pypackages__/
|
| 98 |
+
|
| 99 |
+
# Celery stuff
|
| 100 |
+
celerybeat-schedule
|
| 101 |
+
celerybeat.pid
|
| 102 |
+
|
| 103 |
+
# SageMath parsed files
|
| 104 |
+
*.sage.py
|
| 105 |
+
|
| 106 |
+
# Environments
|
| 107 |
+
.env
|
| 108 |
+
.venv
|
| 109 |
+
env/
|
| 110 |
+
venv/
|
| 111 |
+
ENV/
|
| 112 |
+
env.bak/
|
| 113 |
+
venv.bak/
|
| 114 |
+
|
| 115 |
+
# Spyder project settings
|
| 116 |
+
.spyderproject
|
| 117 |
+
.spyproject
|
| 118 |
+
|
| 119 |
+
# Rope project settings
|
| 120 |
+
.ropeproject
|
| 121 |
+
|
| 122 |
+
# mkdocs documentation
|
| 123 |
+
/site
|
| 124 |
+
|
| 125 |
+
# mypy
|
| 126 |
+
.mypy_cache/
|
| 127 |
+
.dmypy.json
|
| 128 |
+
dmypy.json
|
| 129 |
+
|
| 130 |
+
# Pyre type checker
|
| 131 |
+
.pyre/
|
sd/stable-diffusion-webui/extensions/sd-webui-supermerger/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SuperMerger
|
| 2 |
+
- Model merge extention for [AUTOMATIC1111's stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
|
| 3 |
+
- Merge models can be loaded directly for generation without saving
|
| 4 |
+
|
| 5 |
+
日本語は[こちら](https://github.com/hako-mikan/sd-webui-supermerger/blob/main/README_ja.md)
|
| 6 |
+
|
| 7 |
+
# Recent Update
|
| 8 |
+
All updates can be found [here](https://github.com/hako-mikan/sd-webui-supermerger/blob/ver2/changelog.md)
|
| 9 |
+
|
| 10 |
+
### update 2023.02.20.2000(JST)
|
| 11 |
+
The timing of importing "diffusers" has been changed. With this update, some environments can be started without installing "diffusers".
|
| 12 |
+
|
| 13 |
+
### bug fix 2023.02.19.2330(JST)
|
| 14 |
+
Several bugs have been fixed
|
| 15 |
+
- Error when LOWRAM option is enabled
|
| 16 |
+
- Error on Linux
|
| 17 |
+
- XY plot did not finish properly
|
| 18 |
+
- Error when setting unused models
|
| 19 |
+
|
| 20 |
+
### update to version 3 2023.02.17.2020(JST)
|
| 21 |
+
- Added LoRA related functions
|
| 22 |
+
- Logs can now be saved and settings can be recalled.
|
| 23 |
+
- Save in safetensors and fp16 format is now supported.
|
| 24 |
+
- Weight presets are now supported.
|
| 25 |
+
- Reservation of XY plots is now possible.
|
| 26 |
+
|
| 27 |
+
diffusers must now be installed. on windows, this can be done by typing "pip install diffusers" at the command prompt in the web-ui folder, but it depends on your environment.
|
| 28 |
+
|
| 29 |
+
# overview
|
| 30 |
+
This extension allows merged models to be loaded as models for image generation without saving them.
|
| 31 |
+
This extension can prevent the use of HDD and SSD.
|
| 32 |
+
|
| 33 |
+
## Usage
|
| 34 |
+
|
| 35 |
+
### Merge mode
|
| 36 |
+
#### Weight sum
|
| 37 |
+
Normal merge. alpha is used. if MBW is enabled, MBW base is used as alpha.
|
| 38 |
+
#### Add difference
|
| 39 |
+
Add difference, if MBW is enabled, MBW base is used as alpha
|
| 40 |
+
#### Triple sum
|
| 41 |
+
Merge 3 models at the same time. alpha and beta are used. I added this function because there were three model selection windows, but I am not sure if it works effectively.
|
| 42 |
+
#### sum Twice
|
| 43 |
+
Weight sum twice, alpha and beta are used.
|
| 44 |
+
|
| 45 |
+
### use MBW
|
| 46 |
+
If checked, block-by-block merging is enabled. Use the slider at the bottom of the screen to set the ratio of each block.
|
| 47 |
+
|
| 48 |
+
## Each button
|
| 49 |
+
### Merge
|
| 50 |
+
After merging, load as a model for generation. **Note that a different model is loaded than the model information in the upper left corner.** It will be reset when you re-select the model in the model selection screen on the top left.
|
| 51 |
+
|
| 52 |
+
### Gen.
|
| 53 |
+
Image generation is performed using the settings in the text2image tab.
|
| 54 |
+
|
| 55 |
+
### Merge and Gen
|
| 56 |
+
Merge and Generate image after merging.
|
| 57 |
+
|
| 58 |
+
### Set from ID
|
| 59 |
+
Read settings from merge log. The log is updated each time a merge is performed, and a sequential ID starting from 1 is assigned. Set on -1 will read the last merged configuration. The merge log is saved in extension/sd-webui-supermerger/mergehistory.csv. You can browse and search in the History tab. You can search and/or by separating with a half-width space.
|
| 60 |
+
|
| 61 |
+
### Sequential XY Merge and Generation
|
| 62 |
+
Performs sequential merge image generation. Effective in all merge modes.
|
| 63 |
+
#### alpha,beta
|
| 64 |
+
Change alpha and beta.
|
| 65 |
+
#### alpha and beta
|
| 66 |
+
Change alpha and beta at the same time. Separate alpha and beta with a single space, and separate each element with a comma. If only one number is entered, the same value is entered for both alpha and beta.
|
| 67 |
+
Example: 0,0.5 0.1,0.3 0.4,0.5
|
| 68 |
+
#### MBW
|
| 69 |
+
Performs a block-byblock merge. Enter ratios separated by newlines. Presets can be used, but be careful to **separate on a new line**.For Triple and Twice, enter two lines as a set. An odd number of lines will result in an error.
|
| 70 |
+
#### seed
|
| 71 |
+
Changes the seed. Entering -1 will result in a fixed seed in the opposite axis direction.
|
| 72 |
+
#### model_A,B,C
|
| 73 |
+
Changes the model. The model selected in the model selection window is ignored.
|
| 74 |
+
#### pinpoint blocks
|
| 75 |
+
Changes only specific blocks in MBW. Choose alpha or beta for the opposite axis. If you enter a block ID, the alpha (beta) will change only for that block. As with the other types, use commas to separate them. Multiple blocks can be changed at the same time by separating them with a space or hyphen. NOT must be entered first to have any effect.
|
| 76 |
+
##### Input example
|
| 77 |
+
IN01,OUT10 OUT11, OUT03-OUT06,OUT07-OUT11,NOT M00 OUT03-OUT06
|
| 78 |
+
In this case
|
| 79 |
+
- 1:Only IN01 changes
|
| 80 |
+
- 2:OUT10 and OUT11 change
|
| 81 |
+
- 3:OUT03 to OUT06 change
|
| 82 |
+
- 4:OUT07 to OUT11 change
|
| 83 |
+
- 5:All except for M00 and OUT03 to OUT06 are changed.
|
| 84 |
+
|
| 85 |
+
Please be careful not to forget to input "0".
|
| 86 |
+

|
| 87 |
+
|
| 88 |
+
Block ID (only upper case letters are valid)
|
| 89 |
+
BASE,IN00,IN01,IN02,IN03,IN04,IN05,IN06,IN07,IN08,IN09,IN10,IN11,M00,OUT00,OUT01,OUT02,OUT03,OUT04,OUT05,OUT06,OUT07,OUT08,OUT09, OUT10,OUT11
|
| 90 |
+
|
| 91 |
+
### Reserve XY plot
|
| 92 |
+
The Reserve XY plot button reserves the execution of an XY plot for the setting at the time the button is pressed, instead of immediately executing the plot. The reserved XY plot will be executed after the normal XY plot is completed or by pressing the Start XY plot button on the Reservation tab. Reservations can be made at any time during the execution or non-execution of an XY plot. The reservation list is not automatically updated, so use the Reload button. If an error occurs, the plot is discarded and the next reservation is executed. Images will not be displayed until all reservations are finished, but those that have been marked "Finished" have finished generating the grid and can be viewed in the Image Browser or other applications.
|
| 93 |
+
|
| 94 |
+
### About Cache
|
| 95 |
+
By storing models in memory, continuous merging and other operations can be sped up.
|
| 96 |
+
Cache settings can be configured from web-ui's setting menu.
|
| 97 |
+
|
| 98 |
+
### unload button
|
| 99 |
+
Deletes the currently loaded model. This is used to free up GPU memory when using kohya-ss GUI. Once the model is deleted, you will not be able to generate images. If you want to generate images, please re-select models.
|
| 100 |
+
|
| 101 |
+
## LoRA
|
| 102 |
+
LoRA related functions. It is basically the same as kohya-ss scripts, but it supports block-by-block merging. Currently, it does not support V2.X series merging.
|
| 103 |
+
### merge to checkpoint
|
| 104 |
+
Merge LoRAs into a model. Multiple LoRAs can be merged at the same time.
|
| 105 |
+
Enter LoRA name1:ratio1:block1,LoRA name2:ratio2:block2,...
|
| 106 |
+
LoRA can also be used alone. The ":block" part can be omitted. The ratio can be any value, including negative values. There is no restriction that the total must sum to 1 (of course, if it greatly exceeds 1, it will break down).
|
| 107 |
+
|
| 108 |
+
### Make LoRA
|
| 109 |
+
Generates a LoRA from the difference of two models.
|
| 110 |
+
If you specify a demension, it will be created with the specified dimension. If no demension is specified, LoRAs are created with dim 128.
|
| 111 |
+
|
| 112 |
+
### merge LoRAs
|
| 113 |
+
Merges one or more LoRAs. kohya-ss's latest script is used, so LoRAs with different dimensions can be merged, but note that the generated images may differ significantly because LoRAs are recalculated when dimensions are converted.
|
| 114 |
+
|
| 115 |
+
The calculate dimention button calculates the dimensions of each LoRA and activates the display and sorting functions. The calculation is rather time-consuming and takes several tens of seconds for a LoRA of about 50. Newly merged LoRAs will not appear in the list, so please press the reload button. Dimension recalculation only calculates the added LoRAs.
|
| 116 |
+
|
| 117 |
+
### Difference between Normal Merge and SAME TO STRENGTH
|
| 118 |
+
If the same to Strength option is not used, the result is the same as the merge in the script created by kohya-ss. In this case, the result is different from the case where LoRA is applied on Web-ui as shown in the figure below. The reason for this is related to the mathematical formula used to adopt LoRA into U-net. kohya-ss's script multiplies the ratio as it is, but the formula used to apply LoRA squares the ratio, so if the ratio is set to a number other than 1, or to a negative value, the result will differ from Strength (strength when applied). Using the SAME TO STRENGTH option, the square root of the ratio is driven at merge time, so that Strength and the ratio are calculated to have the same meaning at apply time. It is also calculated so that a negative value will have the same effect. If you are not doing additional learning, for example, you may be fine using the SAME TO STRENGTH option, but if you are doing additional learning on the merged LoRA, you may not want to use anyone else's option.
|
| 119 |
+
The following figures show the generated images for each case of normal image generation/same to Strength option/normal merge, using merged LoRAs of figmization and ukiyoE. You can see that in the case of normal merge, even in the negative direction, the image is squared and positive.
|
| 120 |
+

|
| 121 |
+
|
| 122 |
+
For hierarchical merges see
|
| 123 |
+
|
| 124 |
+
https://github.com/bbc-mc/sdweb-merge-block-weighted-gui
|
| 125 |
+
|
| 126 |
+
This script uses some scripts from web-ui, mbw-merge and kohya-ss
|
sd/stable-diffusion-webui/extensions/sd-webui-supermerger/README_ja.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SuperMerger
|
| 2 |
+
- Model merge extention for [AUTOMATIC1111's stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
|
| 3 |
+
- Merge models can be loaded directly for generation without saving
|
| 4 |
+
|
| 5 |
+
# Recent Update
|
| 6 |
+
すべての更新履歴は[こちら](https://github.com/hako-mikan/sd-webui-supermerger/blob/ver2/changelog.md)にあります。
|
| 7 |
+
All updates can be found [here](https://github.com/hako-mikan/sd-webui-supermerger/blob/ver2/changelog.md).
|
| 8 |
+
|
| 9 |
+
### update 2023.02.20.2000(JST)
|
| 10 |
+
"diffusers"をインポートするタイミングを変更しました。このアップデートにより、環境によっては"diffusers"のインストールなしに起動できるようになります。
|
| 11 |
+
|
| 12 |
+
### bug fix 2023.02.19.2330(JST)
|
| 13 |
+
いくつかのバグが修正されました
|
| 14 |
+
- LOWRAMオプション有効時にエラーになる問題
|
| 15 |
+
- Linuxでエラーになる問題
|
| 16 |
+
- XY plotが正常に終了しない問題
|
| 17 |
+
- 未ロードのモデルを設定時にエラーになる問題
|
| 18 |
+
|
| 19 |
+
### update to version 3 2023.02.17.2020(JST)
|
| 20 |
+
- LoRA関係の機能を追加しました
|
| 21 |
+
- Logを保存し、設定を呼び出せるようになりました
|
| 22 |
+
- safetensors,fp16形式での保存に対応しました
|
| 23 |
+
- weightのプリセットに対応しました
|
| 24 |
+
- XYプロットの予約が可能になりました
|
| 25 |
+
|
| 26 |
+
diffusersのインストールが必要になりました。windowsの場合はweb-uiのフォルダでコマンドプロンプトから"pip install diffusers"を打つことでインストールできる場合がありますが環境によります。
|
| 27 |
+
#
|
| 28 |
+
|
| 29 |
+
# 概要
|
| 30 |
+
このextentionではモデルをマージした際、保存せずに画像生成用のモデルとして読み込むことができます。
|
| 31 |
+
これまでマージしたモデルはいったん保存して気に入らなければ削除するということが必要でしたが、このextentionを使うことでHDDやSSDの消耗を防ぐことができます。
|
| 32 |
+
|
| 33 |
+
## 使い方
|
| 34 |
+
|
| 35 |
+
### マージモード
|
| 36 |
+
#### Weight sum
|
| 37 |
+
通常のマージです。alphaが使用されます。MBWが有効になっている場合はMBWのbaseがアルファとして使われます
|
| 38 |
+
#### Add difference
|
| 39 |
+
差分マージです。MBWが有効になっている場合はMBWのbaseがアルファとして使われます
|
| 40 |
+
#### Triple sum
|
| 41 |
+
マージを3モデル同時に行います。alpha,betaが使用されます。モデル選択窓が3つあったので追加した機能ですが、有効に働かうかはわかりません。MBWでも使えます。それぞれMBWのalpha,betaを入力してください。
|
| 42 |
+
#### sum Twice
|
| 43 |
+
Weight sumを2回行います。alpha,betaが使用されます。MBWモードでも使えます。それぞれMBWのalpha,betaを入力してください。
|
| 44 |
+
|
| 45 |
+
### use MBW
|
| 46 |
+
チェックするとブロックごとのマージが有効になります。各ブロックごとの比率は下部のスライダーなどで設定してください。
|
| 47 |
+
|
| 48 |
+
## 各ボタン
|
| 49 |
+
### Merge
|
| 50 |
+
マージした後、生成用モデルとして読み込みます。 __左上のモデル情報とは違うモデルがロードされていることに注意してください。__ 左上のモデル選択画面でモデルを選択しなおすとリセットされます
|
| 51 |
+
|
| 52 |
+
### Gen
|
| 53 |
+
text2imageタブの設定で画像生成を行います
|
| 54 |
+
|
| 55 |
+
### Merge and Gen
|
| 56 |
+
マージしたのち画像を生成します
|
| 57 |
+
|
| 58 |
+
### Set from ID
|
| 59 |
+
マージログから設定を読み込みます。ログはマージが行われるたびに更新され、1から始まる連番のIDが付与されます。IDを生成される画像やPNG infoに記載することも可能で、write merged model ID toから設定してください。-1でSetをすると最後にマージした設定を読み出します。マージログはextention/sd-webui-supermerger/mergehistory.csvに保存されます。他アプリで開いた状態だと読み取りエラーを起こすので注意してください。Historyタブで閲覧や検索が可能です。検索は半角スペースで区切ることでand/or検索が可能です。
|
| 60 |
+
|
| 61 |
+
### Sequential XY Merge and Generation
|
| 62 |
+
連続マージ画像生成を行います。すべてのマージモードで有効です。
|
| 63 |
+
#### alpha,beta
|
| 64 |
+
アルファ、ベータを変更します。
|
| 65 |
+
#### alpha and beta
|
| 66 |
+
アルファ、ベータを同時に変更します。アルファ、ベータの間は半角スペースで区切り、各要素はカンマで区切ってください。数字ひとつの場合はアルファベータ共に同じ値が入力されます。
|
| 67 |
+
例: 0,0.5 0.1,0.3 0.4,0.5
|
| 68 |
+
#### MBW
|
| 69 |
+
階層マージを行います。改行で区切った比率を入力してください。プリセットも使用可能ですが、**改行で区切る**ことに注意をして下さい。Triple,Twiceの場合は2行で1セットで入力して下さい。奇数行だとエラーになります。
|
| 70 |
+
#### seed
|
| 71 |
+
シードを変更します。-1と入力すると、反対の軸方向には固定されたseedになります。
|
| 72 |
+
#### model_A,B,C
|
| 73 |
+
モデルを変更します。モデル選択窓で選択されたモデルは無視されます。
|
| 74 |
+
#### pinpoint blocks
|
| 75 |
+
MBWにおいて特定のブロックのみを変化させます。反対の軸はalphaまたはbetaを選んでください。ブロックIDを入力すると、そのブロックのみalpha(beta)が変わります。他のタイプと同様にカンマで区切ります。スペースまたはハイフンで区切ることで複数のブロックを同時に変化させることもできます。最初にNOTをつけることで変化対象が反転します。NOT IN09-OUT02とすると、IN09-OUT02以外が変化します。NOTは最初に入力しないと効果がありません。
|
| 76 |
+
##### 入力例
|
| 77 |
+
IN01,OUT10 OUT11, OUT03-OUT06,OUT07-OUT11,NOT M00 OUT03-OUT06
|
| 78 |
+
この場合
|
| 79 |
+
- 1:IN01のみ変化
|
| 80 |
+
- 2:OUT10およびOUT11が変化
|
| 81 |
+
- 3:OUT03からOUT06が変化
|
| 82 |
+
- 4:OUT07からOUT11が変化
|
| 83 |
+
- 5:M00およびOUT03からOUT06以外が変化
|
| 84 |
+
|
| 85 |
+
となります。0の打ち忘れに注意してください。
|
| 86 |
+

|
| 87 |
+
|
| 88 |
+
ブロックID(大文字のみ有効)
|
| 89 |
+
BASE,IN00,IN01,IN02,IN03,IN04,IN05,IN06,IN07,IN08,IN09,IN10,IN11,M00,OUT00,OUT01,OUT02,OUT03,OUT04,OUT05,OUT06,OUT07,OUT08,OUT09,OUT10,OUT11
|
| 90 |
+
|
| 91 |
+
### XYプロットの予約
|
| 92 |
+
Reserve XY plotボタンはすぐさまプロットを実行せず、ボタンを押したときの設定のXYプロットの実行を予約します。予約したXYプロットは通常のXYプロットが終了した後か、ReservationタブのStart XY plotボタンを押すと実行が開始されます。予約はXYプロット実行時・未実行時いつでも可能です。予約一覧は自動更新されないのでリロードボタンを使用してください。エラー発生時はそのプロットを破棄して次の予約を実行します。すべての予約が終了するまで画像は表示されませんが、Finishedになったものについてはグリッドの生成は終わっているので、Image Browser等で見ることが可能です。
|
| 93 |
+
|
| 94 |
+
### キャッシュについて
|
| 95 |
+
モデルをメモリ上に保存することにより連続マージなどを高速化することができます。
|
| 96 |
+
キャッシュの設定はweb-uiのsettingから行ってください。
|
| 97 |
+
|
| 98 |
+
### unloadボタン
|
| 99 |
+
現在ロードされているモデルを消去します。これはkohya-ssのGUIを使用するときなどGPUメモリを開放するときに使用します。消去すると画像の生成はできません。生成する場合にはモデルを選び直して下さい。
|
| 100 |
+
|
| 101 |
+
## LoRA
|
| 102 |
+
LoRA関連の機能です。基本的にはkohya-ssのスクリプトと同じですが、階層マージに対応します。現時点ではV2.X系のマージには対応していません。
|
| 103 |
+
### merge to checkpoint
|
| 104 |
+
モデルにLoRAをマージします。複数のLoRAを同時にマージできます。
|
| 105 |
+
LoRA名1:マージ比率1:階層,LoRA名2:階層,マージ比率2,LoRA名3:マージ比率3・・・
|
| 106 |
+
と入力します。LoRA単独でも使用可能です。「:階層」の部分は無くても問題ありません。比率はマイナスを含めどんな値でも入力できます。合計が1にならないといけないという制約もありません(もちろん大きく1を越えると破綻します)。
|
| 107 |
+
|
| 108 |
+
### Make LoRA
|
| 109 |
+
ふたつのモデルの差分からLoRAを生成します。
|
| 110 |
+
demensionを指定すると指定されたdimensionで作製されます。無指定の場合は128で作製します。
|
| 111 |
+
|
| 112 |
+
### merge LoRAs
|
| 113 |
+
ひとつまたは複数のLoRA同士をマージします。kohya-ss氏の最新のスクリプトを使用しているので、dimensionの異なるLoRA同氏もマージ可能ですが、dimensionの変換の際はLoRAの再計算を行うため、生成される画像が大きく異なる可能性があることに注意してください。
|
| 114 |
+
|
| 115 |
+
calculate dimentionボタンで各LoRAの次元を計算して表示・ソート機能が有効化します。計算にはわりと時間がかかって、50程度のLoRAでも数十秒かかります。新しくマージされたLoRAはリストに表示されないのでリロードボタンを押してください。次元の再計算は追加されたLoRAだけを計算します。
|
| 116 |
+
|
| 117 |
+
### 通常マージとsame to Strengthの違い
|
| 118 |
+
same to Strengthオプションを使用しない場合は、kohya-ss氏の作製したスクリプトのマージと同じ結果になります。この場合、下図のようにWeb-ui上でLoRAを適用した場合と異なる結果になります。これはLoRAをU-netに組み込む際の数式が関係しています。kohya-ss氏のスクリプトでは比率をそのまま掛けていますが、適用時の数式では比率が2乗されてしまうため、比率を1以外の数値に設定すると、あるいはマイナスに設定するとStrength(適用時の強度)と異なる結果となります。same to Strengthオプションを使用すると、マージ時には比率の平方根を駆けることで、適用時にはStrengthと比率が同じ意味を持つように計算しています。また、マイナスが効果が出るようにも計算しています。追加学習をしない場合などはsame to Strengthオプションを使用しても問題ないと思いますが、マージしたLoRAに対して追加学習をする場合はだれも使用しない方がいいかもしれません。
|
| 119 |
+
下図は通常適用/same to Strengthオプション/通常マージの各場合の生成画像です。figma化とukiyoE LoRAのマージを使用しています。通常マージの場合はマイナス方向でも2乗されてプラスになっていることが分かります。
|
| 120 |
+

|
| 121 |
+
|
| 122 |
+
階層別マージについては下記を参照してください
|
| 123 |
+
|
| 124 |
+
https://github.com/bbc-mc/sdweb-merge-block-weighted-gui
|
| 125 |
+
|
| 126 |
+
このスクリプトではweb-ui、mbw-merge、kohya-ssのスクリプトを一部使用しています
|
sd/stable-diffusion-webui/extensions/sd-webui-supermerger/changelog.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelog
|
| 2 |
+
### bug fix 2023.01.29.0000(JST)
|
| 3 |
+
pinpoint blocksがX方向で使用できない問題を修正しました。
|
| 4 |
+
pinpoint blocks選択時Triple,Twiceを使用できない問題を解決しました
|
| 5 |
+
XY plot 使用時に一部軸タイプでMBWを使用できない問題を解決しました
|
| 6 |
+
Fixed a problem where pinpoint blocks could not be used in the X axis.
|
| 7 |
+
Fixed a problem in which Triple,Twice could not be used when selecting pinpoint blocks.
|
| 8 |
+
Problem solved where MBW could not be used with some axis types when using XY plot.
|
| 9 |
+
|
| 10 |
+
### bug fixed 2023.01.28.0100(JST)
|
| 11 |
+
MBWモードでSave current modelボタンが正常に動作しない問題を解決しました
|
| 12 |
+
ファイル名が長すぎて保存時にエラーが出る問題を解決しました
|
| 13 |
+
Problem solved where the "Save current model" button would not work properly in MBW mode
|
| 14 |
+
Problem solved where an error would occur when saving a file with too long a file name
|
| 15 |
+
|
| 16 |
+
### bug fixed 2023.01.26.2100(JST)
|
| 17 |
+
XY plotにおいてタイプMBWが使用できない不具合を修正しました
|
| 18 |
+
Fixed a bug that type of MBW could work in XY plot
|
| 19 |
+
|
| 20 |
+
### updated 2023.01.25.0000(JST)
|
| 21 |
+
added several features
|
| 22 |
+
- added new merge mode "Triple sum","sum Twice"
|
| 23 |
+
- added XY plot
|
| 24 |
+
- 新しいマージモードを追加しました "Triple sum","sum Twice"
|
| 25 |
+
- XY plot機能を追加しました
|
| 26 |
+
|
| 27 |
+
### bug fixed 2023.01.20.2350(JST)
|
| 28 |
+
png infoがうまく保存できない問題を解決しました。
|
| 29 |
+
Problem solved where png info could not be saved properly.
|