AI Slop Code RIsk Monitor

bmaltais/kohya_ss

18.6 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for bmaltais/kohya_ss, a Python project with 12,620 GitHub stars. SynthScan examined 60,629 lines of code across 302 source files, recording 789 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 18.6 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

18.6
Adjusted Signal
18.6
Raw Pattern Score
100%
Time Factor
2026-08-01
Last Push
12.6K
Stars
Python
Language
60.6K
Lines of Code
302
Files
789
Pattern Hits
2026-10-12
Scan Date
0.09
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 50.6/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 645 finding(s).

Hallucinated Dependency & Supply Chain Risk 2.9/100 · LOW

Are imports declared and package/API names verified? 35 finding(s).

Agent Over-Engineering Ratio 46.8/100 · MEDIUM

Are wrappers, guards, and repeated structures necessary? 555 finding(s).

PR Review Velocity Impact 57.9/100 · HIGH

Which changes need focused human review? 789 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 27MEDIUM 63LOW 699

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 789 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

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
LOW⚡tools/crop_images_to_n_buckets.py33def sort_images_by_aspect_ratio(path):CODE
LOW⚡tools/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
LOW⚡tools/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
LOW⚡kohya_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
LOW⚡tools/crop_images_to_n_buckets.py29 except Exception as e:CODE
MEDIUM⚡tools/crop_images_to_n_buckets.py30 print(f"Error: {e}")CODE
MEDIUM⚡tools/crop_images_to_n_buckets.py83 print("Error: The group is empty")CODE
MEDIUM⚡tools/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
LOW⚡tools/crop_images_to_n_buckets.py94 except Exception as e:CODE
MEDIUM⚡tools/crop_images_to_n_buckets.py95 print(f"Error: {e}")CODE
MEDIUM⚡tools/crop_images_to_n_buckets.py175 print(f"Error: {e}") # Handle errors from os.listdir()CODE
MEDIUM⚡tools/crop_images_to_n_buckets.py231 print(f"Error: Input directory does not exist: {args.input_dir}")CODE
MEDIUM⚡tools/crop_images_to_n_buckets.py238 print(f"Error: Failed to create output directory: {args.output_dir}")CODE
MEDIUM⚡tools/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
LOW⚡tools/extract_model_difference.py28 except Exception as e:CODE
MEDIUM⚡tools/extract_model_difference.py29 print(f"Error loading base model: {e}")CODE
LOW⚡tools/extract_model_difference.py36 except Exception as e:CODE
MEDIUM⚡tools/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
MEDIUM⚡tools/extract_loha_from_model.py404 print(f"Error saving to {output_path_to_save}: {e}"); traceback.print_exc()CODE
MEDIUM⚡tools/extract_loha_from_model.py607 print(f"Error loading base model: {e}"); traceback.print_exc(); sys.exit(1)CODE
MEDIUM⚡tools/extract_loha_from_model.py613 print(f"Error loading fine-tuned model: {e}"); traceback.print_exc(); sys.exit(1)CODE
MEDIUM⚡tools/extract_loha_from_model.py1015 print(f"Error: Base model not found: {parsed_args.base_model_path}"); sys.exit(1)CODE
MEDIUM⚡tools/extract_loha_from_model.py1017 print(f"Error: FT model not found: {parsed_args.ft_model_path}"); sys.exit(1)CODE
MEDIUM⚡tools/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
LOW⚡tools/extract_loha_from_model.py403 except Exception as e:CODE
LOW⚡tools/extract_loha_from_model.py606 except Exception as e:CODE
LOW⚡tools/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
MEDIUM⚡kohya_gui/common_gui.py1516 print(f"Error: Could not write to file - {e}")CODE
MEDIUM⚡kohya_gui/common_gui.py1518 print(f"Error: Could not create 'logs' directory - {e}")CODE
LOW⚡kohya_gui/common_gui.py857 except Exception as e:CODE
LOW⚡kohya_gui/common_gui.py955 except Exception as e:CODE
26 more matches not shown…
Redundant / Tautological Comments79 hits · 115 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
LOW⚡gui.sh16# Check if the directory existsCOMMENT
LOW⚡gui.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
LOW⚡tools/convert_images_to_webp.py41 # Iterate over the list of filesCOMMENT
LOW⚡tools/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
LOW⚡tools/convert_images_to_hq_jpg.py28 # Iterate over the list of filesCOMMENT
LOW⚡tools/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
LOW⚡tools/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
LOW⚡kohya_gui/common_gui.py842 # Iterate over the list of image filesCOMMENT
LOW⚡kohya_gui/common_gui.py849 # Check if the caption file does not existCOMMENT
LOW⚡kohya_gui/common_gui.py937 # Check if the caption file extension is one of the supported extensionsCOMMENT
LOW⚡kohya_gui/common_gui.py945 # Check if the folder path existsCOMMENT
LOW⚡kohya_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
MEDIUM⚡gui.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
MEDIUM⚡tools/convert_images_to_webp.py35 # Create the file pattern string using the input file extensionCOMMENT
MEDIUM⚡tools/convert_images_to_webp.py47 # Create a new file path with the output file extensionCOMMENT
MEDIUM⚡tools/convert_images_to_hq_jpg.py22 # Create the file pattern string using the input file extensionCOMMENT
MEDIUM⚡tools/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
MEDIUM⚡kohya_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
Empty Error Handlers14 hits · 70 pts
SeverityFileLineSnippetContext
HIGHtools/extract_loha_from_model.py407except OSError: passCODE
HIGHtools/extract_loha_from_model.py410except OSError: passCODE
HIGHkohya_gui/common_gui.py3except ImportError:CODE
HIGHkohya_gui/common_gui.py496except ValueError:CODE
HIGHkohya_gui/blip2_caption_gui.py28except Exception:CODE
HIGHkohya_gui/blip2_caption_gui.py33except Exception:CODE
HIGHkohya_gui/blip2_caption_gui.py38except Exception:CODE
HIGHkohya_gui/class_command_executor.py60except (OSError, ValueError):CODE
HIGHkohya_gui/class_command_executor.py66except OSError:CODE
HIGHkohya_gui/class_command_executor.py57except OSError:CODE
HIGHkohya_gui/sd_modeltype.py47except:CODE
HIGHkohya_gui/custom_logging.py25except:CODE
HIGHtests/test_tkinter_preflight.py64except (FileNotFoundError, subprocess.CalledProcessError, OSError):CODE
HIGHtests/test_tkinter_preflight.py76except (FileNotFoundError, subprocess.CalledProcessError, OSError):CODE
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