mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
a071873327
We were storing all types of models by their model ID, which is a format like `sd-1/main/deliberate`. This meant we had to do a lot of extra parsing, because nodes actually wants something like `{base_model: 'sd-1', model_name: 'deliberate'}`. Some of this parsing was done with zod's error-throwing `parse()` method, and in other places it was done with brittle string parsing. This commit refactors the state to use the object form of models. There is still a bit of string parsing done in the to construct the ID from the object form, but it's far less complicated. Also, the zod parsing is now done using `safeParse()`, which does not throw. This requires a few more conditional checks, but should prevent further crashes. |
||
---|---|---|
.. | ||
canvas | ||
controlNet | ||
dynamicPrompts | ||
embedding | ||
gallery | ||
imageDeletion | ||
lora | ||
nodes | ||
parameters | ||
system | ||
ui |