mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-07-21 21:01:24 +08:00
infotext
This commit is contained in:
parent
21e78ee7ea
commit
f7cb7cdb0d
@ -53,6 +53,7 @@ class ForgeDiffusionEngine:
|
||||
self.first_stage_model = None
|
||||
self.cond_stage_model = None
|
||||
self.use_distilled_cfg_scale = False
|
||||
self.use_shift = False
|
||||
self.is_sd1 = False
|
||||
self.is_sdxl = False
|
||||
self.is_flux = False # affects the usage of TAESD
|
||||
|
||||
@ -34,6 +34,7 @@ class Lumina2(ForgeDiffusionEngine):
|
||||
self.forge_objects_original = self.forge_objects.shallow_copy()
|
||||
self.forge_objects_after_applying_lora = self.forge_objects.shallow_copy()
|
||||
|
||||
self.use_shift = True
|
||||
self.is_flux = True
|
||||
|
||||
@torch.inference_mode()
|
||||
|
||||
@ -36,6 +36,7 @@ class Wan(ForgeDiffusionEngine):
|
||||
self.forge_objects_original = self.forge_objects.shallow_copy()
|
||||
self.forge_objects_after_applying_lora = self.forge_objects.shallow_copy()
|
||||
|
||||
self.use_shift = True
|
||||
self.is_wan = True
|
||||
|
||||
@torch.inference_mode()
|
||||
|
||||
@ -398,6 +398,9 @@ def parse_generation_parameters(x: str, skip_fields: list[str] | None = None):
|
||||
if "Refiner switch by sampling steps" not in res:
|
||||
res["Refiner switch by sampling steps"] = False
|
||||
|
||||
if "Shift" in res:
|
||||
res["Distilled CFG Scale"] = res.pop("Shift")
|
||||
|
||||
infotext_versions.backcompat(res)
|
||||
|
||||
for key in skip_fields:
|
||||
|
||||
@ -727,10 +727,10 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
|
||||
"CFG scale": p.cfg_scale,
|
||||
}
|
||||
|
||||
# if hires fix was used, p.firstpass_use_distilled_cfg_scale is appropriately set, otherwise it doesn't exist
|
||||
firstpass_use_distilled_cfg_scale = getattr(p, "firstpass_use_distilled_cfg_scale", p.sd_model.use_distilled_cfg_scale)
|
||||
if firstpass_use_distilled_cfg_scale:
|
||||
if p.sd_model.use_distilled_cfg_scale:
|
||||
generation_params["Distilled CFG Scale"] = p.distilled_cfg_scale
|
||||
if p.sd_model.use_shift:
|
||||
generation_params["Shift"] = p.distilled_cfg_scale
|
||||
|
||||
noise_source_type = get_noise_source_type()
|
||||
|
||||
@ -1418,7 +1418,6 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
|
||||
if self.hr_checkpoint_name and self.hr_checkpoint_name != "Use same checkpoint":
|
||||
checkpoint_changed = main_entry.checkpoint_change(self.hr_checkpoint_name, preset=None, save=False, refresh=False)
|
||||
if checkpoint_changed:
|
||||
self.firstpass_use_distilled_cfg_scale = self.sd_model.use_distilled_cfg_scale
|
||||
reload = True
|
||||
|
||||
if reload:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user