mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-30 19:21:21 +00:00
Properly load/save infotext for empty selection of hrfix additional modules (#2156)
empty selection for *Hires VAE / TE* means 'use modules built-in to the model file', same as top-row VAE / TE selection. But this must be written to infotext as something, to distinguish from the non-HiRes case.
This commit is contained in:
@@ -456,13 +456,18 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
|
|||||||
if sorted(modules) != sorted(basename_modules):
|
if sorted(modules) != sorted(basename_modules):
|
||||||
res['VAE/TE'] = modules
|
res['VAE/TE'] = modules
|
||||||
|
|
||||||
# if 'Use same choices' was the selection for Hires VAE / Text Encoder, it will be the only option written
|
# if 'Use same choices' was the selection for Hires VAE / Text Encoder, it will be the only Hires Module
|
||||||
# but will not have matched the known modules, so will not be in hr_modules
|
# if the selection was empty, it will be the only Hires Module, saved as 'Built-in'
|
||||||
if 'Hires Module 1' in res:
|
if 'Hires Module 1' in res:
|
||||||
if res['Hires Module 1'] == 'Use same choices':
|
if res['Hires Module 1'] == 'Use same choices':
|
||||||
hr_modules = ['Use same choices']
|
hr_modules = ['Use same choices']
|
||||||
|
elif res['Hires Module 1'] == 'Built-in':
|
||||||
|
hr_modules = []
|
||||||
|
|
||||||
res['Hires VAE/TE'] = hr_modules
|
res['Hires VAE/TE'] = hr_modules
|
||||||
|
else:
|
||||||
|
# no Hires Module infotext, use default
|
||||||
|
res['Hires VAE/TE'] = ['Use same choices']
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
@@ -1281,8 +1281,10 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
|
|||||||
|
|
||||||
self.extra_generation_params["Hires checkpoint"] = self.hr_checkpoint_info.short_title
|
self.extra_generation_params["Hires checkpoint"] = self.hr_checkpoint_info.short_title
|
||||||
|
|
||||||
if isinstance(self.hr_additional_modules, list) and len(self.hr_additional_modules) > 0:
|
if isinstance(self.hr_additional_modules, list):
|
||||||
if 'Use same choices' in self.hr_additional_modules:
|
if self.hr_additional_modules == []:
|
||||||
|
self.extra_generation_params['Hires Module 1'] = 'Built-in'
|
||||||
|
elif 'Use same choices' in self.hr_additional_modules:
|
||||||
self.extra_generation_params['Hires Module 1'] = 'Use same choices'
|
self.extra_generation_params['Hires Module 1'] = 'Use same choices'
|
||||||
else:
|
else:
|
||||||
for i, m in enumerate(self.hr_additional_modules):
|
for i, m in enumerate(self.hr_additional_modules):
|
||||||
|
|||||||
Reference in New Issue
Block a user