Skip to content

Commit 980b174

Browse files
author
legionfu
committed
设置页面添加选项
1 parent 376accc commit 980b174

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* 插件增加Core和ALL两种运行模式,Core模式仅支持WebUI的基本参数+ControlNet参数。All模式则会尽可能多的支持页面上的参数,但是缺点是有概率导致UI卡住,无限转圈。
66

77
### Bug Fixes:
8+
* 增加了错误参数纠正步骤,处理Controlnet tab保存序号错误的问题。
89
* 修复了一些已知的问题。
910
* 修复了一些img2img模式丢失的参数。
1011

javascript/state.core.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ state.core = (function () {
632632
for (let key in stored_config){
633633
if(key.indexOf("allow-preview") !== -1 && key.indexOf("ext-control-net") !== -1)
634634
{
635+
console.log("allow-preview改成false")
635636
stored_config[key] = "false"
636637
}
637638
}

scripts/lightdiffusionflow_config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Image_Components_Key = {}
66
LoRAs_In_Use = "loras_in_use"
77
Flow_Save_mode = "All"
8+
Auto_Fix_Params = True
89

910
class OutputPrompt_English:
1011

@@ -123,7 +124,7 @@ def note_for_save_mode():
123124
# 改成函数调用,修改配置之后能及时刷新
124125
def init():
125126
global PNGINFO_2_LIGHTDIFFUSIONFLOW,PNGINFO_CN_2_LIGHTDIFFUSIONFLOW
126-
global OutputPrompt,Flow_Save_mode,Image_Components_Key
127+
global OutputPrompt,Flow_Save_mode,Auto_Fix_Params,Image_Components_Key
127128
# PNG Info的功能除了主要的选项以外其他的都靠第三方插件的主动支持,后续再考虑能否有优化的办法
128129
#print(parameters_copypaste.paste_fields)
129130
PNGINFO_2_LIGHTDIFFUSIONFLOW = {
@@ -175,6 +176,12 @@ def init():
175176
except:
176177
Flow_Save_mode = "Core"
177178

179+
# 自动纠正错误的参数
180+
try:
181+
Auto_Fix_Params = webui_settings["lightdiffusionflow-auto-fix-params"]
182+
except:
183+
Auto_Fix_Params = True
184+
178185
language_successed = False
179186
auto_language = False
180187
try:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lightdiffusionflow_version = "v2.1.2"
1+
lightdiffusionflow_version = "v2.1.3"

scripts/state_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import launch
2323

2424
from scripts import lightdiffusionflow_version, lightdiffusionflow_config
25-
from scripts.lightdiffusionflow_config import OutputPrompt, Flow_Save_mode, LoRAs_In_Use
25+
from scripts.lightdiffusionflow_config import OutputPrompt, Flow_Save_mode, Auto_Fix_Params, LoRAs_In_Use
2626
import scripts.lightdiffusionflow_config as lf_config
2727

2828
# current_path = os.path.abspath(os.path.dirname(__file__))
@@ -512,6 +512,9 @@ def config_filter(config):
512512
except KeyError as e:
513513
pass
514514

515+
if(Auto_Fix_Params == False):
516+
return new_config
517+
515518
# 处理旧版插件保存的错误参数问题
516519
print("-------错误参数纠正-------")
517520
found_tabs = []

scripts/state_settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,13 @@ def on_ui_settings():
2929
}, section=section)
3030
)
3131

32+
shared.opts.add_option("lightdiffusionflow-auto-fix-params",
33+
shared.OptionInfo(
34+
True,
35+
f"自动纠正错误的参数/Automatically fix incorrect parameters",
36+
gr.Checkbox,
37+
{"interactive": True},
38+
section=section)
39+
)
3240

3341
scripts.script_callbacks.on_ui_settings(on_ui_settings)

0 commit comments

Comments
 (0)