Skip to content

Commit ebba188

Browse files
author
legionfu
committed
2 parents 46626df + 2b3bb75 commit ebba188

File tree

6 files changed

+35
-6
lines changed

6 files changed

+35
-6
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ In the SD Web UI, configure the desired options, and click the "Export" button t
4040
In the SD Web UI, click the "FileBox", select the corresponding flow file, and import the parameters from the file.
4141
You can also directly drag and drop the flow file into the "FileBox" for importing.
4242

43+
**Currently, the plugin supports SD WebUI versions v1.5 and above, and compatibility testing for earlier versions has not been conducted.**
44+
**If not due to compatibility issues with essential functionalities, it is strongly recommended to upgrade to version v1.6 or above before using this plugin!**
45+
4346
### Examples
4447

4548
You can find several official examples in the example/ folder. If you want to try out more possibilities, please visit [**Our open-source community**](https://www.lightflow.ai/) for more public examples.
4649

4750
### Contributing
4851

49-
If you have any comments, suggestions, or encounter issues with our project, please feel free to raise them through an issue, and we also welcome pull requests at any time!
52+
If you have any comments, suggestions, or encounter issues with our project, please feel free to raise them through an issue, and we also welcome pull requests at any time!
5053
You are also more than welcomed to share your own LightDiffusionFlow on [**Our open-source community**](https://www.lightflow.ai/).
5154

5255
### Credits

README_CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Stable Diffusion Web UI 以下简称 SD Web UI。
4040
- 在SD Web UI上,点击文件框选择对应的flow文件,即可导入文件中的设置。
4141
- 也可以直接把flow文件拖入文件框内完成导入。
4242

43+
**目前,该插件支持SD WebUI v1.5及以上版本,尚未对早期版本进行兼容性测试。**
44+
**如果不是因为基本功能的兼容性问题,强烈建议在使用此插件之前升级到v1.6或更高版本。**
4345
### 注意事项
4446

4547
* 每次导入新的flow文件之前,最好刷新一下SD Web UI页面,因为插件只会修改已保存的参数选项。

javascript/state.core.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,17 @@ state.core = (function () {
659659
if(filename != ".flow"){
660660
// const handle = window.showDirectoryPicker();
661661
// console.log(handle)
662+
662663
state.utils.saveFile(filename, stored_config);
664+
665+
fetch('https://api.lightflow.ai/openapi/access?action=export')
666+
.then(response => response.json())
667+
.then(config => {
668+
console.log(config)
669+
}).catch(function(e) {
670+
console.log("Oops, export callback error!");
671+
});
672+
663673
}
664674

665675
}).catch(error => console.error('[state]: Error getting Flow file:', error));

javascript/state.utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ state.utils = {
5757
}
5858
if(downloadUrl == undefined){downloadUrl = data["files"][0]["downloadUrl"]}
5959
//} catch (error) {}
60+
}).catch(function(e) {
61+
console.log("search model error!");
6062
});
6163

6264
return downloadUrl

scripts/lightdiffusionflow_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ def init():
174174
try:
175175
Flow_Save_mode = webui_settings["lightdiffusionflow-mode"]
176176
except:
177-
Flow_Save_mode = "Core"
177+
pass
178178

179179
# 自动纠正错误的参数
180180
try:
181181
Auto_Fix_Params = webui_settings["lightdiffusionflow-auto-fix-params"]
182182
except:
183-
Auto_Fix_Params = True
183+
pass
184184

185185
language_successed = False
186186
auto_language = False

scripts/state_api.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ def find_checkpoint_from_hash(hash:str):
134134

135135
def SearchingCheckPointByHashFromCivitai(hash:str):
136136
hash_str = hash.replace("[","").replace("]","").strip()
137-
response = requests.get("https://civitai.com/api/v1/model-versions/by-hash/"+hash_str)
138-
if(response.status_code == 200):
139-
print(response.content)
137+
try:
138+
response = requests.get("https://civitai.com/api/v1/model-versions/by-hash/"+hash_str)
139+
if(response.status_code == 200):
140+
print(response.content)
141+
except:
142+
pass
140143

141144
def set_lightdiffusionflow_file():
142145
global Preload_File
@@ -592,9 +595,18 @@ def fn_import_workflow(workflow_file):
592595
with open(config_file, mode='r', encoding='UTF-8') as f:
593596
workflow_json_str = f.read()
594597
workflow_json = json.loads(workflow_json_str)
598+
599+
try:
600+
response = requests.get("https://api.lightflow.ai/openapi/access?action=import")
601+
if(response.status_code == 200):
602+
pass
603+
except:
604+
pass
605+
595606
else:
596607
print("invalid file!")
597608

609+
598610
workflow_json = config_filter(workflow_json)
599611

600612
Webui_Comps_Cur_Val = []

0 commit comments

Comments
 (0)