Skip to content

Conversation

@DustyShoe
Copy link
Contributor

@DustyShoe DustyShoe commented Oct 27, 2025

Summary

Ensured ControlNet diffusers configs detect and propagate the fp16 repo variant so fp16 weight files such as diffusion_pytorch_model.fp16.safetensors are accepted during loading.

Root cause
In the earlier implementation of ControlNet_Diffusers_Config_Base.from_model_on_disk(), the method simply returned cls(**override_fields) once it had validated the directory and base model. Because the repo_variant field was left at its default (ModelRepoVariant.Default), downstream loading logic always looked for the default diffusers weight filename (diffusion_pytorch_model.bin). That default does not match SDXL ControlNet repositories that ship only fp16 weights named diffusion_pytorch_model.fp16.safetensors, so InvokeAI failed to find the downloaded file even though it was present.

Resolution
The updated version now detects the repository variant before instantiating the config. It calls _get_repo_variant_or_raise(), which scans all .safetensors and .bin files beneath the model directory. When it encounters a filename that carries the .fp16 suffix—such as diffusion_pytorch_model.fp16.safetensors—it returns ModelRepoVariant.FP16. Passing that value into the config ensures the loader subsequently searches for the fp16-weight filename instead of the default .bin, allowing SDXL ControlNet models to load successfully without renaming their files

Related Issues / Discussions

After deleting and reinstalling SDXL Depth Map CN Invoke no longer able to load it from assigned folder. Installation with model manager shows no error.
https://discord.com/channels/1020123559063990373/1149506274971631688/1432444353200128000
Fixes #8645

QA Instructions

Did tests with my local dev build and CN loading works as intended.

Merge Plan

Might need a look from someone more experienced.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added python PRs that change python files backend PRs that change backend files labels Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend PRs that change backend files python PRs that change python files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: Unable to load Depth Map Controlnet after reinstalling from Model Manager.

1 participant