-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poc of use js front end to get loras list #156
poc of use js front end to get loras list #156
Conversation
const shareid_widget = this.widgets.find(widget => widget.name === "share_id"); | ||
|
||
if (shareid_widget) { | ||
shareid_widget.callback = onTextChange; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前端的主要作用,是通过设置 shareid 那个文本框的回调,监控文本改变事件。
然后在文本改变的事件里,像后端发请求,得到 loras list
showcase.py
Outdated
|
||
share_id = data.get("share_id") | ||
print(f"use {share_id} to get the loras_list...") | ||
loras_list = ["flux/lora1.safetensors", "flux/lora2.safetensors"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 loras_list 应该来自网络请求。 loras_list 建议放上一个默认的美甲模型,使得 loras_list 的长度一定是 >=1 的,这样前端的逻辑就完全不用改了
showcase.py
Outdated
@@ -119,3 +119,23 @@ async def get_file_content(request): | |||
status=500, | |||
content_type="application/json", | |||
) | |||
|
|||
|
|||
@PromptServer.instance.routes.post("/bizyair/shareloras") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段添加后端的代码,是临时放在这的。请根据需要挪到合适的地方。
* Add SharedLoraLoader node * poc of use js front end to get loras list (#156) * poc * refine * refine --------- Co-authored-by: FengWen <[email protected]> * fix SharedLoraLoader * Remove unused comments --------- Co-authored-by: Yao Chi <[email protected]>
* share model * fix * Add SharedLoraLoader node (#154) * Add SharedLoraLoader node * poc of use js front end to get loras list (#156) * poc * refine * refine --------- Co-authored-by: FengWen <[email protected]> * fix SharedLoraLoader * Remove unused comments --------- Co-authored-by: Yao Chi <[email protected]> * refine message and add docs --------- Co-authored-by: dantegarden <[email protected]> Co-authored-by: FengWen <[email protected]> Co-authored-by: Yao Chi <[email protected]>
No description provided.