This is a task management platform designed for Kohya_SS LoRA training. It supports API-based LoRA training task submission, progress tracking, and copying trained LoRA models to Stable Diffusion.
- Deployment
- REST Framework Web Error
- Q&A
- Initialize and Create Superuser
- Project Manager
- Kohya_SS Source Code Replacement
Deploy the project to /root.
If you encounter the following CSRF error in your REST framework:
ajax: {"detail":"CSRF Failed: CSRF token missing or incorrect."}
Update your settings.py with the following configuration:
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
)
}To resolve the demjson 2.2.4 error, upgrade setuptools:
pip install --upgrade setuptools==57.5.0Run the following command to collect static files:
python manage.py collectstaticEnsure your database is created with the correct character set:
CREATE DATABASE mydatabase CHARACTER SET utf8mb4;Install the MySQL client based on your operating system:
CentOS
yum install mysql-devel -y
yum install python-devel -y
pip install mysqlclient -y
Ubuntu
apt-get install libmysql-dev
apt-get install libmysqlclient-dev
apt-get install python3-dev
pip install mysqlclientSet user information in kohya_ss_admin/views.py:64, then run the following commands:
python manage.py makemigrations --settings=kohya_ss_admin.settings api_auth
python manage.py makemigrations --settings=kohya_ss_admin.settings kohya_ss
python manage.py makemigrations --settings=kohya_ss_admin.settings
python manage.py migrate --settings=kohya_ss_admin.settings api_auth
python manage.py migrate --settings=kohya_ss_admin.settings kohya_ss
python manage.py migrate --settings=kohya_ss_admin.settings
python manage.py createsuperuser --settings=kohya_ss_admin.settingsReplace the following files in the Kohya_SS source code:
(/root/kohya_ss)$ git log -1
commit e5e8be05fe0475a04e61ef668afffc632aa178f5 (HEAD -> master, tag: v24.1.7, origin/master, origin/HEAD)
Author: bmaltais <bernard@ducourier.com>
Date: Fri Sep 6 07:01:09 2024 -0400
Update gradio to 4.43.0 to fix issue with fastapi latest release[kohya_ss_source_code_change_file/blip_caption_gui.py] -> kohya_ss/kohya_gui/blip_caption_gui.py
[kohya_ss_source_code_change_file/lora_gui.py] -> kohya_ss/kohya_gui/lora_gui.py
[kohya_ss_source_code_change_file/train_network.py] -> kohya_ss/sd-scripts/train_network.py