-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Refactor config class and reorganize image generation options #4309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StAlKeR7779
reviewed
Aug 18, 2023
hipsterusername
approved these changes
Aug 20, 2023
Added review but believe more are needed |
StAlKeR7779
approved these changes
Aug 21, 2023
psychedelicious
approved these changes
Aug 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Refactoring
This PR refactors
invokeai.app.services.config
to be easier to maintain by splitting off the argument, environment and init file parsing code from the InvokeAIAppConfig object. This will hopefully make it easier for people to find the place where the various settings are defined.New Features
In collaboration with @StAlKeR7779 , I have renamed and reorganized the settings controlling image generation and model management to be more intuitive. The relevant portion of the init file now looks like this:
Key differences are:
Performance/Memory
intoDevice
,Generation
andModel Cache
device
. The value of this option is one of {auto
,cpu
,cuda
,cuda:1
,mps
}attention_type
. Possible values are {auto
,normal
,xformers
,sliced
,torch-sdp
}attention_slice_size
whensliced
attention is in use. The value of this option is one of {auto
,max
} or an integer between 1 and 8.@StAlKeR7779 Please confirm that I wired the
attention_type
andattention_slice_size
configuration options to the diffusers backend correctly.In addition, I have exposed the generation-related configuration options to the TUI:
Backward Compatibility
This refactor should be backward compatible with earlier versions of
invokeai.yaml
. If the user re-runs theinvokeai-configure
script,invokeai.yaml
will be upgraded to the current format. Several configuration attributes had to be changed in order to preserve backward compatibility. These attributes been changed in the code where appropriate. For the record:max_cache_size
ram_cache_size
max_vram_cache
vram_cache_size
always_use_cpu
use_cpu