LoCon script auto upgrade feature
This commit is contained in:
parent
f6bec77eaa
commit
d76fe7d4e0
22
lora_gui.py
22
lora_gui.py
@ -10,7 +10,6 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import pathlib
|
import pathlib
|
||||||
import argparse
|
import argparse
|
||||||
import shutil
|
|
||||||
from library.common_gui import (
|
from library.common_gui import (
|
||||||
get_folder_path,
|
get_folder_path,
|
||||||
remove_doublequote,
|
remove_doublequote,
|
||||||
@ -44,12 +43,18 @@ folder_symbol = '\U0001f4c2' # 📂
|
|||||||
refresh_symbol = '\U0001f504' # 🔄
|
refresh_symbol = '\U0001f504' # 🔄
|
||||||
save_style_symbol = '\U0001f4be' # 💾
|
save_style_symbol = '\U0001f4be' # 💾
|
||||||
document_symbol = '\U0001F4C4' # 📄
|
document_symbol = '\U0001F4C4' # 📄
|
||||||
locon_path = os.getcwd()+'\\locon\\'
|
path_of_this_folder = os.getcwd()
|
||||||
|
|
||||||
def getlocon():
|
def getlocon(existance):
|
||||||
os.system('git clone https://github.com/KohakuBlueleaf/LoCon.git')
|
if existance:
|
||||||
os.system('ren '+locon_path[:-6]+'\\LoCon\\'+' locon_github-sourcecode')
|
print('Checking LoCon script version...')
|
||||||
shutil.copytree(locon_path[:-6]+'locon_github-sourcecode\\locon\\', locon_path)
|
now_path = os.getcwd()
|
||||||
|
os.chdir(os.path.join(path_of_this_folder, 'locon'))
|
||||||
|
os.system('git pull')
|
||||||
|
os.chdir(now_path)
|
||||||
|
else:
|
||||||
|
os.system('git clone https://github.com/KohakuBlueleaf/LoCon.git')
|
||||||
|
os.system('ren '+ os.path.join(path_of_this_folder, 'LoCon') +' locon')
|
||||||
|
|
||||||
def save_configuration(
|
def save_configuration(
|
||||||
save_as,
|
save_as,
|
||||||
@ -438,9 +443,8 @@ def train_model(
|
|||||||
if not float(prior_loss_weight) == 1.0:
|
if not float(prior_loss_weight) == 1.0:
|
||||||
run_cmd += f' --prior_loss_weight={prior_loss_weight}'
|
run_cmd += f' --prior_loss_weight={prior_loss_weight}'
|
||||||
if locon:
|
if locon:
|
||||||
if not os.path.exists(locon_path):
|
getlocon(os.path.exists(os.path.join(path_of_this_folder, 'locon')))
|
||||||
getlocon()
|
run_cmd += f' --network_module=locon.locon.locon_kohya'
|
||||||
run_cmd += ' --network_module=locon.locon_kohya'
|
|
||||||
else:
|
else:
|
||||||
run_cmd += f' --network_module=networks.lora'
|
run_cmd += f' --network_module=networks.lora'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user