forked from bmaltais/kohya_ss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
149 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import subprocess | ||
import psutil | ||
from library.custom_logging import setup_logging | ||
|
||
# Set up logging | ||
log = setup_logging() | ||
|
||
class CommandExecutor: | ||
def __init__(self): | ||
self.process = None | ||
|
||
def execute_command(self, run_cmd): | ||
if self.process and self.process.poll() is None: | ||
log.info("The command is already running. Please wait for it to finish.") | ||
else: | ||
self.process = subprocess.Popen(run_cmd, shell=True) | ||
|
||
def kill_command(self): | ||
if self.process and self.process.poll() is None: | ||
try: | ||
parent = psutil.Process(self.process.pid) | ||
for child in parent.children(recursive=True): | ||
child.kill() | ||
parent.kill() | ||
log.info("The running process has been terminated.") | ||
except psutil.NoSuchProcess: | ||
log.info("The process does not exist.") | ||
except Exception as e: | ||
log.info(f"Error when terminating process: {e}") | ||
else: | ||
log.info("There is no running process to kill.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"LoRA_type": "Standard", | ||
"adaptive_noise_scale": 0.00357, | ||
"additional_parameters": "--log_prefix=xl-loha", | ||
"block_alphas": "", | ||
"block_dims": "", | ||
"block_lr_zero_threshold": "", | ||
"bucket_no_upscale": false, | ||
"bucket_reso_steps": 32, | ||
"cache_latents": true, | ||
"cache_latents_to_disk": true, | ||
"caption_dropout_every_n_epochs": 0.0, | ||
"caption_dropout_rate": 0, | ||
"caption_extension": ".txt2", | ||
"clip_skip": "1", | ||
"color_aug": false, | ||
"conv_alpha": 4, | ||
"conv_block_alphas": "", | ||
"conv_block_dims": "", | ||
"conv_dim": 4, | ||
"decompose_both": false, | ||
"dim_from_weights": false, | ||
"down_lr_weight": "", | ||
"enable_bucket": true, | ||
"epoch": 30, | ||
"factor": -1, | ||
"flip_aug": false, | ||
"full_bf16": false, | ||
"full_fp16": false, | ||
"gradient_accumulation_steps": 1.0, | ||
"gradient_checkpointing": true, | ||
"keep_tokens": 1, | ||
"learning_rate": 1.0, | ||
"lora_network_weights": "", | ||
"lr_scheduler": "adafactor", | ||
"lr_scheduler_num_cycles": "1", | ||
"lr_scheduler_power": "", | ||
"lr_warmup": 0, | ||
"max_bucket_reso": 2048, | ||
"max_data_loader_n_workers": "0", | ||
"max_resolution": "1024,1024", | ||
"max_timestep": 1000, | ||
"max_token_length": "75", | ||
"max_train_epochs": "30", | ||
"mem_eff_attn": false, | ||
"mid_lr_weight": "", | ||
"min_bucket_reso": 64, | ||
"min_snr_gamma": 0, | ||
"min_timestep": 0, | ||
"mixed_precision": "bf16", | ||
"module_dropout": 0, | ||
"multires_noise_discount": 0, | ||
"multires_noise_iterations": 0, | ||
"network_alpha": 128, | ||
"network_dim": 128, | ||
"network_dropout": 0, | ||
"no_token_padding": false, | ||
"noise_offset": 0.0357, | ||
"noise_offset_type": "Original", | ||
"num_cpu_threads_per_process": 2, | ||
"optimizer": "Adafactor", | ||
"optimizer_args": "", | ||
"persistent_data_loader_workers": false, | ||
"prior_loss_weight": 1.0, | ||
"random_crop": false, | ||
"rank_dropout": 0, | ||
"save_every_n_epochs": 5, | ||
"save_every_n_steps": 0, | ||
"save_last_n_steps": 0, | ||
"save_last_n_steps_state": 0, | ||
"save_precision": "bf16", | ||
"scale_v_pred_loss_like_noise_pred": false, | ||
"scale_weight_norms": 1, | ||
"sdxl": true, | ||
"sdxl_cache_text_encoder_outputs": false, | ||
"sdxl_no_half_vae": true, | ||
"seed": "", | ||
"shuffle_caption": false, | ||
"stop_text_encoder_training_pct": 0, | ||
"text_encoder_lr": 1.0, | ||
"train_batch_size": 5, | ||
"train_on_input": false, | ||
"training_comment": "trigger: the white queen", | ||
"unet_lr": 1.0, | ||
"unit": 1, | ||
"up_lr_weight": "", | ||
"use_cp": false, | ||
"use_wandb": false, | ||
"v2": false, | ||
"v_parameterization": false, | ||
"vae_batch_size": 0, | ||
"wandb_api_key": "", | ||
"weighted_captions": false, | ||
"xformers": true | ||
} |