Skip to content

Commit 589a817

Browse files
authored
enhance model autodetection during import (#3043)
- Imported V2 legacy models will now autoconvert into diffusers at load time regardless of setting of --ckpt_convert. - model manager `heuristic_import()` function now looks for side-by-side yaml and vae files for custom configuration and VAE respectively. Example of this: illuminati-v1.1.safetensors illuminati-v1.1.vae.safetensors illuminati-v1.1.yaml When the user tries to import `illuminati-v1.1.safetensors`, the yaml file will be used for its configuration, and the VAE will be used for its VAE. Conversion to diffusers will happen if needed, and the yaml file will be used to determine which V2 format (if any) to apply. NOTE that the changes to `ckpt_to_diffusers.py` were previously reviewed by @JPPhoto on the `main` branch and approved.
2 parents 1cb8896 + dcb21c0 commit 589a817

File tree

3 files changed

+606
-267
lines changed

3 files changed

+606
-267
lines changed

docs/installation/050_INSTALLING_MODELS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,26 @@ description for the model, whether to make this the default model that
211211
is loaded at InvokeAI startup time, and whether to replace its
212212
VAE. Generally the answer to the latter question is "no".
213213

214+
### Specifying a configuration file for legacy checkpoints
215+
216+
Some checkpoint files come with instructions to use a specific .yaml
217+
configuration file. For InvokeAI load this file correctly, please put
218+
the config file in the same directory as the corresponding `.ckpt` or
219+
`.safetensors` file and make sure the file has the same basename as
220+
the weights file. Here is an example:
221+
222+
```bash
223+
wonderful-model-v2.ckpt
224+
wonderful-model-v2.yaml
225+
```
226+
227+
Similarly, to use a custom VAE, name the VAE like this:
228+
229+
```bash
230+
wonderful-model-v2.vae.pt
231+
```
232+
233+
214234
### Converting legacy models into `diffusers`
215235

216236
The CLI `!convert_model` will convert a `.safetensors` or `.ckpt`

0 commit comments

Comments
 (0)