mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-10 15:00:23 +00:00
1、Implement cfg_trunc calculation directly using timesteps, without intermediate steps.
2、Deprecate and remove the guidance_scale parameter because it used in inference not train 3、Add inference command-line arguments --ct for cfg_trunc_ratio and --rc for renorm_cfg to control CFG truncation and renormalization during inference.
This commit is contained in:
@@ -6188,6 +6188,16 @@ def line_to_prompt_dict(line: str) -> dict:
|
||||
prompt_dict["controlnet_image"] = m.group(1)
|
||||
continue
|
||||
|
||||
m = re.match(r"ct (.+)", parg, re.IGNORECASE)
|
||||
if m:
|
||||
prompt_dict["cfg_trunc_ratio"] = float(m.group(1))
|
||||
continue
|
||||
|
||||
m = re.match(r"rc (.+)", parg, re.IGNORECASE)
|
||||
if m:
|
||||
prompt_dict["renorm_cfg"] = float(m.group(1))
|
||||
continue
|
||||
|
||||
except ValueError as ex:
|
||||
logger.error(f"Exception in parsing / 解析エラー: {parg}")
|
||||
logger.error(ex)
|
||||
|
||||
Reference in New Issue
Block a user