WHAT THE FAQ

BACKUP – Automatic1111 WebUI

Примерный порядок действий по созданию резервной копии и разворачиванию её на новом окружении

Потребовалось накатить чистую версию Automatic1111 WebUI и аккуратно перенести туда настройки из бывшей рабочей версии. На всякий случай записал последовательность всех действий, чтобы ничего не забыть и не потерять.

Эксперимента ради установил портативную сборку от Automatic1111 и удалил системный Python со всеми насыпанными пакетами. 

Примечания

1. Способ усложнён ручным копированием файлов настроек расширений. Если вы уверены, что все расширения рабочие и не хотите заморачиваться — просто скопируйте папку extensions из старого окружения в новое.

2. На моей машине в чистой версии WebUI не сработал штатный механизм восстановлений настроек (Extensions → Backup/Restore → Restore Selected Config), поэтому пришлось устанавливать всё вручную. Завёл карточку на гитхабе. Или помогут решить проблему, или подскажут где я напапуасил.

Этап 1: Сохраняем в отдельную папку важные файлы

Желательно не просто копировать файлы, а сохранить структуру каталогов, чтобы при разворачивании резервной копии просто перенести все файлы разом.

Например, создаём папку extensions, в неё кладём пустую папку a1111-sd-webui-tagcomplete, в неё кладём пустую папку tags и уже в неё копируем все словари.

1. Файлы конфигурации

— webui-user.bat (настройки запуска сервера)

— config.json (настройки сервера)

— ui-config.json (настройки интерфейса)

— styles.csv (промпты ваших стилей)

— style.css (внешний вид интерфейса, если вы устанавливали кастомный)

2. Список расширений

• В старой версии WebUI: Extensions → Backup/Restore → State to restore → both → (можно ввести имя резервной копии) → Save Current Config

Сохранённый файл лежит в webui\config_states, перемещаем его в аналогичную папку новой версии.

• Либо скопировать адреса расширений для ручной установки.

3. Файлы расширений

Все данные хранятся в папке \extensions

a1111-sd-webui-tagcomplete

a1111-sd-webui-tagcomplete\tags — все файлы

Config-Presets

Все файлы .txt и .json из папки расширения

sd-infinity-grid-generator-script

sd-infinity-grid-generator-script\assets — ваши шаблоны таблиц в формате yaml

–sd-webui-ar-plus

aspect_ratios.txt и resolutions.txt

sd-webui-controlnet

Папку annotator целиком, если не хотите заново качать все препроцессоры (5-7 гигабайт).

— stable-diffusion-webui-wildcards

Папку wildcards целиком.

4. Модели, LoRA, VAE, ControlNet, апскейлеры, гиперсети и прочее.

Папка models в корне окружения, необходимо скопировать целиком.

5. Скрипты

Папка scripts в корне окружения. Необходимо сохранить всё, что вы добавили сами. Например: alternate_sampler_noise_schedules или Revision by XpucT.

6. Эмбеддинги

Папка embeddings в корне окружения, необходимо скопировать целиком.

7. Последнее, но самое ценное

Папка outputs в корне окружения. Здесь лежат все ваши изображения и матрицы.

Этап 2: разворачиваем резервную копию в новом окружении

1. Запускаем сервер, проверяем что всё работает и картинки генерируются. 

2. WebUI Settings  → Apply Settings.

3. Устанавливаем все расширения

— Вручную: Extensions → Install from URL → URL for extension’s git repository

— Штатным способом: Extensions → Backup/Restore → Restore Selected Config → OК

4. Выключаем сервер, копируем в новое окружение все папки и файлы, которые вы сохраняли на этапе 1.

5. Устанавливаем свежие библиотеки cuDNN, ускорит генерацию на 5-10% (только для NVidia 2xxx и выше)

• Регистрируемся на сайте разработчиков NVidia https://developer.nvidia.com/cudnn

• Переходим в раздел скачивания cuDNN, выбираем cuDNN for CUDA 11.x, скачиваем архив под свою платформу.

• Распаковываем архив, переносим с заменой содержимое папки bin в папку \venv\Lib\site-packages\torch\lib вашего окружения.

6. Запускаем сервер, проверяем что всё на месте и всё работает.

 

*****************************************

An approximate procedure for creating a backup and deploying it to a new environment

It was necessary to roll up a clean version of Automatic1111 WebUI and carefully transfer the settings there from the former working version. Just in case, I wrote down the sequence of all actions so as not to forget or lose anything.

For the sake of experiment, I installed a portable assembly from Automatic1111 and removed the system Python with all the packages poured in.

Notes

1. The method is complicated by manual copying of extension settings files. If you are sure that all extensions are working and don’t want to bother, just copy the extensions folder from the old environment to the new one.

2. On my machine in a clean version of WebUI, the standard mechanism for restoring settings (Extensions → Backup / Restore → Restore Selected Config) did not work, so I had to install everything manually. Got a card on github. Either they will help solve the problem, or they will tell you where I messed up.

Stage 1: Save important files in a separate folder

It is advisable not just to copy files, but to preserve the directory structure, so that when deploying a backup, you can simply transfer all the files at once.

For example, create an extensions folder, put an empty a1111-sd-webui-tagcomplete folder in it, put an empty tags folder in it, and copy all the dictionaries into it.

1. Configuration files

– webui-user.bat (server startup settings)

– config.json (server settings)

– ui-config.json (interface settings)

– styles.csv (prompts for your styles)

– style.css (appearance of the interface, if you installed a custom one)

2. List of extensions

• In the old version of WebUI: Extensions → Backup/Restore → State to restore → both → (you can enter a backup name) → Save Current Config

The saved file is in webui\config_states, move it to the same folder of the new version.

• Or copy the addresses of extensions for manual installation.

3. Extension files

All data is stored in the \extensions folder

a1111-sd-webui-tagcomplete

a1111-sd-webui-tagcomplete\tags – all files

– Config-Presets

All .txt and .json files from extension folder

– sd-infinity-grid-generator-script

sd-infinity-grid-generator-script\assets – your table templates in yaml format

–sd-webui-ar-plus

aspect_ratios.txt and resolutions.txt

– sd-webui-controlnet

The entire annotator folder if you don’t want to redownload all preprocessors (5-7 gigabytes).

-stable-diffusion-webui-wildcards

The entire wildcards folder.

4. Models, LoRA, VAE, ControlNet, upscalers, hypernets and more.

The models folder in the root of the environment must be copied in its entirety.

5. Scripts

The scripts folder at the root of the environment. It is necessary to save everything that you have added yourself. For example: alternate_sampler_noise_schedules or Revision by XpucT.

6. Embeddings

The embeddings folder at the root of the environment must be copied in its entirety.

7. Last but most valuable

The outputs folder at the root of the environment. This is where all your images and matrices lie.

Stage 2: Deploy the backup in a new environment

1. We start the server, check that everything works and pictures are generated.

2. WebUI Settings → Apply Settings.

3. Install all extensions

– Manually: Extensions → Install from URL → URL for extension’s git repository

– In the regular way: Extensions → Backup / Restore → Restore Selected Config → OK

4. Turn off the server, copy all the folders and files that you saved in step 1 to the new environment.

5. Install fresh cuDNN libraries, speed up generation by 5-10% (only for NVidia 2xxx and above)

• Register on the NVidia developer site https://developer.nvidia.com/cudnn

• Go to the cuDNN download section, select cuDNN for CUDA 11.x, download the archive for your platform.

• Unpack the archive, transfer the contents of the bin folder with the replacement to the \venv\Lib\site-packages\torch\lib folder of your environment.

6. We start the server, we check that everything is in place and everything works.

Exit mobile version