Skip to content

Commit

Permalink
Point to sd-scripts python files
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Mar 2, 2024
1 parent 236be70 commit b29f00c
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion kohya_gui/basic_caption_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def caption_images(
log.info(f'Captioning files in {images_dir} with {caption_text}...')

# Build the command to run caption.py
run_cmd = fr'{PYTHON} "{scriptdir}/tools/caption.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/tools/caption.py"'
run_cmd += f' --caption_text="{caption_text}"'

# Add optional flags to the command
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/blip_caption_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def caption_images(
log.info(f'Captioning files in {train_data_dir}...')

# Construct the command to run
run_cmd = fr'{PYTHON} "{scriptdir}/finetune/make_captions.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/finetune/make_captions.py"'
run_cmd += f' --batch_size="{int(batch_size)}"'
run_cmd += f' --num_beams="{int(num_beams)}"'
run_cmd += f' --top_p="{top_p}"'
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/convert_model_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def convert_model(
msgbox('The provided target folder does not exist')
return

run_cmd = fr'{PYTHON} "{scriptdir}tools/convert_diffusers20_original_sd.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scriptstools/convert_diffusers20_original_sd.py"'

v1_models = [
'runwayml/stable-diffusion-v1-5',
Expand Down
4 changes: 2 additions & 2 deletions kohya_gui/dreambooth_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@ def train_model(
)

if sdxl:
run_cmd += fr' "{scriptdir}/sdxl_train.py"'
run_cmd += fr' "{scriptdir}/sd-scripts/sdxl_train.py"'
else:
run_cmd += fr' "{scriptdir}/train_db.py"'
run_cmd += fr' "{scriptdir}/sd-scripts/train_db.py"'


run_cmd += run_cmd_advanced_training(
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/extract_lora_from_dylora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def extract_dylora(
return

run_cmd = (
fr'{PYTHON} "{scriptdir}/networks/extract_lora_from_dylora.py"'
fr'{PYTHON} "{scriptdir}/sd-scripts/networks/extract_lora_from_dylora.py"'
)
run_cmd += f' --save_to "{save_to}"'
run_cmd += f' --model "{model}"'
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/extract_lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def extract_lora(
return

run_cmd = (
fr'{PYTHON} "{scriptdir}/networks/extract_lora_from_models.py"'
fr'{PYTHON} "{scriptdir}/sd-scripts/networks/extract_lora_from_models.py"'
)
run_cmd += f' --load_precision {load_precision}'
run_cmd += f' --save_precision {save_precision}'
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/extract_lycoris_locon_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def extract_lycoris_locon(
msgbox("The provided base model is not a file")
return

run_cmd = fr'{PYTHON} "{scriptdir}/tools/lycoris_locon_extract.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/tools/lycoris_locon_extract.py"'
if is_sdxl:
run_cmd += f" --is_sdxl"
if is_v2:
Expand Down
8 changes: 4 additions & 4 deletions kohya_gui/finetune_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def train_model(
if train_dir != "" and not os.path.exists(train_dir):
os.mkdir(train_dir)

run_cmd = fr'{PYTHON} "{scriptdir}/finetune/merge_captions_to_metadata.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/finetune/merge_captions_to_metadata.py"'
if caption_extension == "":
run_cmd += f' --caption_extension=".caption"'
else:
Expand All @@ -483,7 +483,7 @@ def train_model(

# create images buckets
if generate_image_buckets:
run_cmd = fr'{PYTHON} "{scriptdir}/finetune/prepare_buckets_latents.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/finetune/prepare_buckets_latents.py"'
run_cmd += f' "{image_folder}"'
run_cmd += f' "{train_dir}/{caption_metadata_filename}"'
run_cmd += f' "{train_dir}/{latent_metadata_filename}"'
Expand Down Expand Up @@ -554,9 +554,9 @@ def train_model(
)

if sdxl_checkbox:
run_cmd += fr' "{scriptdir}/sdxl_train.py"'
run_cmd += fr' "{scriptdir}/sd-scripts/sdxl_train.py"'
else:
run_cmd += fr' "{scriptdir}/fine_tune.py"'
run_cmd += fr' "{scriptdir}/sd-scripts/fine_tune.py"'

in_json = (
f"{train_dir}/{latent_metadata_filename}"
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/git_caption_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def caption_images(
return

log.info(f'GIT captioning files in {train_data_dir}...')
run_cmd = fr'{PYTHON} "{scriptdir}/finetune/make_captions_by_git.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/finetune/make_captions_by_git.py"'
if not model_id == '':
run_cmd += f' --model_id="{model_id}"'
run_cmd += f' --batch_size="{int(batch_size)}"'
Expand Down
4 changes: 2 additions & 2 deletions kohya_gui/merge_lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ def merge_lora(
return

if not sdxl_model:
run_cmd = fr'{PYTHON} "{scriptdir}/networks/merge_lora.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/networks/merge_lora.py"'
else:
run_cmd = (
fr'{PYTHON} "{scriptdir}/networks/sdxl_merge_lora.py"'
fr'{PYTHON} "{scriptdir}/sd-scripts/networks/sdxl_merge_lora.py"'
)
if sd_model:
run_cmd += f' --sd_model "{sd_model}"'
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/resize_lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def resize_lora(
if device == '':
device = 'cuda'

run_cmd = fr'{PYTHON} "{scriptdir}/networks/resize_lora.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/networks/resize_lora.py"'
run_cmd += f' --save_precision {save_precision}'
run_cmd += f' --save_to "{save_to}"'
run_cmd += f' --model "{model}"'
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/svd_merge_lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def svd_merge_lora(
ratio_c /= total_ratio
ratio_d /= total_ratio

run_cmd = fr'{PYTHON} "{scriptdir}/networks/svd_merge_lora.py"'
run_cmd = fr'{PYTHON} "{scriptdir}/sd-scripts/networks/svd_merge_lora.py"'
run_cmd += f' --save_precision {save_precision}'
run_cmd += f' --precision {precision}'
run_cmd += f' --save_to "{save_to}"'
Expand Down
4 changes: 2 additions & 2 deletions kohya_gui/textual_inversion_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ def train_model(
)

if sdxl:
run_cmd += fr' "{scriptdir}/sdxl_train_textual_inversion.py"'
run_cmd += fr' "{scriptdir}/sd-scripts/sdxl_train_textual_inversion.py"'
else:
run_cmd += fr' "{scriptdir}/train_textual_inversion.py"'
run_cmd += fr' "{scriptdir}/sd-scripts/train_textual_inversion.py"'

run_cmd += run_cmd_advanced_training(
adaptive_noise_scale=adaptive_noise_scale,
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/verify_lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def verify_lora(

run_cmd = [
PYTHON,
fr'"{scriptdir}/networks/check_lora_weights.py"',
fr'"{scriptdir}/sd-scripts/networks/check_lora_weights.py"',
f'{lora_model}',
]

Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/wd14_caption_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def caption_images(
return

log.info(f'Captioning files in {train_data_dir}...')
run_cmd = fr'accelerate launch "{scriptdir}/finetune/tag_images_by_wd14_tagger.py"'
run_cmd = fr'accelerate launch "{scriptdir}/sd-scripts/finetune/tag_images_by_wd14_tagger.py"'
run_cmd += f' --batch_size={int(batch_size)}'
run_cmd += f' --general_threshold={general_threshold}'
run_cmd += f' --character_threshold={character_threshold}'
Expand Down

0 comments on commit b29f00c

Please sign in to comment.