Bugfix: Limit RAM and VRAM cache settings to permissible values #4214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Have you discussed this change with the InvokeAI team?
Have you updated all relevant documentation?
Description
@JPPhoto discovered that if he had previously manually set the value of
max_ram_cacheto greater than the amount available on his system, thatconfigure_invokeaiwould crash. This is because the UI is now reading system values to set up the maximum value for the RAM and VRAM cache sliders, but was not checking that the old setting was within range.This fixes the issue by clipping RAM and VRAM cache settings to the maximum and minimum permissible values.
It also cleans up some unneeded import code located in
invokeai.frontend.install.__init__, which was exacerbating circular dependency issues and had no benefit other than making somefromstatements shorter.Related Tickets & Documents
See this for @JPPhoto bug report and discussion thread:
https://discord.com/channels/1020123559063990373/1042475531079262378/1138844145167892651