Repository Analysis

kohya-ss/sd-scripts

18.7 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of kohya-ss/sd-scripts, a Python project with 7,190 GitHub stars. SynthScan v2.0 examined 118,687 lines of code across 256 source files, recording 1642 pattern matches distributed across 16 syntactic categories. The overall adjusted score of 18.7 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).

18.7
Adjusted Score
18.7
Raw Score
100%
Time Factor
2026-08-02
Last Push
7.2K
Stars
Python
Language
118.7K
Lines of Code
256
Files
1.6K
Pattern Hits
2026-08-02
Scan Date
0.29
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 75MEDIUM 138LOW 1429

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 1642 distinct pattern matches across 16 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 Identifiers474 hits · 476 pts
SeverityFileLineSnippetContext
LOWtrain_textual_inversion.py126 def get_latents_caching_strategy(self, args):CODE
LOWtrain_textual_inversion.py135 def get_text_encoding_strategy(self, args):CODE
LOWtrain_textual_inversion.py138 def get_models_for_text_encoding(self, args, accelerator, text_encoders) -> List[Any]:CODE
LOWsd3_train_network.py156 def get_latents_caching_strategy(self, args):CODE
LOWsd3_train_network.py162 def get_text_encoding_strategy(self, args):CODE
LOWsd3_train_network.py180 def get_models_for_text_encoding(self, args, accelerator, text_encoders):CODE
LOWsd3_train_network.py189 def get_text_encoders_train_flags(self, args, text_encoders):CODE
LOWsd3_train_network.py192 def get_text_encoder_outputs_caching_strategy(self, args):CODE
LOWsd3_train_network.py206 def cache_text_encoder_outputs_if_needed(CODE
LOWsd3_train_network.py317 def get_noise_pred_and_target(CODE
LOWsd3_train_network.py412 def is_text_encoder_not_needed_for_training(self, args):CODE
LOWsd3_train_network.py415 def prepare_text_encoder_grad_ckpt_workaround(self, index, text_encoder):CODE
LOWsd3_train_network.py470 def prepare_unet_with_accelerator(CODE
LOWsdxl_train.py59def get_block_params_to_optimize(unet: SdxlUNet2DConditionModel, block_lrs: List[float]) -> List[dict]:CODE
LOWsdxl_train.py254 def set_diffusers_xformers_flag(model, valid):CODE
LOWanima_train_control_net_lllite.py90def _build_inpaint_cond_image(CODE
LOWanima_train_control_net_lllite.py108def _generate_random_masks_for_batch(CODE
LOWanima_train_control_net_lllite.py122def _make_lllite_sample_hooks(args, lllite, dit_dtype):CODE
LOWanima_train_control_net_lllite.py201def add_anima_lllite_arguments(parser: argparse.ArgumentParser):CODE
LOWsdxl_train_network.py78 def get_latents_caching_strategy(self, args):CODE
LOWsdxl_train_network.py84 def get_text_encoding_strategy(self, args):CODE
LOWsdxl_train_network.py87 def get_models_for_text_encoding(self, args, accelerator, text_encoders):CODE
LOWsdxl_train_network.py90 def get_text_encoder_outputs_caching_strategy(self, args):CODE
LOWsdxl_train_network.py98 def cache_text_encoder_outputs_if_needed(CODE
LOWlumina_train_network.py96 def get_latents_caching_strategy(self, args):CODE
LOWlumina_train_network.py99 def get_text_encoding_strategy(self, args):CODE
LOWlumina_train_network.py102 def get_text_encoders_train_flags(self, args, text_encoders):CODE
LOWlumina_train_network.py105 def get_text_encoder_outputs_caching_strategy(self, args):CODE
LOWlumina_train_network.py117 def cache_text_encoder_outputs_if_needed(CODE
LOWlumina_train_network.py240 def get_noise_pred_and_target(CODE
LOWlumina_train_network.py342 def is_text_encoder_not_needed_for_training(self, args):CODE
LOWlumina_train_network.py345 def prepare_text_encoder_grad_ckpt_workaround(self, index, text_encoder):CODE
LOWlumina_train_network.py353 def prepare_unet_with_accelerator(CODE
LOWfine_tune.py157 def set_diffusers_xformers_flag(model, valid):CODE
LOWgen_img_diffusers.py339def replace_vae_attn_to_memory_efficient():CODE
LOWgen_img_diffusers.py395def replace_vae_attn_to_xformers():CODE
LOWgen_img_diffusers.py663 def enable_xformers_memory_efficient_attention(self):STRING
LOWgen_img_diffusers.py673 def disable_xformers_memory_efficient_attention(self):STRING
LOWgen_img_diffusers.py696 def disable_attention_slicing(self):STRING
LOWgen_img_diffusers.py704 def enable_sequential_cpu_offload(self):STRING
LOWgen_img_diffusers.py1982def get_unweighted_text_embeddings(STRING
LOWgen_img_diffusers.py2043def get_weighted_text_embeddings(STRING
LOWgen_img_diffusers.py2238def handle_dynamic_prompt_variants(prompt, repeat_count):STRING
LOWhunyuan_image_train_network.py421 def get_latents_caching_strategy(self, args):CODE
LOWhunyuan_image_train_network.py424 def get_text_encoding_strategy(self, args):CODE
LOWhunyuan_image_train_network.py430 def get_models_for_text_encoding(self, args, accelerator, text_encoders):CODE
LOWhunyuan_image_train_network.py436 def get_text_encoders_train_flags(self, args, text_encoders):CODE
LOWhunyuan_image_train_network.py440 def get_text_encoder_outputs_caching_strategy(self, args):CODE
LOWhunyuan_image_train_network.py448 def cache_text_encoder_outputs_if_needed(CODE
LOWhunyuan_image_train_network.py524 def get_noise_pred_and_target(CODE
LOWhunyuan_image_train_network.py596 def is_text_encoder_not_needed_for_training(self, args):CODE
LOWhunyuan_image_train_network.py599 def prepare_text_encoder_grad_ckpt_workaround(self, index, text_encoder):CODE
LOWhunyuan_image_train_network.py621 def prepare_unet_with_accelerator(CODE
LOWanima_train_network.py163 def get_latents_caching_strategy(self, args):CODE
LOWanima_train_network.py166 def get_text_encoding_strategy(self, args):CODE
LOWanima_train_network.py172 def get_models_for_text_encoding(self, args, accelerator, text_encoders):CODE
LOWanima_train_network.py177 def get_text_encoder_outputs_caching_strategy(self, args):CODE
LOWanima_train_network.py184 def cache_text_encoder_outputs_if_needed(CODE
LOWanima_train_network.py268 def get_noise_pred_and_target(CODE
LOWanima_train_network.py416 def is_text_encoder_not_needed_for_training(self, args):CODE
414 more matches not shown…
Decorative Section Separators104 hits · 349 pts
SeverityFileLineSnippetContext
MEDIUMinpainting_minimal_inference.py55# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py57# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py67# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py69# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py271 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py273 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py281 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py283 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py136# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py138# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py152# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py154# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py191# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py193# -------------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py225 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py227 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py314 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py316 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py341 # ------------------------------------------------------------------COMMENT
MEDIUMinpainting_minimal_inference.py343 # ------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py55# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py57# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py107# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py109# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py238# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py240# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py278# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py280# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py370# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py372# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py426# ---------------------------------------------------------------------------COMMENT
MEDIUManima_minimal_inference_control_net_lllite.py428# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/visualize_masks.py52# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/visualize_masks.py54# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/visualize_masks.py120# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/visualize_masks.py122# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/visualize_masks.py169# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/visualize_masks.py171# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/visualize_masks.py274# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/visualize_masks.py276# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/manual_test_anima_lllite_dryrun.py35# ---------------------------------------------------------------------------COMMENT
MEDIUMtools/dev/manual_test_anima_lllite_dryrun.py39# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py29# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py31# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py44# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py46# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py84# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py86# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py123# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py125# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py162# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py164# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py188# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mask_generator.py190# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_expand_unet_to_inpainting.py28# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_expand_unet_to_inpainting.py30# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_expand_unet_to_inpainting.py60# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_expand_unet_to_inpainting.py62# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_expand_unet_to_inpainting.py92# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_expand_unet_to_inpainting.py94# ---------------------------------------------------------------------------COMMENT
44 more matches not shown…
Cross-File Repetition68 hits · 340 pts
SeverityFileLineSnippetContext
HIGHgen_img_diffusers.py0pipeline for text-to-image generation using stable diffusion without tokens length limit, and support parsing weighting STRING
HIGHlibrary/lpw_stable_diffusion.py0pipeline for text-to-image generation using stable diffusion without tokens length limit, and support parsing weighting STRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0pipeline for text-to-image generation using stable diffusion without tokens length limit, and support parsing weighting STRING
HIGHgen_img_diffusers.py0function invoked when calling the pipeline for generation. args: prompt (`str` or `list[str]`): the prompt or prompts toSTRING
HIGHlibrary/lpw_stable_diffusion.py0function invoked when calling the pipeline for generation. args: prompt (`str` or `list[str]`): the prompt or prompts toSTRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0function invoked when calling the pipeline for generation. args: prompt (`str` or `list[str]`): the prompt or prompts toSTRING
HIGHgen_img_diffusers.py0function for text-to-image generation. args: prompt (`str` or `list[str]`): the prompt or prompts to guide the image genSTRING
HIGHlibrary/lpw_stable_diffusion.py0function for text-to-image generation. args: prompt (`str` or `list[str]`): the prompt or prompts to guide the image genSTRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0function for text-to-image generation. args: prompt (`str` or `list[str]`): the prompt or prompts to guide the image genSTRING
HIGHgen_img_diffusers.py0function for image-to-image generation. args: image (`torch.floattensor` or `pil.image.image`): `image`, or tensor repreSTRING
HIGHlibrary/lpw_stable_diffusion.py0function for image-to-image generation. args: image (`torch.floattensor` or `pil.image.image`): `image`, or tensor repreSTRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0function for image-to-image generation. args: image (`torch.floattensor` or `pil.image.image`): `image`, or tensor repreSTRING
HIGHgen_img_diffusers.py0function for inpaint. args: image (`torch.floattensor` or `pil.image.image`): `image`, or tensor representing an image bSTRING
HIGHlibrary/lpw_stable_diffusion.py0function for inpaint. args: image (`torch.floattensor` or `pil.image.image`): `image`, or tensor representing an image bSTRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0function for inpaint. args: image (`torch.floattensor` or `pil.image.image`): `image`, or tensor representing an image bSTRING
HIGHgen_img_diffusers.py0\\\(| \\\)| \\\[| \\]| \\\\| \\| \(| \[| :([+-]?[.\d]+)\)| \)| ]| [^\\()\[\]:]+| :STRING
HIGHsdxl_gen_img.py0\\\(| \\\)| \\\[| \\]| \\\\| \\| \(| \[| :([+-]?[.\d]+)\)| \)| ]| [^\\()\[\]:]+| :STRING
HIGHgen_img.py0\\\(| \\\)| \\\[| \\]| \\\\| \\| \(| \[| :([+-]?[.\d]+)\)| \)| ]| [^\\()\[\]:]+| :STRING
HIGHlibrary/strategy_base.py0\\\(| \\\)| \\\[| \\]| \\\\| \\| \(| \[| :([+-]?[.\d]+)\)| \)| ]| [^\\()\[\]:]+| :STRING
HIGHlibrary/lpw_stable_diffusion.py0\\\(| \\\)| \\\[| \\]| \\\\| \\| \(| \[| :([+-]?[.\d]+)\)| \)| ]| [^\\()\[\]:]+| :STRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0\\\(| \\\)| \\\[| \\]| \\\\| \\| \(| \[| :([+-]?[.\d]+)\)| \)| ]| [^\\()\[\]:]+| :STRING
HIGHlibrary/custom_train_functions.py0\\\(| \\\)| \\\[| \\]| \\\\| \\| \(| \[| :([+-]?[.\d]+)\)| \)| ]| [^\\()\[\]:]+| :STRING
HIGHgen_img_diffusers.py0parses a string with attention tokens and returns a list of pairs: text and its associated weight. accepted tokens are: STRING
HIGHsdxl_gen_img.py0parses a string with attention tokens and returns a list of pairs: text and its associated weight. accepted tokens are: STRING
HIGHgen_img.py0parses a string with attention tokens and returns a list of pairs: text and its associated weight. accepted tokens are: STRING
HIGHlibrary/strategy_base.py0parses a string with attention tokens and returns a list of pairs: text and its associated weight. accepted tokens are: STRING
HIGHlibrary/lpw_stable_diffusion.py0parses a string with attention tokens and returns a list of pairs: text and its associated weight. accepted tokens are: STRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0parses a string with attention tokens and returns a list of pairs: text and its associated weight. accepted tokens are: STRING
HIGHlibrary/custom_train_functions.py0parses a string with attention tokens and returns a list of pairs: text and its associated weight. accepted tokens are: STRING
HIGHgen_img_diffusers.py0tokenize a list of prompts and return its tokens with weights of each token. no padding, starting or ending token is incSTRING
HIGHsdxl_gen_img.py0tokenize a list of prompts and return its tokens with weights of each token. no padding, starting or ending token is incSTRING
HIGHgen_img.py0tokenize a list of prompts and return its tokens with weights of each token. no padding, starting or ending token is incSTRING
HIGHlibrary/lpw_stable_diffusion.py0tokenize a list of prompts and return its tokens with weights of each token. no padding, starting or ending token is incSTRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0tokenize a list of prompts and return its tokens with weights of each token. no padding, starting or ending token is incSTRING
HIGHlibrary/custom_train_functions.py0tokenize a list of prompts and return its tokens with weights of each token. no padding, starting or ending token is incSTRING
HIGHgen_img_diffusers.py0pad the tokens (with starting and ending tokens) and weights (with 1.0) to max_length.STRING
HIGHsdxl_gen_img.py0pad the tokens (with starting and ending tokens) and weights (with 1.0) to max_length.STRING
HIGHgen_img.py0pad the tokens (with starting and ending tokens) and weights (with 1.0) to max_length.STRING
HIGHlibrary/strategy_base.py0pad the tokens (with starting and ending tokens) and weights (with 1.0) to max_length.STRING
HIGHlibrary/lpw_stable_diffusion.py0pad the tokens (with starting and ending tokens) and weights (with 1.0) to max_length.STRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0pad the tokens (with starting and ending tokens) and weights (with 1.0) to max_length.STRING
HIGHlibrary/custom_train_functions.py0pad the tokens (with starting and ending tokens) and weights (with 1.0) to max_length.STRING
HIGHgen_img_diffusers.py0when the length of tokens is a multiple of the capacity of the text encoder, it should be split into chunks and sent to STRING
HIGHsdxl_gen_img.py0when the length of tokens is a multiple of the capacity of the text encoder, it should be split into chunks and sent to STRING
HIGHgen_img.py0when the length of tokens is a multiple of the capacity of the text encoder, it should be split into chunks and sent to STRING
HIGHlibrary/lpw_stable_diffusion.py0when the length of tokens is a multiple of the capacity of the text encoder, it should be split into chunks and sent to STRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0when the length of tokens is a multiple of the capacity of the text encoder, it should be split into chunks and sent to STRING
HIGHlibrary/custom_train_functions.py0when the length of tokens is a multiple of the capacity of the text encoder, it should be split into chunks and sent to STRING
HIGHgen_img_diffusers.py0prompts can be assigned with local weights using brackets. for example, prompt 'a (very beautiful) masterpiece' highlighSTRING
HIGHlibrary/lpw_stable_diffusion.py0prompts can be assigned with local weights using brackets. for example, prompt 'a (very beautiful) masterpiece' highlighSTRING
HIGHlibrary/sdxl_lpw_stable_diffusion.py0prompts can be assigned with local weights using brackets. for example, prompt 'a (very beautiful) masterpiece' highlighSTRING
HIGHlibrary/custom_train_functions.py0prompts can be assigned with local weights using brackets. for example, prompt 'a (very beautiful) masterpiece' highlighSTRING
HIGHfinetune/make_captions_by_git.py0collate function that allows to remove corrupted examples in the dataloader. it expects that the dataloader returns 'nonSTRING
HIGHfinetune/make_captions.py0collate function that allows to remove corrupted examples in the dataloader. it expects that the dataloader returns 'nonSTRING
HIGHfinetune/prepare_buckets_latents.py0collate function that allows to remove corrupted examples in the dataloader. it expects that the dataloader returns 'nonSTRING
HIGHnetworks/dylora.py0replaces forward method of the original linear, instead of replacing the original linear module.STRING
HIGHnetworks/oft_flux.py0replaces forward method of the original linear, instead of replacing the original linear module.STRING
HIGHnetworks/lora_diffusers.py0replaces forward method of the original linear, instead of replacing the original linear module.STRING
HIGHnetworks/lora_flux.py0replaces forward method of the original linear, instead of replacing the original linear module.STRING
HIGHnetworks/oft.py0replaces forward method of the original linear, instead of replacing the original linear module.STRING
8 more matches not shown…
Unused Imports370 hits · 320 pts
SeverityFileLineSnippetContext
LOWsd3_train_network.py2CODE
LOWsd3_train_network.py4CODE
LOWsd3_train_network.py9CODE
LOWsd3_train_network.py15CODE
LOWtrain_db.py39CODE
LOWtrain_db.py39CODE
LOWtrain_db.py39CODE
LOWanima_train_control_net_lllite.py10CODE
LOWanima_train_control_net_lllite.py23CODE
LOWanima_train_control_net_lllite.py53CODE
LOWflux_train_control_net.py17CODE
LOWflux_train_control_net.py18CODE
LOWflux_train_control_net.py20CODE
LOWflux_train_control_net.py20CODE
LOWflux_train_control_net.py20CODE
LOWflux_train_control_net.py20CODE
LOWflux_train_control_net.py24CODE
LOWsdxl_train_network.py10CODE
LOWsdxl_train_control_net_lllite.py5CODE
LOWsdxl_train_control_net_lllite.py9CODE
LOWsdxl_train_control_net_lllite.py11CODE
LOWsdxl_train_control_net_lllite.py24CODE
LOWsdxl_train_control_net_lllite.py25CODE
LOWsdxl_train_control_net_lllite.py26CODE
LOWsdxl_train_control_net_lllite.py38CODE
LOWsdxl_train_control_net_lllite.py54CODE
LOWsdxl_train_control_net_lllite.py54CODE
LOWfine_tune.py44CODE
LOWlumina_minimal_inference.py6CODE
LOWlumina_minimal_inference.py12CODE
LOWlumina_minimal_inference.py13CODE
LOWlumina_minimal_inference.py15CODE
LOWlumina_minimal_inference.py18CODE
LOWgen_img_diffusers.py50CODE
LOWgen_img_diffusers.py56CODE
LOWgen_img_diffusers.py60CODE
LOWgen_img_diffusers.py73CODE
LOWgen_img_diffusers.py92CODE
LOWanima_train.py4CODE
LOWanima_train.py10CODE
LOWanima_train.py16CODE
LOWanima_train.py23CODE
LOWtrain_control_net.py2CODE
LOWtrain_control_net.py6CODE
LOWtrain_control_net.py37CODE
LOWflux_minimal_inference.py34CODE
LOWsdxl_train_textual_inversion.py5CODE
LOWflux_train.py14CODE
LOWflux_train.py19CODE
LOWflux_train.py20CODE
LOWflux_train.py20CODE
LOWflux_train.py20CODE
LOWflux_train.py20CODE
LOWflux_train.py26CODE
LOWanima_minimal_inference_control_net_lllite.py35CODE
LOWtrain_network.py19CODE
LOWtrain_network.py49CODE
LOWflux_train_network.py3CODE
LOWflux_train_network.py4CODE
LOWsd3_minimal_inference.py7CODE
310 more matches not shown…
Deep Nesting253 hits · 249 pts
SeverityFileLineSnippetContext
LOWtrain_textual_inversion.py193CODE
LOWsd3_train_network.py206CODE
LOWtrain_db.py60CODE
LOWsdxl_train.py59CODE
LOWsdxl_train.py87CODE
LOWsdxl_train.py106CODE
LOWanima_train_control_net_lllite.py282CODE
LOWflux_train_control_net.py68CODE
LOWlumina_train_network.py117CODE
LOWsdxl_train_control_net_lllite.py86CODE
LOWfine_tune.py54CODE
LOWgen_img_diffusers.py1817CODE
LOWgen_img_diffusers.py1906CODE
LOWgen_img_diffusers.py1957CODE
LOWgen_img_diffusers.py1982CODE
LOWgen_img_diffusers.py2238CODE
LOWgen_img_diffusers.py2371CODE
LOWgen_img_diffusers.py630CODE
LOWgen_img_diffusers.py726CODE
LOWgen_img_diffusers.py3043CODE
LOWanima_train.py50CODE
LOWhunyuan_image_train_network.py46CODE
LOWhunyuan_image_train_network.py149CODE
LOWhunyuan_image_train_network.py209CODE
LOWhunyuan_image_train_network.py448CODE
LOWtrain_control_net.py71CODE
LOWanima_train_network.py184CODE
LOWflux_minimal_inference.py201CODE
LOWflux_minimal_inference.py282CODE
LOWflux_train.py62CODE
LOWanima_minimal_inference_control_net_lllite.py242CODE
LOWtrain_network.py72CODE
LOWtrain_network.py371CODE
LOWtrain_network.py499CODE
LOWtrain_network.py898CODE
LOWtrain_network.py1561CODE
LOWlumina_train.py64CODE
LOWsdxl_train_leco.py103CODE
LOWflux_train_network.py231CODE
LOWsdxl_train_control_net.py76CODE
LOWtrain_leco.py101CODE
LOWhunyuan_image_minimal_inference.py169CODE
LOWhunyuan_image_minimal_inference.py655CODE
LOWhunyuan_image_minimal_inference.py942CODE
LOWhunyuan_image_minimal_inference.py1086CODE
LOWhunyuan_image_minimal_inference.py1170CODE
LOWsdxl_gen_img.py962CODE
LOWsdxl_gen_img.py1051CODE
LOWsdxl_gen_img.py1102CODE
LOWsdxl_gen_img.py1127CODE
LOWsdxl_gen_img.py1344CODE
LOWsdxl_gen_img.py1482CODE
LOWsdxl_gen_img.py396CODE
LOWsdxl_gen_img.py2100CODE
LOWanima_minimal_inference.py150CODE
LOWanima_minimal_inference.py518CODE
LOWanima_minimal_inference.py766CODE
LOWanima_minimal_inference.py894CODE
LOWanima_minimal_inference.py976CODE
LOWgen_img.py962CODE
193 more matches not shown…
Modern Structural Boilerplate145 hits · 144 pts
SeverityFileLineSnippetContext
LOWtrain_textual_inversion.py50logger = logging.getLogger(__name__)CODE
LOWsd3_train_network.py25logger = logging.getLogger(__name__)CODE
LOWtrain_db.py55logger = logging.getLogger(__name__)CODE
LOWsdxl_train.py36logger = logging.getLogger(__name__)CODE
LOWanima_train_control_net_lllite.py68logger = logging.getLogger(__name__)CODE
LOWflux_train_control_net.py56logger = logging.getLogger(__name__)CODE
LOWsdxl_train_network.py20logger = logging.getLogger(__name__)CODE
LOWlumina_train_network.py32logger = logging.getLogger(__name__)CODE
LOWsdxl_train_control_net_lllite.py69logger = logging.getLogger(__name__)CODE
LOWfine_tune.py26logger = logging.getLogger(__name__)CODE
LOWlumina_minimal_inference.py36logger = logging.getLogger(__name__)CODE
LOWgen_img_diffusers.py110logger = logging.getLogger(__name__)CODE
LOWanima_train.py39logger = logging.getLogger(__name__)CODE
LOWhunyuan_image_train_network.py39logger = logging.getLogger(__name__)CODE
LOWtrain_control_net.py54logger = logging.getLogger(__name__)CODE
LOWanima_train_network.py34logger = logging.getLogger(__name__)CODE
LOWinpainting_minimal_inference.py53logger = logging.getLogger(__name__)CODE
LOWflux_minimal_inference.py31logger = logging.getLogger(__name__)CODE
LOWflux_train.py50logger = logging.getLogger(__name__)CODE
LOWanima_minimal_inference_control_net_lllite.py52logger = logging.getLogger(__name__)CODE
LOWtrain_network.py63logger = logging.getLogger(__name__)CODE
LOWlumina_train.py52logger = logging.getLogger(__name__)CODE
LOWsdxl_train_leco.py40logger = logging.getLogger(__name__)CODE
LOWflux_train_network.py32logger = logging.getLogger(__name__)CODE
LOWsdxl_train_control_net.py59logger = logging.getLogger(__name__)CODE
LOWsd3_minimal_inference.py28logger = logging.getLogger(__name__)CODE
LOWtrain_leco.py39logger = logging.getLogger(__name__)CODE
LOWhunyuan_image_minimal_inference.py38logger = logging.getLogger(__name__)CODE
LOWsdxl_gen_img.py69logger = logging.getLogger(__name__)CODE
LOWanima_minimal_inference.py39logger = logging.getLogger(__name__)CODE
LOWsdxl_minimal_inference.py32logger = logging.getLogger(__name__)CODE
LOWgen_img.py73logger = logging.getLogger(__name__)CODE
LOWsd3_train.py44logger = logging.getLogger(__name__)CODE
LOWtools/latent_upscaler.py23logger = logging.getLogger(__name__)CODE
LOWtools/original_control_net.py13logger = logging.getLogger(__name__)CODE
LOWtools/convert_diffusers20_original_sd.py12logger = logging.getLogger(__name__)CODE
LOWtools/merge_sd3_safetensors.py15logger = logging.getLogger(__name__)CODE
LOWtools/detect_face_rotate.py21logger = logging.getLogger(__name__)CODE
LOWtools/cache_text_encoder_outputs.py38logger = logging.getLogger(__name__)CODE
LOWtools/canny.py7logger = logging.getLogger(__name__)CODE
LOWtools/show_metadata.py7logger = logging.getLogger(__name__)CODE
LOWtools/cache_latents.py28logger = logging.getLogger(__name__)CODE
LOWtools/cache_latents.py31def set_tokenize_strategy(is_sd: bool, is_sdxl: bool, is_flux: bool, args: argparse.Namespace) -> None:CODE
LOWtools/convert_diffusers_to_flux.py39logger = logging.getLogger(__name__)CODE
LOWtools/merge_models.py11logger = logging.getLogger(__name__)CODE
LOWtools/resize_images_to_resolution.py12logger = logging.getLogger(__name__)CODE
LOWlibrary/anima_models.py132logger = logging.getLogger(__name__)CODE
LOWlibrary/hunyuan_image_models.py19logger = logging.getLogger(__name__)CODE
LOWlibrary/sdxl_original_unet.py38logger = logging.getLogger(__name__)CODE
LOWlibrary/sdxl_original_unet.py1050 def set_use_memory_efficient_attention(self, xformers: bool, mem_eff: bool) -> None:STRING
LOWlibrary/sdxl_original_unet.py1058 def set_use_sdpa(self, sdpa: bool) -> None:STRING
LOWlibrary/flux_train_utils.py30logger = logging.getLogger(__name__)CODE
LOWlibrary/strategy_flux.py18logger = logging.getLogger(__name__)CODE
LOWlibrary/compile_utils.py25logger = logging.getLogger(__name__)CODE
LOWlibrary/strategy_base.py18logger = logging.getLogger(__name__)CODE
LOWlibrary/strategy_sdxl.py15logger = logging.getLogger(__name__)CODE
LOWlibrary/fp8_optimization_utils.py18logger = logging.getLogger(__name__)CODE
LOWlibrary/hunyuan_image_text_encoder.py23logger = logging.getLogger(__name__)CODE
LOWlibrary/qwen_image_autoencoder_kl.py38logger = logging.getLogger(__name__)CODE
LOWlibrary/model_util.py22logger = logging.getLogger(__name__)CODE
85 more matches not shown…
Self-Referential Comments31 hits · 104 pts
SeverityFileLineSnippetContext
MEDIUMflux_train_network.py168 # This method is called before `assert_extra_args`, so we cannot use `self.is_schnell` here.COMMENT
MEDIUMhunyuan_image_minimal_inference.py512 # Define a function to move models to device if neededCOMMENT
MEDIUManima_minimal_inference.py387 # Define a function to move models to device if neededCOMMENT
MEDIUMtests/test_custom_offloading_utils.py73 # Create a simple model with weightsCOMMENT
MEDIUMtests/test_custom_offloading_utils.py194 # Create a fake future and test waitingCOMMENT
MEDIUMtests/test_custom_offloading_utils.py343 # Create a mini model with 4 blocksCOMMENT
MEDIUMtests/library/test_sai_model_spec.py187 # Create a tiny test PNG (1x1 pixel)COMMENT
MEDIUMtests/library/test_sai_model_spec.py225 # Create a test image fileCOMMENT
MEDIUMtests/library/test_strategy_lumina.py25 # Create a mock output object with hidden statesCOMMENT
MEDIUMtests/library/test_strategy_lumina.py77 # Create a mock modelCOMMENT
MEDIUMtests/library/test_strategy_lumina.py125 # Create a temporary directory for cachingCOMMENT
MEDIUMtests/library/test_strategy_lumina.py127 # Create a cache file pathCOMMENT
MEDIUMtests/library/test_strategy_lumina.py130 # Create the caching strategyCOMMENT
MEDIUMtests/library/test_strategy_lumina.py137 # Create a mock class for ImageInfoCOMMENT
MEDIUMtests/library/test_strategy_lumina.py143 # Create a sample input infoCOMMENT
MEDIUMtests/library/test_strategy_lumina.py187 # Create a temporary directory for cachingCOMMENT
MEDIUMtests/library/test_strategy_lumina.py195 # Create a smaller dummy image for testingCOMMENT
MEDIUMtests/library/test_strategy_lumina.py198 # Create the caching strategyCOMMENT
MEDIUMtests/library/test_strategy_lumina.py201 # Create a simple mock VAECOMMENT
MEDIUMtests/library/test_lumina_util.py8 # Create a test tensorCOMMENT
MEDIUMtests/library/test_lumina_util.py23 # Create a test tensorCOMMENT
MEDIUMtests/library/test_lumina_train_util.py113 # Create a mock noise schedulerCOMMENT
MEDIUMtests/library/test_lumina_train_util.py182 # Create a mock schedulerCOMMENT
MEDIUMtests/library/test_lumina_train_util.py196 # Create a mock args and setupCOMMENT
MEDIUMtests/library/test_lumina_models.py179 # Create a small NextDiT model for testingCOMMENT
MEDIUMlibrary/strategy_sdxl.py87 # Create a mask where the EOS tokens areSTRING
MEDIUMlibrary/fp8_optimization_utils.py472 # Create a new forward method with the patched version.COMMENT
MEDIUMlibrary/qwen_image_autoencoder_kl.py533 # Create the componentsSTRING
MEDIUMlibrary/hidden_states.py97 # Create a mask where the EOS tokens areSTRING
MEDIUMlibrary/lumina_train_util.py70 # Create a key based on the parametersCOMMENT
MEDIUMlibrary/sai_model_spec.py480 # Create the dataclassCOMMENT
AI Structural Patterns67 hits · 65 pts
SeverityFileLineSnippetContext
LOWgen_img_diffusers.py726CODE
LOWgen_img_diffusers.py1302CODE
LOWgen_img_diffusers.py1394CODE
LOWgen_img_diffusers.py1485CODE
LOWsdxl_gen_img.py1189CODE
LOWsdxl_gen_img.py396CODE
LOWgen_img.py1194CODE
LOWgen_img.py407CODE
LOWtools/latent_upscaler.py71CODE
LOWtools/dev/manual_test_anima_lllite_dryrun.py98CODE
LOWlibrary/anima_models.py1041CODE
LOWlibrary/sdxl_original_unet.py512CODE
LOWlibrary/sdxl_original_unet.py535CODE
LOWlibrary/sdxl_original_unet.py553CODE
LOWlibrary/sdxl_original_unet.py762CODE
LOWlibrary/fp8_optimization_utils.py239CODE
LOWlibrary/lpw_stable_diffusion.py724CODE
LOWlibrary/lpw_stable_diffusion.py984CODE
LOWlibrary/lpw_stable_diffusion.py1079CODE
LOWlibrary/lpw_stable_diffusion.py1173CODE
LOWlibrary/qwen_image_autoencoder_kl.py574CODE
LOWlibrary/qwen_image_autoencoder_kl.py753CODE
LOWlibrary/qwen_image_autoencoder_kl.py868CODE
LOWlibrary/sdxl_lpw_stable_diffusion.py717CODE
LOWlibrary/sdxl_lpw_stable_diffusion.py1024CODE
LOWlibrary/sdxl_lpw_stable_diffusion.py1119CODE
LOWlibrary/sdxl_lpw_stable_diffusion.py1213CODE
LOWlibrary/attention_processors.py227CODE
LOWlibrary/qwen_image_autoencoder_kl_2d.py230CODE
LOWlibrary/sd3_models.py250CODE
LOWlibrary/sd3_models.py574CODE
LOWlibrary/sd3_models.py748CODE
LOWlibrary/sd3_models.py1331CODE
LOWlibrary/original_unet.py706CODE
LOWlibrary/original_unet.py729CODE
LOWlibrary/original_unet.py747CODE
LOWlibrary/slicing_vae.py178CODE
LOWlibrary/slicing_vae.py361CODE
LOWlibrary/slicing_vae.py563CODE
LOWlibrary/mask_generator.py304CODE
LOWlibrary/lumina_models.py827CODE
LOWlibrary/lumina_models.py1035CODE
LOWlibrary/lumina_models.py1219CODE
LOWlibrary/hunyuan_image_modules.py494CODE
LOWlibrary/sai_model_spec.py378CODE
LOWlibrary/sai_model_spec.py501CODE
LOWfinetune/blip/med.py393CODE
LOWfinetune/blip/med.py670CODE
LOWfinetune/blip/med.py830CODE
LOWfinetune/blip/vit.py91CODE
LOWfinetune/blip/vit.py118CODE
LOWnetworks/extract_lora_from_models.py35CODE
LOWnetworks/control_net_lllite_anima.py315CODE
LOWnetworks/dylora.py121CODE
LOWnetworks/dylora.py275CODE
LOWnetworks/oft_flux.py130CODE
LOWnetworks/lokr.py82CODE
LOWnetworks/lora_flux.py38CODE
LOWnetworks/lora_flux.py724CODE
LOWnetworks/flux_extract_lora.py36CODE
7 more matches not shown…
Excessive Try-Catch Wrapping55 hits · 60 pts
SeverityFileLineSnippetContext
LOWanima_train_control_net_lllite.py846 except Exception as e:CODE
LOWhunyuan_image_train_network.py97 except Exception:CODE
LOWhunyuan_image_minimal_inference.py1041 except Exception as e:CODE
LOWanima_minimal_inference.py854 except Exception as e:CODE
LOWtools/merge_sd3_safetensors.py56 except Exception as e:CODE
LOWtools/dev/manual_test_anima_real_training.py102 except Exception as e:CODE
LOWtools/dev/manual_test_anima_real_training.py231 except Exception:CODE
LOWtools/dev/manual_test_anima_cache.py342 except Exception as e:CODE
LOWtools/dev/manual_test_anima_cache.py527 except Exception as e:CODE
LOWtools/dev/manual_test_anima_cache.py573 except Exception as e:CODE
LOWtools/dev/manual_test_anima_cache.py582 except Exception as e:CODE
LOWtools/dev/manual_test_anima_cache.py591 except Exception as e:CODE
LOWtools/dev/visualize_masks.py115 except Exception as e:CODE
LOWtests/download_training_data.py80 except Exception:CODE
MEDIUMtests/download_training_data.py108 print("Error: 'datasets' package not installed. Run: pip install datasets", file=sys.stderr)CODE
LOWlibrary/flux_train_utils.py88 except Exception:CODE
LOWlibrary/strategy_flux.py132 except Exception as e:CODE
LOWlibrary/strategy_base.py471 except Exception as e:STRING
LOWlibrary/strategy_sdxl.py250 except Exception as e:STRING
LOWlibrary/hunyuan_image_text_encoder.py659 except Exception as e:STRING
LOWlibrary/huggingface_util.py38 except Exception as e: # とりあえずRepositoryNotFoundErrorは確認したが他にあると困るのでCODE
LOWlibrary/huggingface_util.py61 except Exception as e: # RuntimeErrorを確認済みだが他にあると困るのでCODE
MEDIUMlibrary/huggingface_util.py45def uploader():CODE
LOWlibrary/lumina_train_util.py192 except Exception:CODE
LOWlibrary/sd3_train_utils.py423 except Exception:CODE
LOWlibrary/strategy_sd3.py307 except Exception as e:CODE
LOWlibrary/anima_train_utils.py568 except Exception:CODE
LOWlibrary/dataset.py919 except Exception as e:STRING
LOWlibrary/caching.py62 except Exception as e:CODE
LOWlibrary/sampling.py345 except Exception:CODE
LOWlibrary/device_utils.py12except Exception:CODE
LOWlibrary/device_utils.py18except Exception:CODE
LOWlibrary/device_utils.py23except Exception:CODE
LOWlibrary/device_utils.py28except Exception:CODE
LOWlibrary/device_utils.py107 except Exception as e:STRING
LOWlibrary/strategy_hunyuan_image.py118 except Exception as e:CODE
LOWlibrary/config_util.py691 except Exception:CODE
LOWlibrary/config_util.py699 except Exception:CODE
LOWlibrary/strategy_lumina.py195 except Exception as e:CODE
LOWlibrary/sai_model_spec.py472 except Exception as e:CODE
LOWlibrary/strategy_anima.py193 except Exception as e:CODE
LOWlibrary/ipex/hijacks.py425 except Exception:CODE
LOWlibrary/ipex/__init__.py7except Exception:CODE
LOWlibrary/ipex/__init__.py54 except Exception:CODE
LOWlibrary/ipex/__init__.py229 except Exception: # pylint: disable=broad-exception-caughtCODE
LOWlibrary/ipex/__init__.py232 except Exception as e:CODE
LOWfinetune/make_captions_by_git.py141 except Exception as e:STRING
LOWfinetune/tag_images_by_wd14_tagger.py93 except Exception as e:CODE
LOWfinetune/tag_images_by_wd14_tagger.py187 except Exception:CODE
LOWfinetune/make_captions.py57 except Exception as e:CODE
LOWfinetune/make_captions.py148 except Exception as e:CODE
LOWfinetune/image_loading_dataset.py28 except Exception as e:CODE
LOWfinetune/prepare_buckets_latents.py152 except Exception as e:CODE
LOWnetworks/svd_merge_lora.py232 except Exception:CODE
MEDIUMnetworks/svd_merge_lora.py228def format_lbws(lbws):CODE
Over-Commented Block45 hits · 44 pts
SeverityFileLineSnippetContext
LOWsd3_train_network.py281 # def call_unet(self, args, accelerator, unet, noisy_latents, timesteps, text_conds, batch, weight_dtype):COMMENT
LOWsdxl_train_control_net_lllite.py301COMMENT
LOWrequirements.txt21voluptuous==0.15.2COMMENT
LOWrequirements.txt41# protobuf==3.20.3COMMENT
LOWinpainting_minimal_inference.py1# Minimal inpainting inference script for SD1.5 and SDXL inpainting models.COMMENT
LOWtrain_network.py1161 trainable_params = network.prepare_optimizer_params(text_encoder_lr, args.unet_lr)COMMENT
LOWlumina_train.py321 # if args.blocks_to_swap is None:COMMENT
LOWhunyuan_image_minimal_inference.py341COMMENT
LOWsdxl_gen_img.py721 with torch.no_grad():COMMENT
LOWsdxl_gen_img.py741COMMENT
LOWsdxl_gen_img.py761COMMENT
LOWsdxl_gen_img.py781 # latents.dtypeCOMMENT
LOWsdxl_gen_img.py861 # # not working yetCOMMENT
LOWsdxl_minimal_inference.py121 # checkpointを読み込む。モデル変換についてはそちらの関数を参照COMMENT
LOWsd3_train.py841 # Follow: Section 5 of https://arxiv.org/abs/2206.00364.COMMENT
LOWsd3_train.py1041 # parser.add_argument(COMMENT
LOWtools/detect_face_rotate.py61 # # 回転する分、すこし画像サイズを大きくする→とりあえず無効化COMMENT
LOWtools/convert_diffusers_to_flux.py1# This script converts the diffusers of a Flux model to a safetensors file of a Flux.1 model.COMMENT
LOWtests/run_sdxl_inpainting_test.sh1#!/usr/bin/env bashCOMMENT
LOWtests/sd15_inpainting_test_lora.toml1# SD1.5 inpainting smoke-test config — lora mode.COMMENT
LOWtests/sd15_inpainting_test_ft.toml1# SD1.5 inpainting smoke-test config — ft (DreamBooth / full fine-tune) mode.COMMENT
LOWtests/sd15_inpainting_test_ft.toml61#sample_sampler = "euler_a"COMMENT
LOWtests/sdxl_inpainting_test_lora.toml1# SDXL inpainting smoke-test config — lora mode.COMMENT
LOWtests/sdxl_inpainting_test_ft.toml1# SDXL inpainting smoke-test config — ft (full fine-tune) mode.COMMENT
LOWtests/sdxl_inpainting_test_ft.toml61# --- sampling (disabled for smoke test) ---COMMENT
LOWtests/run_sd15_inpainting_test.sh1#!/usr/bin/env bashCOMMENT
LOWlibrary/anima_models.py621COMMENT
LOWlibrary/anima_models.py1621# def get_dit_config(state_dict, key_prefix=""):COMMENT
LOWlibrary/anima_models.py1641# dit_config["max_fps"] = 30COMMENT
LOWlibrary/anima_models.py1661# dit_config["extra_per_block_abs_pos_emb"] = FalseCOMMENT
LOWlibrary/qwen_image_autoencoder_kl.py1# Copied and modified from Diffusers (via Musubi-Tuner). Original copyright notice follows.COMMENT
LOWlibrary/sdxl_train_util.py361COMMENT
LOWlibrary/dataset.py621 min_size and max_size are ignored when enable_bucket is FalseCOMMENT
LOWlibrary/slicing_vae.py1# Modified from Diffusers to reduce VRAM usageCOMMENT
LOWlibrary/slicing_vae.py81 if org_dtype == torch.float16:COMMENT
LOWlibrary/args.py101 )COMMENT
LOWlibrary/args.py841COMMENT
LOWlibrary/lumina_models.py1# Copyright Alpha VLLM/Lumina Image 2.0 and contributorsCOMMENT
LOWlibrary/hunyuan_image_modules.py501COMMENT
LOWnetworks/control_net_lllite.py401COMMENT
LOWnetworks/lora_flux.py1061 del state_dict[key]COMMENT
LOWnetworks/lora_lumina.py441 # rank = NoneCOMMENT
LOWnetworks/lora_lumina.py721 # # split qkvCOMMENT
LOWnetworks/lora_lumina.py741 # alpha = state_dict.pop(f"{lora_name}.alpha")COMMENT
LOWnetworks/control_net_lllite_for_train.py441 # logger.info(info)COMMENT
Redundant / Tautological Comments14 hits · 22 pts
SeverityFileLineSnippetContext
LOWhunyuan_image_minimal_inference.py1174 # Check if latents are providedCOMMENT
LOWanima_minimal_inference.py980 # Check if latents are providedCOMMENT
LOWtools/resize_images_to_resolution.py28 # Check if the image is png, jpg or webp etc...COMMENT
LOWtools/resize_images_to_resolution.py49 # Check if the image needs resizingCOMMENT
LOWtools/dev/manual_test_anima_real_training.py85 # Check if it's a known errorCOMMENT
LOWtools/dev/manual_test_anima_cache.py335 # Check if any precision was lostCOMMENT
LOWlibrary/fp8_optimization_utils.py132 # Check if it's a weight key and matches target patternsCOMMENT
LOWlibrary/fp8_optimization_utils.py286 # Check if weight key matches target patterns and does not match exclude patternsCOMMENT
LOWlibrary/fp8_optimization_utils.py462 # Check if this module has a corresponding scale_weightCOMMENT
LOWlibrary/sai_model_spec.py307 # Read file and encode as base64COMMENT
LOWlibrary/sai_model_spec.py464 # Check if it's already a data URL or if it's a file pathCOMMENT
LOWfinetune/tag_images_by_wd14_tagger.py504 # Check if file existsCOMMENT
LOWfinetune/tag_images_by_wd14_tagger.py507 # Read file and remove new linesCOMMENT
LOWnetworks/lora_lumina.py582 # Set dims to type_dimsCOMMENT
Cross-Language Confusion4 hits · 18 pts
SeverityFileLineSnippetContext
HIGHlibrary/hunyuan_image_text_encoder.py284 "image_token_id": null,CODE
HIGHlibrary/hunyuan_image_text_encoder.py334 "sliding_window": null,CODE
HIGHlibrary/hunyuan_image_text_encoder.py338 "video_token_id": null,CODE
HIGHlibrary/original_unet.py94 "num_class_embeds": null,STRING
Docstring Block Structure3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHlibrary/safetensors_utils.py142Load a tensor from the file with memory-efficient strategies. **Note:** If device is 'cuda' , the transSTRING
HIGHlibrary/safetensors_utils.py269Convert byte tensor to float8 format if supported. Args: byte_tensor (torch.Tensor): Raw byte tensoSTRING
HIGHlibrary/utils.py99 Convert a string to a torch.dtype Args: s: string representation of the dtype default_dtype: dSTRING
AI Slop Vocabulary6 hits · 9 pts
SeverityFileLineSnippetContext
LOWhunyuan_image_train_network.py101 # If only one device is available, just use the original prompt list. We don't need to care about the distributiCOMMENT
LOWlibrary/flux_train_utils.py92 # If only one device is available, just use the original prompt list. We don't need to care about the distributiCOMMENT
LOWlibrary/lumina_train_util.py198 # If only one device is available, just use the original prompt list. We don't need to care about the distributiCOMMENT
LOWlibrary/sd3_models.py831 # just use a buffer alreadyCOMMENT
LOWlibrary/sd3_train_utils.py427 # If only one device is available, just use the original prompt list. We don't need to care about the distributiCOMMENT
LOWlibrary/sampling.py349 # If only one device is available, just use the original prompt list. We don't need to care about the distributiCOMMENT
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippetContext
LOWtests/run_sdxl_inpainting_test.sh14# Usage:COMMENT
LOWtests/run_sd15_inpainting_test.sh14# Usage:COMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsd3_minimal_inference.py283 # make sure to move to the device: some tensors are created in the constructor on the CPUCOMMENT