Fix sd hijack infotext cased by conda cache #16673
Closed
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.
Description
fix: missing infotext cased by conda cache
some generation params such as TI hashes or Emphasis is added in sd_hijack / sd_hijack_clip
if conda are fetche from cache sd_hijack_clip will not be executed and it won't have a chance to to add generation params
fix: generation params will also be missing if webui is in non low-vram mode because the hijack.extra_generation_params was never read after calculate_hr_conds
in order to fix this the generation parameters from sd_hijack will also has to be cahched along with conda cache
unfortunately caching generation parameters is not straightforward as sd_hijack could be called multiple times and in some cases
later calles will modify or add to existing generation parameters (TI hashes are combined from positive and negative prompts)
essentially you can't really cash the results but if we turn the results into actions (function) then we can cache the function object that will be use do add the necessary parameters
then after conda is calculated call all those actions to populate the generation parameters
in order to implement this was maintaining backwards compatibility
I created a custom class
util.GenerationParamsState
, when self.hijack.extra_generation_params is assigned with the value of this class, webui will store these with conda cache then execute them after conda is calculatedChecklist: