A latent text-to-image diffusion model
This report summarizes scanner evidence for CompVis/stable-diffusion, a Jupyter Notebook project with 73,613 GitHub stars. SynthScan examined 18,009 lines of code across 84 source files, recording 186 pattern matches distributed across 9 syntactic categories. The legacy adjusted pattern signal is 13.3 (Moderate 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.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-11-27.
Can maintainers explain intent, assumptions, and trade-offs? 83 finding(s).
Are imports declared and package/API names verified? 36 finding(s).
Are wrappers, guards, and repeated structures necessary? 116 finding(s).
Which changes need focused human review? 186 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
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.
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.
The scanner identified 186 distinct pattern matches across 9 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | ldm/modules/image_degradation/bsrgan.py | 3 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/bsrgan.py | 5 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/bsrgan.py | 10 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/bsrgan.py | 43 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/bsrgan.py | 45 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/bsrgan.py | 222 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/bsrgan.py | 224 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 182 | # -------------------------------------------- | COMMENT |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 184 | # -------------------------------------------- | COMMENT |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 244 | # -------------------------------------------- | COMMENT |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 246 | # -------------------------------------------- | COMMENT |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 618 | # -------------------------------------------- | COMMENT |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 620 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 200 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 202 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 217 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 219 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 269 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 271 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 296 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 298 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 639 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 641 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 763 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 765 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 836 | # -------------------------------------------- | COMMENT |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 838 | # -------------------------------------------- | COMMENT |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 16 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 19 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 22 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 175 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 178 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 234 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 236 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 240 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 370 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 372 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 376 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 612 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/utils_image.py | 614 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 61 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 63 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 87 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 89 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 147 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 149 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 488 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 490 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 519 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 525 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 693 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/utils_image.py | 695 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/bsrgan_light.py | 18 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/bsrgan_light.py | 20 | # -------------------------------------------- | STRING |
| MEDIUM⚡ | ldm/modules/image_degradation/bsrgan_light.py | 25 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/bsrgan_light.py | 43 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/bsrgan_light.py | 45 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/bsrgan_light.py | 222 | # -------------------------------------------- | STRING |
| MEDIUM | ldm/modules/image_degradation/bsrgan_light.py | 224 | # -------------------------------------------- | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | notebook_helpers.py | 10 | CODE | |
| LOW | main.py | 1 | CODE | |
| LOW | main.py | 1 | CODE | |
| LOW | main.py | 10 | CODE | |
| LOW | main.py | 10 | CODE | |
| LOW | main.py | 16 | CODE | |
| LOW | main.py | 16 | CODE | |
| LOW | scripts/inpaint.py | 1 | CODE | |
| LOW | scripts/txt2img.py | 1 | CODE | |
| LOW | scripts/txt2img.py | 1 | CODE | |
| LOW | scripts/txt2img.py | 15 | CODE | |
| LOW | scripts/knn2img.py | 1 | CODE | |
| LOW | scripts/knn2img.py | 2 | CODE | |
| LOW | scripts/knn2img.py | 4 | CODE | |
| LOW | scripts/knn2img.py | 10 | CODE | |
| LOW | scripts/img2img.py | 3 | CODE | |
| LOW | scripts/img2img.py | 3 | CODE | |
| LOW | ldm/util.py | 6 | CODE | |
| LOW | ldm/util.py | 7 | CODE | |
| LOW | ldm/models/diffusion/ddim.py | 6 | CODE | |
| LOW | ldm/models/diffusion/plms.py | 6 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 2 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/__init__.py | 1 | CODE | |
| LOW | ldm/modules/x_transformer.py | 8 | CODE | |
| LOW | ldm/modules/losses/__init__.py | 1 | CODE | |
| LOW | ldm/modules/losses/vqperceptual.py | 4 | CODE | |
| LOW | ldm/modules/losses/contperceptual.py | 4 | CODE | |
| LOW | ldm/modules/encoders/modules.py | 5 | CODE | |
| LOW | ldm/modules/image_degradation/__init__.py | 1 | CODE | |
| LOW | ldm/modules/image_degradation/__init__.py | 2 | CODE | |
| LOW | ldm/modules/diffusionmodules/util.py | 11 | CODE | |
| LOW | ldm/modules/diffusionmodules/openaimodel.py | 2 | CODE | |
| LOW | ldm/modules/diffusionmodules/openaimodel.py | 4 | CODE | |
| LOW | ldm/data/base.py | 2 | CODE | |
| LOW | ldm/data/base.py | 2 | CODE | |
| LOW | ldm/data/base.py | 2 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | notebook_helpers.py | 59 | CODE | |
| LOW | main.py | 340 | CODE | |
| LOW | scripts/txt2img.py | 98 | CODE | |
| LOW | scripts/img2img.py | 60 | CODE | |
| LOW | scripts/sample_diffusion.py | 36 | CODE | |
| LOW | scripts/sample_diffusion.py | 143 | CODE | |
| LOW | ldm/models/diffusion/plms.py | 173 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 509 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 654 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 1251 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 1402 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 177 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 289 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 321 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 965 | CODE | |
| LOW | ldm/modules/x_transformer.py | 371 | CODE | |
| LOW | ldm/modules/x_transformer.py | 481 | CODE | |
| LOW | ldm/modules/image_degradation/bsrgan.py | 438 | CODE | |
| LOW | ldm/modules/image_degradation/bsrgan.py | 530 | CODE | |
| LOW | ldm/modules/image_degradation/bsrgan.py | 617 | CODE | |
| LOW | ldm/modules/image_degradation/utils_image.py | 380 | CODE | |
| LOW | ldm/modules/image_degradation/utils_image.py | 401 | CODE | |
| LOW | ldm/modules/image_degradation/utils_image.py | 441 | CODE | |
| LOW | ldm/modules/image_degradation/utils_image.py | 642 | CODE | |
| LOW | ldm/modules/image_degradation/bsrgan_light.py | 442 | CODE | |
| LOW | ldm/modules/image_degradation/bsrgan_light.py | 534 | CODE | |
| LOW | ldm/modules/diffusionmodules/util.py | 21 | CODE | |
| LOW | ldm/modules/diffusionmodules/openaimodel.py | 443 | CODE | |
| LOW | ldm/modules/diffusionmodules/openaimodel.py | 751 | CODE | |
| LOW | ldm/data/imagenet.py | 150 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | notebook_helpers.py | 188 | CODE | |
| LOW | notebook_helpers.py | 208 | CODE | |
| LOW | main.py | 163 | CODE | |
| LOW | scripts/knn2img.py | 161 | CODE | |
| LOW | ldm/models/autoencoder.py | 15 | CODE | |
| LOW | ldm/models/diffusion/ddim.py | 57 | CODE | |
| LOW | ldm/models/diffusion/ddim.py | 114 | CODE | |
| LOW | ldm/models/diffusion/ddim.py | 166 | CODE | |
| LOW | ldm/models/diffusion/classifier.py | 30 | CODE | |
| LOW | ldm/models/diffusion/plms.py | 58 | CODE | |
| LOW | ldm/models/diffusion/plms.py | 115 | CODE | |
| LOW | ldm/models/diffusion/plms.py | 173 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 46 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 426 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 1079 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 1110 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 1166 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 1217 | CODE | |
| LOW | ldm/models/diffusion/ddpm.py | 1251 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 177 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 965 | CODE | |
| LOW | ldm/models/diffusion/dpm_solver/sampler.py | 22 | CODE | |
| LOW | ldm/modules/x_transformer.py | 216 | CODE | |
| LOW | ldm/modules/x_transformer.py | 371 | CODE | |
| LOW | ldm/modules/losses/vqperceptual.py | 44 | CODE | |
| LOW | ldm/modules/losses/contperceptual.py | 8 | CODE | |
| LOW | ldm/modules/diffusionmodules/openaimodel.py | 443 | CODE | |
| LOW | ldm/modules/diffusionmodules/openaimodel.py | 751 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | notebook_helpers.py | 208 | def make_convolutional_sample(batch, model, mode="vanilla", custom_steps=None, eta=1.0, swap_mode=False, masked=False, | CODE |
| LOW | main.py | 257 | def on_pretrain_routine_start(self, trainer, pl_module): | CODE |
| LOW | scripts/sample_diffusion.py | 79 | def make_convolutional_sample(model, batch_size, vanilla=False, custom_steps=None, eta=1.0,): | CODE |
| LOW | ldm/util.py | 96 | def _do_parallel_data_prefetch(func, Q, data, idx, idx_to_fn=False): | CODE |
| LOW | ldm/models/diffusion/ddpm.py | 530 | def _get_denoise_row_from_list(self, samples, desc='', force_no_decoder_quantization=False): | CODE |
| LOW | ldm/models/diffusion/ddpm.py | 766 | def differentiable_decode_first_stage(self, z, predict_cids=False, force_not_quantize=False): | CODE |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 439 | def get_orders_and_timesteps_for_singlestep_solver(self, steps, order, skip_type, t_T, t_0, device): | CODE |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 551 | def singlestep_dpm_solver_second_update(self, x, s, t, r1=0.5, model_s=None, return_intermediate=False, solver_type= | CODE |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 633 | def singlestep_dpm_solver_third_update(self, x, s, t, r1=1./3., r2=2./3., model_s=None, model_s1=None, return_interm | CODE |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 755 | def multistep_dpm_solver_second_update(self, x, model_prev_list, t_prev_list, t, solver_type="dpm_solver"): | CODE |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 812 | def multistep_dpm_solver_third_update(self, x, model_prev_list, t_prev_list, t, solver_type='dpm_solver'): | CODE |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 859 | def singlestep_dpm_solver_update(self, x, s, t, order, return_intermediate=False, solver_type='dpm_solver', r1=None, | CODE |
| LOW | ldm/models/diffusion/dpm_solver/dpm_solver.py | 885 | def multistep_dpm_solver_update(self, x, model_prev_list, t_prev_list, t, order, solver_type='dpm_solver'): | CODE |
| LOW | ldm/modules/losses/vqperceptual.py | 11 | def hinge_d_loss_with_exemplar_weights(logits_real, logits_fake, weights): | CODE |
| LOW | ldm/modules/losses/vqperceptual.py | 85 | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): | CODE |
| LOW | ldm/modules/losses/contperceptual.py | 32 | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): | CODE |
| LOW | ldm/modules/image_degradation/bsrgan.py | 530 | def degradation_bsrgan_variant(image, sf=4, isp_model=None): | CODE |
| LOW | ldm/modules/image_degradation/utils_image.py | 708 | def calculate_weights_indices(in_length, out_length, scale, kernel, kernel_width, antialiasing): | CODE |
| LOW | ldm/modules/image_degradation/bsrgan_light.py | 534 | def degradation_bsrgan_variant(image, sf=4, isp_model=None): | CODE |
| LOW | ldm/modules/diffusionmodules/util.py | 63 | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbose=True): | CODE |
| LOW | ldm/data/imagenet.py | 80 | def _prepare_human_to_integer_label(self): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | notebook_helpers.py | 264 | except: | CODE |
| HIGH | main.py | 414 | except AttributeError: | CODE |
| HIGH | main.py | 285 | except FileNotFoundError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | main.py | 720 | except Exception: | CODE |
| LOW | main.py | 725 | except Exception: | CODE |
| LOW | scripts/txt2img.py | 84 | except Exception: | CODE |
| MEDIUM | scripts/txt2img.py | 77 | def load_replacement(x): | CODE |
| LOW | ldm/util.py | 180 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | main.py | 421 | # `--key value` arguments are interpreted as arguments to the trainer. | COMMENT |
| LOW | main.py | 441 | # params: | COMMENT |
| LOW | ldm/modules/image_degradation/bsrgan_light.py | 361 | # img += np.random.normal(0, noise_level / 255.0, img.shape).astype(np.float32) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ldm/modules/encoders/modules.py | 9 | from ldm.modules.x_transformer import Encoder, TransformerWrapper # TODO: can we directly rely on lucidrains code and s | CODE |