Repository Analysis

bmaltais/kohya_ss

17.5 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of bmaltais/kohya_ss, a Python project with 12,467 GitHub stars. SynthScan v2.0 examined 60,629 lines of code across 302 source files, recording 775 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 17.5 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

17.5
Adjusted Score
17.5
Raw Score
100%
Time Factor
2026-07-13
Last Push
12.5K
Stars
Python
Language
60.6K
Lines of Code
302
Files
775
Pattern Hits
2026-07-14
Scan Date
0.04
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 13MEDIUM 63LOW 699

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 775 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers443 hits · 522 pts
SeverityFileLineSnippetContext
LOWtools/extract_lora_from_models-new.py50def _local_create_network_placeholders(text_encoders: list, unet: torch.nn.Module, lora_conv_dim_init: int):CODE
LOWtools/extract_lora_from_models-new.py172def _build_local_sai_metadata(title, creation_time, is_v2_flag, is_v_param_flag, is_sdxl_flag):CODE
LOWtools/extract_lora_from_models-new.py192def _load_sd_model_components(model_path, is_v2_flag, target_device_override, load_dtype_torch):CODE
LOWtools/extract_lora_from_models-new.py205def _load_sdxl_model_components(model_path, target_device_override, load_dtype_torch):CODE
LOWtools/extract_lora_from_models-new.py220def _calculate_module_diffs_and_check(module_loras_o, module_loras_t, diff_calc_device, min_diff_thresh, module_type_strCODE
LOWtools/extract_lora_from_models-new.py260def _construct_lora_weights_from_svd_components(U_full, S_all_values, Vh_full, rank,CODE
LOWtools/crop_images_to_n_buckets.py33def sort_images_by_aspect_ratio(path):CODE
LOWtools/crop_images_to_n_buckets.py177def save_resized_cropped_images(group, folder_name, group_number, avg_aspect_ratio, use_original_name=False):CODE
LOWtools/lcm_convert.py14def parse_command_line_arguments():CODE
LOWtools/lcm_convert.py29def convert_and_save_diffusion_model(diffusion_pipeline, command_line_args):CODE
LOWtools/extract_model_difference.py7def extract_model_differences(base_model_path, finetuned_model_path, output_delta_path=None, save_dtype_str="float32"):CODE
LOWtools/extract_loha_from_model.py413def cleanup_intermediate_files(final_intended_path: str, for_resume_management: bool = False, keep_n: int = 0):CODE
LOWtools/extract_loha_from_model.py56def log_layer_optimization_event(log_type: LogType, layer_name: str, **kwargs):CODE
LOWtools/extract_loha_from_model.py127def _get_closest_ema_value_before_iter(target_iter: int, ema_history: list[tuple[int, float]]) -> tuple[int | None, floaCODE
LOWtools/extract_loha_from_model.py137def initialize_loha_parameters(CODE
LOWtools/extract_loha_from_model.py181def check_insufficient_progress(CODE
LOWtools/extract_loha_from_model.py296def get_module_shape_info_from_weight(weight_tensor: torch.Tensor):CODE
LOWtools/extract_loha_from_model.py301def generate_intermediate_filename(base_save_path: str, num_total_completed_layers: int) -> str:CODE
LOWtools/extract_loha_from_model.py467def handle_resume_or_continue_loha(CODE
LOWtools/extract_loha_from_model.py578def setup_and_print_configuration(current_args: argparse.Namespace):CODE
LOWtools/prepare_presets.py6def remove_items_with_keywords(json_file_path):CODE
LOWtest/test_allowed_paths.py38 def test_allowed_paths_forwarded_to_launch(self):STRING
LOWkohya_gui/lora_gui.py831def get_effective_lr_messages(CODE
LOWkohya_gui/lora_gui.py909def resolve_network_train_flags(CODE
LOWkohya_gui/lora_gui.py926def format_network_train_mode_message(CODE
LOWkohya_gui/lora_gui.py941def append_loraplus_network_args(CODE
LOWkohya_gui/lora_gui.py1065def regularizer_controls_visible(lora_type: str) -> dict[str, bool]:CODE
LOWkohya_gui/lora_gui.py1078def append_rank_module_dropout_network_args(CODE
LOWkohya_gui/lora_gui.py1096def build_native_loha_lokr_network_args(CODE
LOWkohya_gui/lora_gui.py3989 def _make_open_configuration_entry(CODE
LOWkohya_gui/lora_gui.py4019 def _save_configuration_entry(data: dict):CODE
LOWkohya_gui/git_caption_gui.py87def gradio_git_caption_gui_tab(CODE
LOWkohya_gui/class_folders.py45 def create_directory_if_not_exists(self, directory: str) -> None:CODE
LOWkohya_gui/offline_assets.py91def sanitize_readme_for_about(content: str) -> str:CODE
LOWkohya_gui/offline_assets.py133def install_offline_template_patches() -> None:CODE
LOWkohya_gui/offline_assets.py148 def offline_template_response(*args, **kwargs):CODE
LOWkohya_gui/class_advanced_training.py605 def list_log_tracker_config_files(path):CODE
LOWkohya_gui/basic_caption_gui.py124def gradio_basic_caption_gui_tab(headless=False, default_images_dir=None):CODE
LOWkohya_gui/wd14_caption_gui.py91def check_keras_backend_ready() -> str | None:CODE
LOWkohya_gui/extract_lycoris_locon_gui.py170def gradio_extract_lycoris_locon_tab(headless=False):CODE
LOWkohya_gui/dataset_balancing_gui.py111def gradio_dataset_balancing_tab(headless=False):CODE
LOWkohya_gui/extract_lora_gui.py342 def change_modeltype_model_tuned(path):CODE
LOWkohya_gui/flux_extract_lora_gui.py98def gradio_flux_extract_lora_tab(headless=False):CODE
LOWkohya_gui/class_basic_training.py131 def init_precision_and_resources_controls(self) -> None:CODE
LOWkohya_gui/class_basic_training.py156 def init_lr_and_optimizer_controls(self) -> None:CODE
LOWkohya_gui/class_basic_training.py228 def init_grad_and_lr_controls(self) -> None:CODE
LOWkohya_gui/class_basic_training.py252 def init_learning_rate_controls(self) -> None:CODE
LOWkohya_gui/class_basic_training.py374 def init_resolution_and_bucket_controls(self) -> None:CODE
LOWkohya_gui/class_basic_training.py417 def setup_sdxl_checkbox_behavior(self) -> None:CODE
LOWkohya_gui/svd_merge_lora_gui.py109def gradio_svd_merge_lora_tab(headless=False):CODE
LOWkohya_gui/finetune_gui.py2018 def _config_kwargs_from_registry(data: dict) -> dict:CODE
LOWkohya_gui/finetune_gui.py2022 def _make_open_configuration_entry(CODE
LOWkohya_gui/finetune_gui.py2048 def _save_configuration_entry(data: dict):CODE
LOWkohya_gui/textual_inversion_gui.py1332 def _config_kwargs_from_registry(data: dict) -> dict:CODE
LOWkohya_gui/textual_inversion_gui.py1336 def _make_open_configuration_entry(ask_for_file_comp):CODE
LOWkohya_gui/textual_inversion_gui.py1358 def _save_configuration_entry(data: dict):CODE
LOWkohya_gui/common_gui.py1521def check_duplicate_filenames(CODE
LOWkohya_gui/common_gui.py104def calculate_max_train_steps(CODE
LOWkohya_gui/common_gui.py122def should_recommend_headless(CODE
LOWkohya_gui/common_gui.py1028def set_pretrained_model_name_or_path_input(CODE
383 more matches not shown…
Excessive Try-Catch Wrapping86 hits · 134 pts
SeverityFileLineSnippetContext
LOWlocal_train.py81 except Exception as e:CODE
MEDIUMlocal_train.py82 print(f"Error launching Kohya GUI: {e}")CODE
LOWtools/convert_html_to_md.py55 except Exception as e:CODE
LOWtools/cleanup_captions.py35 except Exception as e:CODE
LOWtools/convert_images_to_webp.py66 except Exception as e:CODE
MEDIUMtools/convert_images_to_webp.py67 print(f"Error processing {file}: {e}")CODE
LOWtools/extract_lora_from_models-new.py438 except Exception as e:CODE
LOWtools/crop_images_to_n_buckets.py29 except Exception as e:CODE
MEDIUMtools/crop_images_to_n_buckets.py30 print(f"Error: {e}")CODE
MEDIUMtools/crop_images_to_n_buckets.py83 print("Error: The group is empty")CODE
MEDIUMtools/crop_images_to_n_buckets.py92 print("Error: Check the structure of the input group elements. They should be tuples of (image_path, aspect_ratiCODE
LOWtools/crop_images_to_n_buckets.py94 except Exception as e:CODE
MEDIUMtools/crop_images_to_n_buckets.py95 print(f"Error: {e}")CODE
MEDIUMtools/crop_images_to_n_buckets.py175 print(f"Error: {e}") # Handle errors from os.listdir()CODE
MEDIUMtools/crop_images_to_n_buckets.py231 print(f"Error: Input directory does not exist: {args.input_dir}")CODE
MEDIUMtools/crop_images_to_n_buckets.py238 print(f"Error: Failed to create output directory: {args.output_dir}")CODE
MEDIUMtools/crop_images_to_n_buckets.py246 print("Error: Batch size must be greater than 0")CODE
LOWtools/crop_images_to_n_buckets.py270 except Exception as e:CODE
MEDIUMtools/crop_images_to_n_buckets.py271 print(f"Error: Failed to save images in group {i+1}: {e}")CODE
LOWtools/lcm_convert.py72 except Exception as error:CODE
LOWtools/dummy_loha.py185 except Exception as e:CODE
LOWtools/extract_model_difference.py28 except Exception as e:CODE
MEDIUMtools/extract_model_difference.py29 print(f"Error loading base model: {e}")CODE
LOWtools/extract_model_difference.py36 except Exception as e:CODE
MEDIUMtools/extract_model_difference.py37 print(f"Error loading fine-tuned model: {e}")CODE
LOWtools/extract_model_difference.py76 except Exception as e:CODE
MEDIUMtools/extract_model_difference.py77 print(f"Error calculating difference for key '{key}': {e}")CODE
LOWtools/extract_model_difference.py121 except Exception as e:CODE
MEDIUMtools/extract_model_difference.py122 print(f"Error saving delta weights: {e}")CODE
MEDIUMtools/extract_model_difference.py145 print(f"Error: Base model file not found at {args.base_model_path}")CODE
MEDIUMtools/extract_model_difference.py148 print(f"Error: Fine-tuned model file not found at {args.finetuned_model_path}")CODE
MEDIUMtools/extract_loha_from_model.py404 print(f"Error saving to {output_path_to_save}: {e}"); traceback.print_exc()CODE
MEDIUMtools/extract_loha_from_model.py607 print(f"Error loading base model: {e}"); traceback.print_exc(); sys.exit(1)CODE
MEDIUMtools/extract_loha_from_model.py613 print(f"Error loading fine-tuned model: {e}"); traceback.print_exc(); sys.exit(1)CODE
MEDIUMtools/extract_loha_from_model.py1015 print(f"Error: Base model not found: {parsed_args.base_model_path}"); sys.exit(1)CODE
MEDIUMtools/extract_loha_from_model.py1017 print(f"Error: FT model not found: {parsed_args.ft_model_path}"); sys.exit(1)CODE
MEDIUMtools/extract_loha_from_model.py1023 print(f"Error creating directory {save_dir}: {e}"); sys.exit(1)CODE
MEDIUMtools/extract_loha_from_model.py367 print("Error: Global args not set for saving metadata.")CODE
LOWtools/extract_loha_from_model.py403 except Exception as e:CODE
LOWtools/extract_loha_from_model.py606 except Exception as e:CODE
LOWtools/extract_loha_from_model.py612 except Exception as e:CODE
LOWtools/extract_loha_from_model.py159 except Exception as e:CODE
LOWtools/extract_loha_from_model.py461 except Exception as e:CODE
LOWtools/extract_loha_from_model.py497 except Exception as e:CODE
LOWtools/extract_loha_from_model.py530 except Exception as e:CODE
LOWtools/extract_loha_from_model.py928 except Exception as e_c: tqdm.write(f" Warn: Pre-opt loss check failed for {loha_key_prefix}: {e_CODE
LOWtools/analyse_loha.py69 except Exception as e:CODE
LOWtools/analyse_loha.py91 except Exception as e:CODE
LOWtools/analyse_loha.py112 except Exception as e:CODE
LOWtools/analyse_loha.py115 except Exception as e:CODE
LOWtools/analyse_loha.py139 except Exception as e:CODE
LOWkohya_gui/wd14_caption_gui.py114 except Exception as exc: # import can fail for many ABI reasonsCODE
LOWkohya_gui/class_tensorboard.py15 except Exception:CODE
LOWkohya_gui/class_tensorboard.py88 except Exception as e:CODE
LOWkohya_gui/class_tensorboard.py109 except Exception as e:CODE
MEDIUMkohya_gui/class_tensorboard.py9def check_avx_support():CODE
MEDIUMkohya_gui/common_gui.py1516 print(f"Error: Could not write to file - {e}")CODE
MEDIUMkohya_gui/common_gui.py1518 print(f"Error: Could not create 'logs' directory - {e}")CODE
LOWkohya_gui/common_gui.py857 except Exception as e:CODE
LOWkohya_gui/common_gui.py955 except Exception as e:CODE
26 more matches not shown…
Redundant / Tautological Comments79 hits · 117 pts
SeverityFileLineSnippetContext
LOWsetup.sh59# Check if RUNPOD variable should be setCOMMENT
LOWsetup.sh182 # Check if the symlink existsCOMMENT
LOWsetup.sh184 # Check if the linked file exists and points to the expected fileCOMMENT
LOWsetup.sh208 if [ "$PYTHON_CMD" == "python" ]; then # Check if get_python_command returned the fallbackCODE
LOWsetup.sh217 # Check if conda environment is already activatedCOMMENT
LOWsetup.sh485 # Check if root or sudoCOMMENT
LOWgui.sh16# Check if the directory existsCOMMENT
LOWgui.sh18 # Check if LD_LIBRARY_PATH is already setCOMMENT
LOWgui.sh45# Check if conda environment is already activatedCOMMENT
LOWgui.sh58# Check if LD_LIBRARY_PATH environment variable existsCOMMENT
LOWsetup-runpod.sh14# Check if the venv folder doesn't existCOMMENT
LOWgui-uv.sh28# Check if --quiet is in the argumentsCOMMENT
LOWtools/convert_images_to_webp.py41 # Iterate over the list of filesCOMMENT
LOWtools/convert_images_to_webp.py51 # Check if the output file already existsCOMMENT
LOWtools/create_txt_from_images.py12 # Check if the file is an image file (webp, jpg, png)COMMENT
LOWtools/convert_images_to_hq_jpg.py28 # Iterate over the list of filesCOMMENT
LOWtools/convert_images_to_hq_jpg.py36 # Check if the output file already existsCOMMENT
LOWtools/crop_images_to_n_buckets.py114 # Check if the input image is a valid numpy array with at least two dimensionsCOMMENT
LOWtools/crop_images_to_n_buckets.py168 # Check if the file has the same base name as the input imageCOMMENT
LOWtools/caption.py20 # Check if a text file with the same name as the current file exists in the folderCOMMENT
LOWtools/caption_from_filename.py45 # Check if the file is an imageCOMMENT
LOWtools/rename_depth_mask.py16 # Check if the file has the expected formatCOMMENT
LOWtools/analyse_loha.py64 # Check if value is float and format if it isCOMMENT
LOWkohya_gui/lora_gui.py781 # Check if the file exists before opening itCOMMENT
LOWkohya_gui/basic_caption_gui.py48 # Check if images_dir and caption_ext are providedCOMMENT
LOWkohya_gui/basic_caption_gui.py93 # Check if overwrite option is enabledCOMMENT
LOWkohya_gui/extract_lycoris_locon_gui.py55 # Check if source model existCOMMENT
LOWkohya_gui/convert_model_gui.py34 # Check if source model existCOMMENT
LOWkohya_gui/convert_model_gui.py43 # Check if source model existCOMMENT
LOWkohya_gui/convert_model_gui.py60 # Check if v1 modelsCOMMENT
LOWkohya_gui/dataset_balancing_gui.py27 # Check if folder existCOMMENT
LOWkohya_gui/dataset_balancing_gui.py56 # Check if the subdirectory name starts with a number inside braces,COMMENT
LOWkohya_gui/dataset_balancing_gui.py75 # Check if the subdirectory name already has a number at the beginningCOMMENT
LOWkohya_gui/dataset_balancing_gui.py86 # Check if the new folder name already existsCOMMENT
LOWkohya_gui/extract_lora_gui.py53 # Check if source model existCOMMENT
LOWkohya_gui/flux_extract_lora_gui.py44 # Check if source models existCOMMENT
LOWkohya_gui/class_basic_training.py361 step=1, # Increment value by 1CODE
LOWkohya_gui/svd_merge_lora_gui.py41 # Check if the output file already existsCOMMENT
LOWkohya_gui/svd_merge_lora_gui.py46 # Check if the ratio total is equal to one. If not normalise to 1COMMENT
LOWkohya_gui/finetune_gui.py573 # Check if we are "applying" a preset or a configCOMMENT
LOWkohya_gui/common_gui.py842 # Iterate over the list of image filesCOMMENT
LOWkohya_gui/common_gui.py849 # Check if the caption file does not existCOMMENT
LOWkohya_gui/common_gui.py937 # Check if the caption file extension is one of the supported extensionsCOMMENT
LOWkohya_gui/common_gui.py945 # Check if the folder path existsCOMMENT
LOWkohya_gui/common_gui.py959 # Iterate over the list of caption filesCOMMENT
LOWkohya_gui/common_gui.py564 # Open the file dialog and capture the selected file pathCOMMENT
LOWkohya_gui/common_gui.py624 # Open the file dialog and capture the selected file pathCOMMENT
LOWkohya_gui/common_gui.py690 # Check if the current environment is not macOS and if the environment variables do not match the exclusion listCOMMENT
LOWkohya_gui/common_gui.py765 # Check if the current environment is not macOS and if the environment variables do not match the exclusion listCOMMENT
LOWkohya_gui/common_gui.py778 # Open the file dialog and capture the selected file pathCOMMENT
LOWkohya_gui/common_gui.py1047 # Check if the given pretrained_model_name_or_path is in the list of SDXL modelsCOMMENT
LOWkohya_gui/common_gui.py1070 # Check if the given pretrained_model_name_or_path is in the list of V2 base modelsCOMMENT
LOWkohya_gui/common_gui.py1093 # Check if the given pretrained_model_name_or_path is in the list of V parameterization modelsCOMMENT
LOWkohya_gui/common_gui.py1118 # Check if the given pretrained_model_name_or_path is in the list of V1 modelsCOMMENT
LOWkohya_gui/common_gui.py1141 # Check if the model_list is set to 'custom'COMMENT
LOWkohya_gui/common_gui.py1309 # Check if the retrieved value is already a string.COMMENT
LOWkohya_gui/common_gui.py1455 # Check if the folder path for the file_path is validCOMMENT
LOWkohya_gui/common_gui.py1459 # Check if the folder existsCOMMENT
LOWkohya_gui/common_gui.py1555 # Check if the extension is in the list of image extensionsCOMMENT
LOWkohya_gui/common_gui.py1560 # Check if the filename is already in the dictionaryCOMMENT
19 more matches not shown…
Self-Referential Comments34 hits · 111 pts
SeverityFileLineSnippetContext
MEDIUMgui.sh13# Define the directory path for WSL2COMMENT
MEDIUMkohya_gui.py74 # Create the main Gradio Blocks interface (no analytics)COMMENT
MEDIUMtools/convert_html_to_md.py23 # Create a session objectCOMMENT
MEDIUMtools/convert_html_to_md.py29 # Create a BeautifulSoup object and specify the parserCOMMENT
MEDIUMtools/convert_images_to_webp.py18 # Define the command-line argumentsCOMMENT
MEDIUMtools/convert_images_to_webp.py35 # Create the file pattern string using the input file extensionCOMMENT
MEDIUMtools/convert_images_to_webp.py47 # Create a new file path with the output file extensionCOMMENT
MEDIUMtools/convert_images_to_hq_jpg.py22 # Create the file pattern string using the input file extensionCOMMENT
MEDIUMtools/convert_images_to_hq_jpg.py33 # Create a new file path with the output file extensionCOMMENT
MEDIUMtools/convert_images_to_hq_jpg.py51 # Define the command-line argumentsCOMMENT
MEDIUMtools/crop_images_to_n_buckets.py157 # Create the output directory if it does not existCOMMENT
MEDIUMtools/caption.py48 # Create a mutually exclusive group for the caption_text and caption_file argumentsCOMMENT
MEDIUMtools/caption.py56 # Create the caption filesCOMMENT
MEDIUMtools/caption_from_filename.py47 # Create a text file with the same name as the image file and increment the counter if successfulCOMMENT
MEDIUMtools/caption_from_filename.py83 # Create an argument parserCOMMENT
MEDIUMtools/rename_depth_mask.py4# Define the command line argumentsCOMMENT
MEDIUMkohya_gui/lora_gui.py433 # Create the destination directory if it doesn't existCOMMENT
MEDIUMkohya_gui/lora_gui.py2591 # Define a dictionary of parametersCOMMENT
MEDIUMkohya_gui/class_folders.py42 # Create the GUI for folder selectionCOMMENT
MEDIUMkohya_gui/class_advanced_training.py55 # Define the behavior for changing noise offset type.COMMENT
MEDIUMkohya_gui/extract_lycoris_locon_gui.py155 # Create a list of possible mode valuesCOMMENT
MEDIUMkohya_gui/class_sample_images.py75# # Create the prompt file and get its pathCOMMENT
MEDIUMkohya_gui/class_sd3.py50 # Define the behavior for changing noise offset type.COMMENT
MEDIUMkohya_gui/class_basic_training.py86 # Create a row for the training controlsCOMMENT
MEDIUMkohya_gui/finetune_gui.py331 # Create the destination directory if it doesn't existCOMMENT
MEDIUMkohya_gui/finetune_gui.py920 # Define the command componentsCOMMENT
MEDIUMkohya_gui/textual_inversion_gui.py231 # Create the destination directory if it doesn't existCOMMENT
MEDIUMkohya_gui/common_gui.py851 # Create a new caption file with the specified prefix and/or postfixCOMMENT
MEDIUMkohya_gui/common_gui.py260 # Define the refresh function that will be triggered upon clicking the refresh button.COMMENT
MEDIUMkohya_gui/common_gui.py279 # Create a refresh button with the specified label (via refresh_symbol), ID, and classes.COMMENT
MEDIUMkohya_gui/common_gui.py826 # Define the image file extensions to filterCOMMENT
MEDIUMkohya_gui/dreambooth_gui.py280 # Create the destination directory if it doesn't existCOMMENT
MEDIUMkohya_gui/class_flux1.py24 # Define the behavior for changing noise offset type.COMMENT
MEDIUMkohya_gui/class_source_model.py107 # Define the input elementsCOMMENT
Deep Nesting67 hits · 60 pts
SeverityFileLineSnippetContext
LOWtools/convert_html_to_md.py22CODE
LOWtools/cleanup_captions.py17CODE
LOWtools/extract_lora_from_models-new.py50CODE
LOWtools/extract_lora_from_models-new.py245CODE
LOWtools/extract_lora_from_models-new.py340CODE
LOWtools/group_images.py27CODE
LOWtools/group_images_recommended_size.py18CODE
LOWtools/lycoris_utils.py22CODE
LOWtools/lycoris_utils.py67CODE
LOWtools/lycoris_utils.py111CODE
LOWtools/lycoris_utils.py312CODE
LOWtools/lycoris_utils.py368CODE
LOWtools/lycoris_utils.py428CODE
LOWtools/lycoris_utils.py138CODE
LOWtools/lycoris_utils.py451CODE
LOWtools/resize_lora.py184CODE
LOWtools/extract_model_difference.py7CODE
LOWtools/extract_loha_from_model.py56CODE
LOWtools/extract_loha_from_model.py137CODE
LOWtools/extract_loha_from_model.py206CODE
LOWtools/extract_loha_from_model.py438CODE
LOWtools/extract_loha_from_model.py467CODE
LOWtools/extract_loha_from_model.py540CODE
LOWtools/extract_loha_from_model.py616CODE
LOWtools/extract_loha_from_model.py845CODE
LOWtools/analyse_loha.py25CODE
LOWkohya_gui/lora_gui.py1132CODE
LOWkohya_gui/lora_gui.py2630CODE
LOWkohya_gui/extract_lycoris_locon_gui.py26CODE
LOWkohya_gui/dataset_balancing_gui.py18CODE
LOWkohya_gui/finetune_gui.py610CODE
LOWkohya_gui/finetune_gui.py1501CODE
LOWkohya_gui/textual_inversion_gui.py968CODE
LOWkohya_gui/common_gui.py170CODE
LOWkohya_gui/common_gui.py379CODE
LOWkohya_gui/common_gui.py804CODE
LOWkohya_gui/common_gui.py1521CODE
LOWkohya_gui/anima_lllite_gui.py777CODE
LOWkohya_gui/dreambooth_folder_creation_gui.py84CODE
LOWkohya_gui/kontext_manual_caption_gui.py165CODE
LOWkohya_gui/kontext_manual_caption_gui.py215CODE
LOWkohya_gui/kontext_manual_caption_gui.py383CODE
LOWkohya_gui/kontext_manual_caption_gui.py452CODE
LOWkohya_gui/kontext_manual_caption_gui.py524CODE
LOWkohya_gui/blip2_caption_gui.py255CODE
LOWkohya_gui/class_command_executor.py40CODE
LOWkohya_gui/dreambooth_gui.py1219CODE
LOWkohya_gui/class_flux1.py10CODE
LOWkohya_gui/sd_modeltype.py18CODE
LOWkohya_gui/manual_caption_gui.py116CODE
LOWkohya_gui/manual_caption_gui.py184CODE
LOWkohya_gui/manual_caption_gui.py239CODE
LOWkohya_gui/class_source_model.py34CODE
LOWkohya_gui/class_accelerate_launch.py13CODE
LOWkohya_gui/leco_gui.py574CODE
LOWsetup/validate_requirements.py69CODE
LOWsetup/setup_windows.py18CODE
LOWsetup/setup_windows.py188CODE
LOWsetup/setup_common.py193CODE
LOWsetup/setup_common.py632CODE
7 more matches not shown…
Unused Imports35 hits · 35 pts
SeverityFileLineSnippetContext
LOWtools/extract_lora_from_models-new.py7CODE
LOWtools/caption_from_filename.py2CODE
LOWtools/caption_from_filename.py59CODE
LOWtools/lycoris_utils.py1CODE
LOWtools/lycoris_utils.py7CODE
LOWkohya_gui/lora_gui.py6CODE
LOWkohya_gui/class_huggingface.py2CODE
LOWkohya_gui/offline_assets.py7CODE
LOWkohya_gui/wd14_caption_gui.py113CODE
LOWkohya_gui/class_sample_images.py3CODE
LOWkohya_gui/class_sd3.py3CODE
LOWkohya_gui/class_sd3.py3CODE
LOWkohya_gui/class_sd3.py3CODE
LOWkohya_gui/class_sd3.py3CODE
LOWkohya_gui/finetune_gui.py8CODE
LOWkohya_gui/textual_inversion_gui.py5CODE
LOWkohya_gui/anima_lllite_gui.py12CODE
LOWkohya_gui/kontext_manual_caption_gui.py7CODE
LOWkohya_gui/dreambooth_gui.py6CODE
LOWkohya_gui/dreambooth_gui.py7CODE
LOWkohya_gui/manual_caption_gui.py2CODE
LOWkohya_gui/manual_caption_gui.py6CODE
LOWkohya_gui/leco_gui.py5CODE
LOWkohya_gui/class_gui_config.py2CODE
LOWsetup/docker_setup.py1CODE
LOWsetup/setup_common.py820CODE
LOWsetup/setup_common.py825CODE
LOWtests/test_security_dependency_pins.py12CODE
LOWtests/test_info_tooltip_gradio6.py9CODE
LOWtests/test_wd14_caption_gui.py12CODE
LOWtests/test_resize_lora_model.py10CODE
LOWtests/test_resize_lora_gui.py8CODE
LOWtests/test_xpu_requirements.py8CODE
LOWtests/test_gradio_pin_policy.py9CODE
LOWtests/test_tkinter_preflight.py7CODE
Cross-File Repetition7 hits · 35 pts
SeverityFileLineSnippetContext
HIGHtools/cleanup_captions.py0check if a path is a valid directory and that it can be written to.STRING
HIGHtools/convert_images_to_webp.py0check if a path is a valid directory and that it can be written to.STRING
HIGHtools/convert_images_to_hq_jpg.py0check if a path is a valid directory and that it can be written to.STRING
HIGHtools/caption.py0check if a path is a valid directory and that it can be written to.STRING
HIGHtests/test_dreambooth_gui.py0gh #3543 m3: train/save/load buttons resolve args by component identity.STRING
HIGHtests/test_finetune_gui.py0gh #3543 m3: train/save/load buttons resolve args by component identity.STRING
HIGHtests/test_textual_inversion_gui.py0gh #3543 m3: train/save/load buttons resolve args by component identity.STRING
Docstring Block Structure6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHtools/crop_images_to_n_buckets.py46 Create groups of images from a sorted list of images. This function takes a sorted list of images and a group STRING
HIGHtools/crop_images_to_n_buckets.py99Crop the input image to the target aspect ratio. The function calculates the crop region for the input image based STRING
HIGHkohya_gui/common_gui.py520 Opens a file dialog to select a file, allowing the user to navigate and choose a file with a specific extension. STRING
HIGHkohya_gui/common_gui.py583 Opens a file dialog to select any file, allowing the user to navigate and choose a file. If no file is selectedSTRING
HIGHkohya_gui/common_gui.py645 Opens a folder dialog to select a folder, allowing the user to navigate and choose a folder. If no folder is seSTRING
HIGHkohya_gui/common_gui.py742 Opens a file dialog to select a file name for saving, allowing the user to specify a file name and location. IfSTRING
Over-Commented Block13 hits · 13 pts
SeverityFileLineSnippetContext
LOWsetup.sh561 # create_symlinks "$libnvinfer_plugin_symlink" "$libnvinfer_plugin_target"COMMENT
LOWrequirements_linux_ipex.txt1# Legacy filename kept for older docs/scripts that pass this path explicitly.COMMENT
LOWlocal_train.py61 # 4. Clone kohya_ssCOMMENT
LOWgui-uv.sh61# Ensure you have the necessary build tools (like CUDA toolkit for cuda11x).COMMENT
LOWgui-uv.sh81# # Assuming uv environment is active or will be activated by the main command:COMMENT
LOWtools/dummy_loha.py101COMMENT
LOWtools/dummy_loha.py201 # for the layers defined in EXAMPLE_LAYERS_CONFIG.COMMENT
LOWkohya_gui/extract_lycoris_locon_gui.py141###COMMENT
LOWkohya_gui/class_sample_images.py41COMMENT
LOWkohya_gui/class_sample_images.py61# str: The command string for sampling images.COMMENT
LOWkohya_gui/class_sample_images.py81# # Append the sampler with proper quoting for safety against special charactersCOMMENT
LOWsetup/tkinter_preflight.sh1#!/usr/bin/env bashCOMMENT
LOWassets/js/info_tooltip.js1// Positions revealed `info=` hint text as a viewport-fixed tooltip anchoredCOMMENT
AI Structural Patterns3 hits · 2 pts
SeverityFileLineSnippetContext
LOWtools/extract_lora_from_models-new.py340CODE
LOWtools/extract_loha_from_model.py616CODE
LOWkohya_gui/blip2_caption_gui.py112CODE
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtools/extract_lora_from_models-new.py30logger = logging.getLogger(__name__) # Get logger for this moduleCODE
LOWtools/lcm_convert.py11logger = logging.getLogger(__name__)CODE