-
-
Notifications
You must be signed in to change notification settings - Fork 258
Add base settings' target_resolution to the image cache key.
#1134
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
base: master
Are you sure you want to change the base?
Conversation
This makes changes to a settings `resolution` field use different cache keys. This fixes changing the resolution field not regenerating cache when latent caching is enabled, effectively ignoring changes to the `resolution` setting until cache is regenerated for a different reason. This will also effectively force all users to regenerate their caches (sorry!).
|
I didn't realize we had any useful feature that automatically detects if changes were made that require re-caching. I assumed you manually have to delete the cache when you do that. Am I wrong? |
|
If I remember correctly, the name was derived from the grouping of training samples into variations. If all the |
Currently if you change any parameter in a concept's image tab, it will effectively generate a different cache key for that concept (stably so, so if you swap back to the previous parameter set, it will go back to using the previous cache key). Most other base configuration parameters do not affect image cache generation, other than the target resolution (IF, and only IF, the concept's image resolution override parameter isn't enabled and set to a different value).
The cache key is related to samples, in that two variations of the same source image will go under the same cache key, and the settings which control the cache key are mostly settings which generate different variations, but the enable-target-resolution-override and target-resolution-override settings are exceptions to this that currently cause a different cache key (and importantly different results) to be generated if set to different values. Whether this current behavior of changing the cache key based on image parameters should extend to the model's base target-resolution is an open question. I propose that it should, as it is likely what users will want and is what is currently the case for almost every configuration open--change a setting and get a different result, instead of invisibly(!) use the existing cache (if enabled) and get a stale result (if clear-cache is not enabled). I believe currently the only other case where the cache can go stale/bad relies on users modifying/adding/removing the images in the path of a concept. I am not aware of any other setting which would affect the result of an image latent that is not on the list (path, whether to navigate to subdirs, image variation and resolution settings, and the random seed) already, other than the config's base resolution, which this PR adds. Let me know if you are aware of anything else I am missing, though. |
|
I want to highlight an unfortunate part of this change however, is that we don't actually care about the value of The effect of this is the following table:
What we actually want is this table instead, where cache is only changed when the values of
With that said, this change reduces potential incorrect results, even if it potentially forces cache to be regenerated in cases where it is not necessary. |
|
Besides the resolution, I think the following settings should invalidate your cache, but don't:
This list might be incomplete and I haven't checked each one of them, just to illustrate my point: |
Future ref from Maed |
This makes changes to a settings
target_resolutionfield force the use of different cache keys forimagelatents. This fixes changing the base settings (not the per-concept one)target resolutionfield not regenerating cache when latent caching is enabled, effectively ignoring changes to theresolutionsetting until cache is regenerated for a different reason. Changing the per-concepttarget resolution overridealready worked as expected for regenerating the cache as is unaffected by this change.This change will also change all image cache keys, which will force all users to automatically regenerate their image caches. Previously generated caches will need to be cleaned manually, if the
clear_cache_before_trainingsetting is not enabled.